Friday, October 23, 2015

PowerCLI script to move VMs from the Root Resource pool to a Specific Resource Pool

While troubleshooting an performance issue on a VM today, I noticed a misconfiguration in the resource pool settings. In this specific cluster, there was a bunch of VMs in the root of the resource pool, hence, skewing the resources to be granted when there is contention.

Here's a one liner PowerCLI code to move all the VMs in the root of the cluster to a specific resource pool:

Get-Cluster "Cluster-Name" | Get-VM | where {$_.ResourcePool.Name -eq "Resources"} | Move-VM -Destination (Get-Cluster "Cluster-Name" | Get-ResourcePool "Resource-Pool-Name")

No comments:

Post a Comment