Find memory/CPU reservation on all VMs

Find memory/CPU reservation on all VMs

To retrieve the settings for reservation of both memory and CPU run the following PS scripts

## retrieve the values for MemReservationMB for the given VMs
Get-Cluster “myCluster” | Get-VM | Get-VMResourceConfiguration | select VM,MemReservationMB

## retrieve the values for CPUReservationMhz for the given VMs
Get-Cluster “myCluster” | Get-VM | Get-VMResourceConfiguration | select VM,CPUReservationMhz

If you want to go through a set all VM memory/CPU reservations to “0” run the following

## set the MemReservationMB to 0 for given VMs
Get-Cluster “myCluster” | Get-VM | Get-VMResourceConfiguration | Set-VMResourceConfiguration -MemReservationMB 0 -Confirm:$false

## set the CPUReservationMhz to 0 for given VMs
Get-Cluster “myCluster” | Get-VM | Get-VMResourceConfiguration | Set-VMResourceConfiguration -CPUReservationMhz 0 -Confirm:$false

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.