PowerCLI – Indentify VMs with RDM disks

SCRIPT SYNOPSIS / REASON CREATED – At the time of this script, we have over 800 VMs across multiple datacenters. In a few of those DCs, we have a small number of VMs that have RDMs attached (for use with Microsoft Clustering). Our current environment is VMware 5.5 hosts, so we still are VERY careful when doing anything (vMotion, etc.) on these VMs with RDMs. Per the article at https://blogs.vmware.com/apps/2015/02/say-hello-vmotion-compatible-shared-disks-windows-clustering-vsphere.html this will be a non-issue for us when we get all hosts upgraded to vSphere 6.


OVERVIEW OF STEPS – This is a very simple script that connects to your vCenter with the supplied credentials and then gets all VMs in the environment, specifically looking for VMs with a disk type of “RawPhysical” or “RawVirtual.” Once the script identifies VMs with these types of disks, it outputs the Parent (VM) Name, Disk File Type, and SCSI Canonical Name. There is an additional line of code that is currently remarked out that can output the results to a CSV file if desired.