Identifying virtual machines with Raw Device Mappings (RDMs) using PowerCLI (2001823)
This article provides a method for obtaining and displaying a list of registered virtual machines that have attached Raw Device Mappings (RDMs) using vSphere PowerCLI.
This method cannot identify virtual machine disks that are unregistered, or for RDM files that are not associated with a virtual machine. For more information, see Identifying virtual disks pointing to Raw Device Mappings (RDMs) (1005937).
- Open the vSphere PowerCLI command-line. For more information, see the vSphere PowerCLI Documentation.
- Run the command:
Get-VM | Get-HardDisk -DiskType "RawPhysical","RawVirtual" | Select Parent,Name,DiskType,ScsiCanonicalName,DeviceName | fl
This command produces a list of virtual machines with RDMs, along with the backing SCSI device for the RDMs.
An output looks similar to:
Parent Virtual Machine Display Name Name Hard Disk n DiskType RawVirtual ScsiCanonicalName naa.60123456789abcdef0123456789abcde DeviceName vml.020000000060123456789abcdef0123456789abcde1234567890ab
If you need to save the output to a file the command can be modified:
Get-VM | Get-HardDisk -DiskType "RawPhysical","RawVirtual" | Select Parent,Name,DiskType,ScsiCanonicalName,DeviceName | fl | Out-File –FilePath RDM-list.txt
- Identify the backing SCSI device from either the ScsiCanonicalName or DeviceName identifiers. For more information, see Identifying disks when working with VMware ESX (1014953).