ESXi 4.1 list VMs with mounted ISOs

If you can’t remove an .iso file, because it’s mounted by a VM, you can search through many VMs, or use this sloppy one liner:

eval `vim-cmd vmsvc/getallvm | grep -v Vmid | awk '{print "echo \"vmName: "$2"\"; vim-cmd vmsvc/device.getdevices "$1 ";"}'` | grep -e ".iso\|vmName" | grep -v fileName | grep -B1 summary 

Leave a Reply

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