Finding VMs with disks on multiple different datastores – Script of the Day
I was looking at a VM on one of our hosts and noticed the rather odd configuration showed that the VM had 2 disks provisioned (not unusual), and that the 2 disks had been presented on different storage (very unusual for non clustered VMs in our environment)
I figured, the easiest way to identify all of the VMs that are using VMDKs on multiple different datastores was PowerCli.
The result – just a one liner.
PS:7 >get-vm | ?{$_.DatastoreIdList.count -gt 1} Name PowerState Num CPUs Memory (MB) ---- ---------- -------- ----------- labserver001 PoweredOn 1 8192 labserver 17a PoweredOn 2 1280 labserver21 PoweredOn 1 8192 labserver17b PoweredOn 2 1152