Blog

Powercli Is hot add enabled?

Here is a very simple little script to use in order to identify if a VM already has hot add enabled this will pipe out to a csv file and enable you to then filter on false and concentrate on changing those machines only. This is especially useful when using my script to change the value for multiple VMs found here http://virtuallyhardware.com/powercli-script-to-enable-hot-add/ you can use the output from this script to populate the input from that script and schedule it to run out of hours.

I have chosen to run this script against a cluster rather than for each vm, depending on how large your environment is you can run the script as you wish. It is also a one liner so just edit and copy and paste into a powercli session already connected to vCenter.

Get-cluster MyCluster | Get-VM | Select-Object Name, VMHost, @{N="CpuHotAddEnabled"; E={$_.ExtensionData.config.CpuHotAddEnabled}}, @{N="MemoryHotAddEnabled"; E={$_.ExtensionData.config.MemoryHotAddEnabled}} | Export-Csv -NoTypeInformation -Path c:\hotaddenabled.csv

 

Leave a Comment

Your email address will not be published. Required fields are marked *