Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am running SCVMM 2008 R2 with 3 hosts. Right now I am patching the hosts, so I am running the command

disable-vmhost hostA -MoveWithinCluster

Is there a command that I can run or switch I can enable to direct where the machines on hostA get migrated to? What happened last time I ran it was all the machines migrated to a host that was already hosting numerous VMs and there was another host that was completely empty.

share|improve this question

That option doesn't exist in that specific commandlet.

However you can achieve the result you want by getting all the hosts on the node with the get-vm command and then piping them to the move-vm to a host you specify. After that you can run disable-vmhost to prevent machines from moving back there during maintenance.


Get-VM|?{$_.VMHost -eq 'hostA'}|Move-VM -VMHost 'HostB'
share|improve this answer
Thanks. I will give that a try. I believe though I would have a similar problem since it would move all the moves to HostB. I have seen a script that evaluates the Host Rating and moves all the VMs to the highest rated host. I appreciate your answer – Mike Feb 22 '12 at 15:36

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.