I have a script that can validate EVC, check datastore freespace, configure multi NIC/PGs on the VM to new destination port groups and then Move the VM. We use the script to move VMs to different “non linked/Diff SSO domain” vCenters. I had to add an additional clone step on the source vCenter if I wanted to copy a template/VM to another vCenter. Maybe we can add a -clone to the move-vm command (ignore the last step of deleting the vm in the move task?) or update new-vm to accept the cross vCenter (and diff SSO domain) clone. We also use content library subscriptions to help with this but requires a lot more steps.
I was able to get this working. Here are the commands I ran.
Connect-VIServer vCenter1 -Force
Connect-VIServer vCenter2 -Force
$destinationDatastore = Get-Datastore Datastore1
$destinationHost = Get-VMHost VMHost1
$sourceVM = Get-VM -Name TestVM -Server vCenter1
New-VM -Name TestVM-Clone -VM $sourceVM -Datastore $destinationDatastore -VMHost $destinationHost
Has anyone been able to get this working? I just installed VMWare.PowerCLI 12.3.0 and still get errors.
I use connect-viserver server1,server2 in the beginning then call out server1 or server 2 on each command depending on what vcenter its connecting to
New-VM The object 'vim.EnvironmentBrowser:envbrowser-17' has already been deleted or has not been completely created
Shipped in PowerCLI 12.3
I would like to be able to build a vm template ONCE, then use this or something similar to clone the template to the other vcenters.
I have a script that can validate EVC, check datastore freespace, configure multi NIC/PGs on the VM to new destination port groups and then Move the VM. We use the script to move VMs to different “non linked/Diff SSO domain” vCenters. I had to add an additional clone step on the source vCenter if I wanted to copy a template/VM to another vCenter. Maybe we can add a -clone to the move-vm command (ignore the last step of deleting the vm in the move task?) or update new-vm to accept the cross vCenter (and diff SSO domain) clone. We also use content library subscriptions to help with this but requires a lot more steps.
X-vCenter vMotion is already part of PowerCLI.
Yes please!!!!