Identifying virtual machines with Raw Device Mappings (RDMs) using PowerCLI
search cancel

Identifying virtual machines with Raw Device Mappings (RDMs) using PowerCLI

book

Article ID: 310879

calendar_today

Updated On:

Products

VMware vCenter Server VMware vSphere ESXi

Issue/Introduction

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.

Environment

VMware ESX 4.0.x
VMware vSphere PowerCLI 4.0
VMware vCenter Server 4.0.x
VMware ESXi 3.5.x Installable
VMware ESXi 4.1.x Installable
VMware ESX 4.1.x
VMware ESXi 4.1.x Embedded
VMware ESXi 4.0.x Embedded
VMware ESXi 4.0.x Installable
VMware vSphere PowerCLI 4.1
VMware ESX Server 3.5.x
VMware ESXi 3.5.x Embedded
VMware vCenter Server 4.1.x

Resolution

  1. Open the vSphere PowerCLI command-line.
     
  2. 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
  3. Identify the backing SCSI device from either the ScsiCanonicalName or DeviceName identifiers. For more information, see Identifying disks when working with VMware ESX (1014953).


Additional Information