Powershell script to Live Migrate Hyper-V Virtual Machines to another Node in a Cluster on a planned Host Shutdown

Powershell script to Live Migrate Hyper-V Virtual Machines to another Node in a Cluster on a planned Host Shutdown

by Stan Czerno 21. July 2011 18:09

On a planned or gracefull Hyper-V Host Shutdown, Live Migrate VMs to another Node in the Cluster. This Script is designed to work with a Two-Node Cluster.

You need to configure Group Policy or the Local Policy for the host to have a Shutdown Script. You'll find these settings under Computer Settings > Windows Settings > Scripts (Startup/Shutdown).

Using the PowerShell Scripts tab, set PowerShell scripts to run First so that the live migrations are performed before shutdown.

Let me know what you think about the script and if you have a better way of doing this.

http://www.czerno.com/default.asp?inc=/html/windows/hyperv/cluster/HyperV_Live_Migrate_VMs.asp

Tags:

Hyper-V

Comments (2) -

mbrayez
mbrayez United States
2/23/2012 8:34:31 AM #

many thanks for your powerfull scripts,
but if i had some VMs that i dont want them to LM, what i had to add to the script
thanks in advance

regards

Stan Czerno
Stan Czerno United States
2/23/2012 8:42:40 AM #

If you have VMs you do not want to Live Migrate then I suppose the easiest thing to do would be to not include them in the Cluster.

Add comment

  Country flag

biuquote
  • Comment
  • Preview
Loading

Category list

RecentComments

Comment RSS