Monday, September 22, 2014

Live Migrating multiple VMs [HyperV 2008]

This powershell script will let you live migrate multiple virtual machines serially.
The script will ask you to select which machines do you want to migrate and to which destination node as in the below screenshots

To run the script on Windows 2008 R2, you need to install powershell 3.0


Import-Module FailoverClusters

$clustername = Get-Cluster

$vms = Get-ClusterGroup  -Cluster $clustername  | Out-GridView -PassThru -Title "Select VMs to live migrate"
$destination = Get-ClusterNode | Out-GridView -Title "Select destination HyperV host" -PassThru
$count = 0

foreach ($vm in $vms){
 $count += 1
 $total = $vms.count
 write-output "[$count/$total] migrating $vm to $destination..."
 Move-ClusterVirtualMachineRole -Name $vm -Node $destination

write-output "All Done"

1 comment:

  1. windows 10 activation upgrade , free product key code microsoft office home and business 2010 , windows server 2012 r2 buy , product key for window 7 home premium , norton internet security key 2012 , buy windows 10 enterprise key , windows vista home key , windows 7 home premium to ultimate anytime upgrade key genuine free , toD3fh

    office 2016 product serial free

    windows 10 enterprise key

    office 2016 product key

    Windows 10 product key code sale

    office 2016 product key sale