List VM’s with RDM

I was asked if it was possible to list all VM’s with Raw Disk Mappings on twitter, a quick search of the VI Toolkit community showed that LucD had already achieved this, I have copied the code below for reference:

7 thoughts on “List VM’s with RDM”

  1. I got your script to find ” list the VMs with RDM”. However I need to know how many RDMs are connected to each VM?

    I am running into Lun limitation and wants to see where all my luns got consumed?

  2. Hrm. Maybe there is some ignorance here on my part (wouldn’t be the first time!) but this is erroring out for me.

    Unexpected token ‘vms’ in expression or statement.
    At line:1 char:18
    + $report = @()$vms <<<< = Get-VM | Get-View + CategoryInfo : ParserError: (vms:String) [], ParentContainsErro rRecordException + FullyQualifiedErrorId : UnexpectedToken vCenter 4.1, vSphere 4.0 Any suggestions would be greatly appreciated.

  3. I suggest one adjustment. This is not inclusive of virtual compatability mode RDMs. Changing:
    if($dev.Backing.CompatibilityMode -eq “physicalMode”){
    to
    if(($dev.Backing.CompatibilityMode -eq “physicalMode”) -or ($dev.Backing.CompatibilityMode -eq “virtualMode”)){

    will fill that gap

Leave a Reply