I am using the MOVE-VM command to perform automatic migrations of VMs from one vCenter to another. I have some VMs that have disks split across multiple datastores. How do I specify which target vCenter datastores to place my disks on?
With the cmdlet you can't specify that, you will have to use API method.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Afaik you cannot do this with the Move-VM cmdlet. It only accepts a single datastore as destination.
You should be able to do it using the RelocateVM_Task of the VirtualMachine SDK object.
You would need to build a VMware.Vim.VirtualMachineRelocateSpec object for the virtual machines config files specifying the destination datastore MoRef. Then add a VMware.Vim.VirtualMachineRelocateSpecDiskLocator object for each VMDK specifying its DiskID and Datastore MoRef from the destination.
Thanks LucD,
do you have some example to use API method?
You can start with the xMove-VM.ps1 script.
You will have to adapt line 126 if the datastores on the target vCenter do not have the same names as the ones on the source vCenter.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I tried to use the script (I changed some parameters), but the vm relocation failed with
"Authenticity of the host's SSL certificate is not verified."
9/27/2023 10:14:46 PM Wait-Task The operation for the entity "MasterImagew11v2" failed with the following message: "Authenticity of the host's SSL certificate is not verified."
Did you set the InvalidCertificateAction to Ignore with the Set-PowerCliConfiguration cmdlet?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I tried setting invalidCertificateAction to Ignore (I set it on the script), but the error persists
Did you do that for all Scopes?
And did you stop/start your PS session?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Hi LucD,
This is my settings
The certificate error is shown when starting the relocation and I saw this error on vcenter event:
I'll give you two pieces of information: my goal is to move VMs from an infrastructure with vCenter 6.7 to one with vCenter 7u3. The two vCenters are not in Enhanced Linked Mode and see the same LUNs (my goal is to do a vMotion without interruption of service). From Web Gui everything works, the only problem is that I have to migrate hundreds of VMs.
There can be many possible causes, have a look at the options in Re: Authenticity of the host's ssl certificate is ... - VMware Technology Network VMTN
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Did you find a solution to the authenticity error?