VMware Cloud Community
MattG
Expert
Expert
Jump to solution

Can move-vm migrate a powered off VM to a DRS cluster?

When I try to move-vm a powered off VM to a DRS cluster destination,  it says it can't migrate a powered off VM to a DRS cluster.   I can explicitly name host destination and it works,  but that defeats the purpose of using DRS and requires me to script out the destination hosts.

Am I doing something wrong or should I be able to migrate a powered off VM to a DRS cluster?

Thanks,

-MattG

-MattG If you find this information useful, please award points for "correct" or "helpful".
Reply
0 Kudos
1 Solution

Accepted Solutions
mattboren
Expert
Expert
Jump to solution

Hello, -

I get the same behavior as you when trying to move a PoweredOff VM to a DRS cluster and specifying the cluster as the value for the -Destination parameter to Move-VM (using both PowerCLI v5.1 Rel 2 and v5.5 Rel 1).  Not quite what I would expect.

As a workaround, and without having to name a particular host as a destination, you could employ some Get-Random, doing something like:

Move-VM myVM0 -Destination (Get-Cluster myDestDRSCluster | Get-VMHost | ?{$_.State -eq "Connected"} | Get-Random) -RunAsync

That should get the machine to said cluster, and onto some host that is in Connected state.  A subsequent power-on operation (whenever you eventually do that) should then see DRS starting up the VM on a suitable host in the cluster.

Maybe the dev team can comment on whether this behavior is the expected/desired behavior.

Anyway, how does that do for you?

View solution in original post

Reply
0 Kudos
2 Replies
mattboren
Expert
Expert
Jump to solution

Hello, -

I get the same behavior as you when trying to move a PoweredOff VM to a DRS cluster and specifying the cluster as the value for the -Destination parameter to Move-VM (using both PowerCLI v5.1 Rel 2 and v5.5 Rel 1).  Not quite what I would expect.

As a workaround, and without having to name a particular host as a destination, you could employ some Get-Random, doing something like:

Move-VM myVM0 -Destination (Get-Cluster myDestDRSCluster | Get-VMHost | ?{$_.State -eq "Connected"} | Get-Random) -RunAsync

That should get the machine to said cluster, and onto some host that is in Connected state.  A subsequent power-on operation (whenever you eventually do that) should then see DRS starting up the VM on a suitable host in the cluster.

Maybe the dev team can comment on whether this behavior is the expected/desired behavior.

Anyway, how does that do for you?

Reply
0 Kudos
MattG
Expert
Expert
Jump to solution

Matt,

As you pointed out while this seems to be a bug,  it is not necessary to specify the cluster as DRS will automatically migrate the VMs to other hosts in the cluster on Power-On.

Thanks,

-MattG

-MattG If you find this information useful, please award points for "correct" or "helpful".
Reply
0 Kudos