VMware Cloud Community
trimblrd
Contributor
Contributor
Jump to solution

Move-VM difficulties

All, I am trying to migrate a list of VMs from one cluster to another.  SDRS is enabled for both clusters.  However, the hosts and storage in each cluster are in no way connected.  They are all in the same datacenter but that is it.  When I do a live migration using the web console, all works well.  When I attempt to script the migrations, I get errors.  Here is the error.

Move-VM : 12/21/2017 1:44:48 PM    Move-VM        A specified parameter was not correct.

Storage DRS placement: vm VMNAME current host not connected to pod StorageCluster   

At C:\Temp\PowerShell\MoveListOfVMs.ps1:40 char:5

+     Move-VM -VM (Get-VM -Name $VM) -Datastore $destinationdatastore

+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [Move-VM], InvalidArgument

    + FullyQualifiedErrorId : Client20_VmServiceImpl_RelocateVmThroughSdrs_ViError,VMware.VimAutomation.ViCore.Cmdlets.Commands.MoveVM

I am building the VM move command like so.

Move-VM -VM (Get-VM -Name $VM) -Datastore $destinationdatastore

Why does this work in the web console but not with PowerCLI?  Is there any way I can make this work?  We need to live migrate the VMs and shutting them down is not an option.

Thanks!

1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

You do not seem to have provided a Destination.
Use the target cluster, or one of the ESXi nodes in tere, then the Datastore connectivity will be checked against that cluster/ESXi node.

Your code is a svMotion, and since that target datastores is not known to the source cluster, you get that message


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

8 Replies
LucD
Leadership
Leadership
Jump to solution

Which vSphere and PowerCLI version are you running this against?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
LucD
Leadership
Leadership
Jump to solution

You do not seem to have provided a Destination.
Use the target cluster, or one of the ESXi nodes in tere, then the Datastore connectivity will be checked against that cluster/ESXi node.

Your code is a svMotion, and since that target datastores is not known to the source cluster, you get that message


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

trimblrd
Contributor
Contributor
Jump to solution

vSphere 5.5 and PowerCLI 6.5.4

0 Kudos
trimblrd
Contributor
Contributor
Jump to solution

Ok, I will give that a try.  I saw this note in the Move-VM command reference but wasn't sure I needed to specify both parameters.

0 Kudos
LucD
Leadership
Leadership
Jump to solution

Can you try with the Destination, see my previous reply


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

trimblrd
Contributor
Contributor
Jump to solution

I think the -Destination option will work but I have a few observations.

When I specify a host, it works perfectly.  If I specify a RP on that host, it fails.

Move-VM : 12/21/2017 2:26:12 PM    Move-VM        Destination is a Resource Pool owned by a Cluster, but the VM you are trying to

move is not in that Cluster. Please select for destination a Host in that Cluster or a Resource Pool owned by a stanalone Host.

So the way I read this is that my only option is to spell out a host?

0 Kudos
LucD
Leadership
Leadership
Jump to solution

That's how I read it as well.

Might be related to the vSphere version though


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

trimblrd
Contributor
Contributor
Jump to solution

Thanks for the help!

0 Kudos