Hi Folks,
I'm trying to deploy OVA using Import-Vapp cmdlet, logged in to Vcenter. The OVA is located in a share point.
$ovapath = "\\192.168.101.109\Amp-Ovf\VCE-W2K12R2-STD-Template_1805.ova"
Import-VApp -Name testvm -VMHost 10.12.202.146 -Source $ovapath -Datastore "MGMT-DS-04" -DiskStorageFormat thin -Ovfconfiguration $ovaconfig -Force -RunAsync:$true
The command is executing without error. But when it comes to VC, the VM deploying steps are executing after some steps the VM is getting Destroy automatically. Snapshot of VC task is attached.
Im using Powercli 10.1 also have Powercli 6.5 Modules. Powershell version is 5.1.
Any help will be appreciated. TIA.
What PowerCLI modules do you have?
Do a
Get-Module -Name VMware* -ListAvailable
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Directory: C:\windows\system32\WindowsPowerShell\v1.0\Modules ModuleType Version Name ExportedCommands ---------- ------- ---- ---------------- Script 6.7.0.8... VMware.DeployAutomation {Add-DeployRule, Add-ProxyServer, Add-ScriptBundle, Copy-DeployRule...} Binary 6.5.1.6... VMware.DeployAutomation {Add-DeployRule, Add-ProxyServer, Add-ScriptBundle, Copy-DeployRule...} Script 6.7.0.8... VMware.ImageBuilder {Add-EsxSoftwareDepot, Add-EsxSoftwarePackage, Compare-EsxImageProfile, Export-EsxImageProfile...} Binary 6.5.1.6... VMware.ImageBuilder {Add-EsxSoftwareDepot, Add-EsxSoftwarePackage, Compare-EsxImageProfile, Export-EsxImageProfile...} Manifest 6.5.4.7... VMware.PowerCLI Script 6.7.0.8... VMware.Vim Script 10.1.0.... VMware.VimAutomation.Cis.Core {Connect-CisServer, Disconnect-CisServer, Get-CisService} Binary 6.5.4.6... VMware.VimAutomation.Cis.Core {Connect-CisServer, Disconnect-CisServer, Get-CisService} Binary 6.5.1.5... VMware.VimAutomation.Cloud {Add-CIDatastore, Connect-CIServer, Disconnect-CIServer, Get-Catalog...} Script 10.1.0.... VMware.VimAutomation.Common Manifest 6.5.4.6... VMware.VimAutomation.Common Script 10.1.0.... VMware.VimAutomation.Core {Add-PassthroughDevice, Add-VirtualSwitchPhysicalNetworkAdapter, Add-VMHost, Add-VMHostNtpServer...} Binary 6.5.2.6... VMware.VimAutomation.Core {Add-PassthroughDevice, Add-VirtualSwitchPhysicalNetworkAdapter, Add-VMHost, Add-VMHostNtpServer...} Script 6.5.4.7... VMware.VimAutomation.HA Get-DrmInfo Binary 6.5.4.7... VMware.VimAutomation.HA Get-DrmInfo Script 7.1.0.7... VMware.VimAutomation.HorizonView {Connect-HVServer, Disconnect-HVServer} Binary 7.1.0.5... VMware.VimAutomation.HorizonView {Connect-HVServer, Disconnect-HVServer} Binary 6.5.1.5... VMware.VimAutomation.License Get-LicenseDataManager Binary 2.0.0.6... VMware.VimAutomation.Nsxt {Connect-NsxtServer, Disconnect-NsxtServer, Get-NsxtService} Binary 6.5.1.5... VMware.VimAutomation.PCloud {Connect-PIServer, Disconnect-PIServer, Get-PIComputeInstance, Get-PIDatacenter} Script 10.1.0.... VMware.VimAutomation.Sdk {Get-InstallPath, Get-PSVersion} Manifest 1.0.0.5... VMware.VimAutomation.Sdk {Get-PSVersion, Get-InstallPath} Binary 6.5.1.5... VMware.VimAutomation.Srm {Connect-SrmServer, Disconnect-SrmServer} Binary 6.5.4.7... VMware.VimAutomation.Storage {Add-KeyManagementServer, Copy-VDisk, Export-SpbmStoragePolicy, Get-KeyManagementServer...} Script 1.2.0.0 VMware.VimAutomation.StorageUtility Update-VmfsDatastore Script 1.1 VMware.VimAutomation.StorageUtility Update-VmfsDatastore Binary 6.5.1.5... VMware.VimAutomation.Vds {Add-VDSwitchPhysicalNetworkAdapter, Add-VDSwitchVMHost, Export-VDPortGroup, Export-VDSwitch...} Binary 6.5.4.7... VMware.VimAutomation.Vmc {Connect-Vmc, Disconnect-Vmc, Get-VmcService, Connect-VmcServer...} Binary 6.5.1.5... VMware.VimAutomation.vROps {Connect-OMServer, Disconnect-OMServer, Get-OMAlert, Get-OMAlertDefinition...} Script 6.5.1.7... VMware.VumAutomation {Add-EntityBaseline, Copy-Patch, Get-Baseline, Get-Compliance...} Binary 6.5.1.5... VMware.VumAutomation {Add-EntityBaseline, Copy-Patch, Get-Baseline, Get-Compliance...}
Strange that you have the PowerCLI modules in the C:\windows\system32\WindowsPowerShell\v1.0\Modules folder.
I would suggest removing all the PowerCLI modules in that folder.
And then installing the latest version with Install-Module
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks for the suggestion LucD. I removed all of the modules from the location and installed powercli 6.5.1. Connected to a ESXi host using connect-viserver cmdlet.
Trying to get-ovfconfiguration it is giving error: Get-OvfConfiguration : 8/13/2018 6:53:46 PM Get-OvfConfiguration This cmdlet requires a vCenter Server connection.
I have requirement to deploy initial set of VMs only from ESXi host and also only with OVA, not using templates.
Why are you installing PowerCLI 6.5.1?
Is that the old MSI installation?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
For now i've skipped -ovfconfiguration and proceeded to Import-Vapp. The command executed successful. But the task under ESXi host shows "Failed - The task was canceled by a user."
PowerCLI C:\>$ovapath = "\\192.168.101.109\Amp-Ovf\1805\VCE-W2K12R2-STD-Template_1805.ova"
PowerCLI C:\> Import-VApp -Name "Test-host" -VMHost 10.73.45.13 -Source $ovapath -Datastore "datastore1" -DiskStorageFor
mat thin -Force -RunAsync:$true
Name State % Complete Start Time Finish Time
---- ----- ---------- ---------- -----------
Running 0 07:19:55 PM
Yeah, It is installed from an old MSI.
Can't you upgrade to a more recent version?
You're missing out on a number of bug fixes.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I installed Powercli 10.1.0 modules in Powereshell. Tried to deploy ovf, it is getting deploy successful. When I try to feed the VM properties using Get-ovfconfiguration cmdlet it is giving error, Get-OvfConfiguration This cmdlet requires a vCenter Server connection. Can't this possible without VC? TIA
No, that should work with a vCenter connection.
Can you share the code you are using, and where and when you get the error?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Here I'm connected to a ESXi host.
PowerCLI C:\Program Files (x86)\VMware\VMware OVF Tool> Connect-VIServer 10.73.45.13
Name Port User
---- ---- ----
10.73.45.13 443 root
PowerCLI C:\>$ovapath = C:\VAST\vipin\signed.ova
PowerCLI C:\> $ovaconf = Get-OvfConfiguration -Ovf $ovapath
Get-OvfConfiguration : 8/14/2018 3:53:37 PM Get-OvfConfiguration This cmdlet requires a vCenter Server connection.
At line:1 char:12
+ $ovaconf = Get-OvfConfiguration -Ovf $ovapath
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ResourceUnavailable: (:) [Get-OvfConfiguration], ViServerConnectionException
+ FullyQualifiedErrorId : ViCore_SharedParameterHelper_ThrowVCenterServerConnectionIsRequiredError,VMware.VimAutomation.ViCore.Cmdlets.Commands.OVF.GetOvfConfiguration
I'm expecting something like this below, so that I can feed the values by drilling down to each properties
PowerCLI C:\Program Files (x86)\VMware\VMware OVF Tool> $ovaconf
============================
OvfConfiguration: signed.ova
Properties:
-----------
NetworkMapping
vami
vm
Oops, I misread your last remark.
Yes, you need a vCenter connection for that.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Is it possible to deploy a VM along with it properties without a VC. There should be someway to deploy from a esxi host.
As per my requirement I need to deploy a set of VM before deploying vCenter.
To clarify, it's the cmdlet that insists on a vCenter connection.
You can perfectly deploy an OVA to an ESXi node without vCenter connection.
You can do that for example with the ovftool or from within the ESXi Embedded Host Client.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thank you LucD. Can you please guide me how to deploy a OVA using Ovftool or from within the ESXi host client.
From within the Host client (https://<your-esxi-node>/ui ) you select Create/Register VM
One of the options in the pop-up form is Deploy a Virtual Machine from an OVA or OVF
For the ovftool have a look at Import and Export Virtual Machines from the command line with VMware's OVF Tool
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Using ovftool we are bundling the ovf to a new OVA bundle.
PowerCLI C:\Program Files\VMware\VMware OVF Tool> .\ovftool.exe 'C:\VAST\Rail Test\Test\ESRS_VE.x86_64-326.0006.0.ovf' C:\Users\gurump\Documents\newsigned.ova
Opening OVF source: C:\VAST\Rail Test\Test\ESRS_VE.x86_64-326.0006.0.ovf
The manifest validates
Opening OVA target: C:\Users\gurump\Documents\newsigned.ova
Writing OVA package: C:\Users\gurump\Documents\newsigned.ova
Transfer Completed
Completed successfully
.\ovftool.exe --disableVerification --noSSLVerify --datastore="datastore1" $newovf vi://root@10.73.45.13
Opening OVA source: C:\Users\gurump\Documents\newsigned.ova
The manifest validates
Enter login information for target vi://10.73.45.13/
Username: root
Password: ********
Opening VI target: vi://root@10.73.45.13:443/
Info:
Now the VM is getting deploy successfully. How to input VM specific values like Hostname, IP, DNS, Subnet,etc.
Have a look at page 22 of this OVF Tool Guide
It's the -prop parameter you need to use.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Hi LucD, Thank you. I tried to deploy OVA using ovftool version 4.2.
The VM is deployed with NO feeded properties. Not sure what I'm missing here.
Here is the command which i'm using,
./ovftool.exe --name="TestVM-2" --X:injectOvfEnv --powerOn --acceptAllEulas -ds=datastore1 -dm=thin --X:enableHiddenProperties --noSSLVerify --machineOutput --prop:vami.dns1.ESRS=10.11.12.22 --prop:vami.dns2.ESRS=10.11.12.23 --prop:vami.gateway.ESRS=192.168.10.1 --prop:vami.ip0.ESRS=192.168.10.100 --prop:vami.netmask0.ESRS=255.255.254.0 --prop:"vami.timezone.ESRS"="America/Merida" --prop:"vami.ntp.ESRS"="10.10.45.34" --prop:"vm.rootpw.ESRS"="VMwar3!!" $newovf vi://root:VMwar3!!@10.73.45.13