I want to find the VM file system usage, but only on VMs that have a vmdk on a particular device. The VM host could have storage from multiple devices, for instance EMC and IBM devices. I only want to know the amount of space used by VMs that have storage on an IBM device.
I'm trying to use powercli to find this information, but I can't 'tie' the information together. I'm not a VMWare admin, and so I'm having a hard time finding the correlation (and if my terminology is incorrect, sorry about that.)
I can find only the IBM disks with the following command:
Get-VMHost <host> | Get-VMHostHba -type FibreChannel | Get-ScsiLun -CanonicalName eui* -LunType disk
I can also get the file system usage with the following:
$AllVMs = Get-VMHost <host> | Get-VM
ForEach ($VM in $AllVMs) {
$Views = $VM | Get-View
ForEach ($View in $Views) {
Foreach ($Disk in $View.Guest.Disk) {
$disk.DiskPath
([math]::Round($disk.Capacity/ 1MB))
([math]::Round($disk.FreeSpace / 1MB))
}
}
}
However, how can I be sure that c:\ on host1 is on an IBM array and not an EMC array?