Noticed that when I migrated all my hosts to the new vCenter 5.1 that vCops vApp did not. The UI VM and the Analytics VM did migrate just not the vApp. Is there a way to export and then import the vApp with powercli?
Thanks
Andy
That seems to be a mistake in the PowerCLI 5.0.1 documentation. In PowerCLI 5.1 Release 2 this example uses the -Location parameter.
Hi Andy,
you can use the Export-VApp and Import-VApp cmdlets to move a vApp to another vCenter server.
So I would need to move the UI and the analytics VM's back to the old vCenter export the vApp as ovf template than import the ovf with import-vapp , is this correct ?
Moving the UI and the Analytics VM's back to the old vCenter, export the vApp as ovf template and then import the ovf with Import-VApp should work. But you can also export the empty vApp, import it in the new vCenter and then move the UI VM and Analytics VM into the VMware vCenter Operations Manager vApp.
Wouldnt let me export the vapp without them being there, probably because its exporting it as an ovf. I appreciate your help. I have moved them back to the old VC and am in the process of exporting the vapp. Will do some more troubleshooting once this is completed.
Thanks
Andy
Tried to import the vapp today using this command:
Import-vApp -Source "e:\files\VMware vCenter Operations Manager\VMware vCenter Operations Manager.ovf" -VMHost nsbmdit02 -Cluster "Production
Cluster 2" -Name vCops -Datastore nabmdsd02_vmcluster02_lun20_vmds02_t1_dr0 -force
But it errors out:
At E:\Import_vapp.ps1:1 char:130
+ Import-vApp -Source "e:\files\VMware vCenter Operations Manager\VMware vCente
r Operations Manager.ovf" -VMHost nsbmdit02 -Cluster <<<< "Production Cluster
2" -Name vCops -Datastore nabmdsd02_vmcluster02_lun20_vmds02_t1_dr0 -force
+ CategoryInfo : InvalidArgument: (:) [Import-VApp], ParameterBin
dingException
+ FullyQualifiedErrorId : NamedParameterNotFound,VMware.VimAutomation.ViCo
re.Cmdlets.Commands.ImportVApp
Am I overlooking something, not sure why it would error on the cluster , any help would be greatly appreciated.
Thanks
Andy
The Import-VApp cmdlet does not have a -Cluster parameter. So you should remove the -Cluster from the command.
Thanks for the quick reply will try it without the cluster perameter. I was using this as a guide , example 2 http://www.vmware.com/support/developer/PowerCLI/PowerCLI501/html/Import-VApp.html
That seems to be a mistake in the PowerCLI 5.0.1 documentation. In PowerCLI 5.1 Release 2 this example uses the -Location parameter.
Thanks Robert for the correct info, but now I recieve this error although its the same vDS that was exported from the old vcenter...
Import-VApp : 2/22/2013 7:59:25 AM Import-VApp Host did not have any
virtual network defined.
At E:\Import_vapp.ps1:1 char:12
+ Import-vApp <<<< -Source "e:\files\VMware vCenter Operations Manager\VMware
vCenter Operations Manager.ovf" -VMHost vmbmd0c080105.corp.contoso.com
-location "Production Cluster 2" -Name vCops -Datastore nabmdsd02_vmcluster02_l
un20_vmds02_t1_dr0 -force
+ CategoryInfo : InvalidOperation: (:) [Import-VApp], OvfNoHostNi
c
+ FullyQualifiedErrorId : Client20_VappServiceImpl_ImportVApp_CreateImport
SpecError,VMware.VimAutomation.ViCore.Cmdlets.Commands.ImportVApp
Ok got rid of the network error afterupdating the script:
$myCluster = Get-Cluster -Name "Production Cluster 2"
$vmHost = Get-VMHost -Name "vmbmdbj030148.corp.contoso.com"
$myDatastore = "nabmdsd02_vmcluster02_lun20_vmds02_t1_dr0"
Import-vApp -Source "e:\files\VMware vCenter Operations Manager\VMware vCenter Operations Manager.ovf" -VMHost $vmHost -Location $myCluster -Name "MyWebServerProduction1" -Datastore $myDatastore
But now I recievie this error:
Import-VApp : 2/22/2013 8:28:16 AM Import-VApp File ds:///vmfs/volume
s/4f7a062a-214b3fe6-1ba8-1cc1de1dcc7c/_deviceImage-0.iso was not found
At E:\Import_vapp.ps1:4 char:12
+ Import-vApp <<<< -Source "e:\files\VMware vCenter Operations Manager\VMware
vCenter Operations Manager.ovf" -VMHost $vmHost -Location $myCluster -Name "MyW
ebServerProduction1" -Datastore $myDatastore
+ CategoryInfo : NotSpecified: (:) [Import-VApp], FileNotFound
+ FullyQualifiedErrorId : Client20_NfcLease_WaitForNfcLeaseToInitialize_Er
ror,VMware.VimAutomation.ViCore.Cmdlets.Commands.ImportVApp
Thanks
Andy
Looks like a ISO was attached to both VM's on the export and now it cant recreate this connection. Back to square one and disconnect ISO and re-export...