Yes, PowerShell can be used to 'balance' the load of VMs across cluster nodes. The first step is for you to define what you mean by 'equally'. If it is simply a matter of having the same number of VMs on each node, you can write a script to counts the VMs on any host and then move the number you want to another host. Whatever you deem appropriate for your definition of equality can be placed into the PowerShell script to determine which VMs to migrate.
Eqaully Live Migrate VMs in Failover Cluster Windows 2016
Hello,
We have Windows 2016 Hyper V Cluster,
After rebooting one of the Node forcefully due to some Hardware issue.
Is there any way or Power shell command so that we can equally Live Migrate VMs to hyper-V Nodes instead of doing manually .
Thanks,
Prakash Thakor
2 answers
Sort by: Most helpful
-
-
Ian Xue (Shanghai Wicresoft Co., Ltd.) 30,376 Reputation points Microsoft Vendor
2020-08-28T07:51:03.443+00:00 Hi,
Load balancing is enabled by default and you could coufigure it with the cluster property AutoBalancerLevel. In powershell you could run(Get-Cluster).AutoBalancerLevel = <value> value behavior 1 Move when host is more than 80% loaded 2 Move when host is more than 70% loaded 3 Average nodes and move when host is more than 5% above average
For more details you could refer to this link
https://learn.microsoft.com/en-us/windows-server/failover-clustering/vm-load-balancing-deep-diveBest Regards,
Ian----------
Please remember to "Accept Answer" and upvote if the reply is helpful.