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. For more information, see Identifying virtual disks pointing to Raw Device Mappings (RDMs) (1005937).


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. For more information, see the vSphere PowerCLI Documentation.
     
  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:
     
    ParentVirtual Machine Display Name
    NameHard Disk n
    DiskTypeRawVirtual
    ScsiCanonicalNamenaa.60123456789abcdef0123456789abcde
    DeviceNamevml.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

Identifying Raw Device Mappings (RDMs) using the vSphere Client

Identifying virtual disks pointing to Raw Device Mappings (RDMs)
Identifying disks when working with VMware ESXi/ESX
PowerCLI を使用して Raw デバイス マッピング (RDM) が構成された仮想マシンを識別する
使用 PowerCLI 标识使用裸设备映射 (RDM) 的虚拟机