Code snippet – find/report all ballooning VMs

This script will help you to find all ballooning VMs:

Just fill in the name of your vCenter Server in the first line:

Connect-VIServer vCenter_Server
$vms = Get-VM 
Get-Stat -Entity $vms -Realtime -Stat mem.vmmemctl.average -MaxSamples 1 -ErrorAction SilentlyContinue |
where {$_.Value -gt 5} | Select @{N="VM";E={$_.Entity.Name}},Value

Leave a Comment

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