UNSOLVED

carminenatale

updated

14 years ago

0

148229

October 4th, 2012 16:00

virtual machine raw device mappings

Is there anyway to create a report that gives just the virtual machines that have a disk or disks with raw device mappings?

I found a powershell script that does it and now want to create a report too.

Thanks.

  • john_s_main

    132 Posts

    859

    0

    Posted October 5th, 2012 09:00

    Can you post the piece of the script which actually collects the data from the VIX interface?

  • 859

    0

    Posted October 5th, 2012 14:00

    $report = @()

    $vms = Get-VM | Get-View

    foreach($vm in $vms){

      foreach($dev in $vm.Config.Hardware.Device){

        if(($dev.gettype()).Name -eq "VirtualDisk"){

           if($dev.Backing.CompatibilityMode -eq "physicalMode"){

             $row = "" | select VMName, HDDeviceName, HDFileName

              $row.VMName = $vm.Name

             $row.HDDeviceName = $dev.Backing.DeviceName

             $row.HDFileName = $dev.Backing.FileName

             $report += $row

           }

         }

      }

    }

    $report

    Thanks.

  • 859

    0

    Posted October 6th, 2012 16:00

    We already capture quite a bit of data about RDMs in the product.  vFogligth Storage can show you them graphically in a nice toplogy layout, but if you just want a table of given VM with the phsysical disks that are not part of a datastore that can be done. I'll try to find some time to create a same view for you.

  • 859

    0

    Posted October 6th, 2012 17:00

    thanks. we don't have vfoglight storage, just vfoglight.

    is there any documentation on how to do it?

    i opened a ticket but they have not gotten back to me.

  • 859

    0

    Posted October 6th, 2012 18:00

    I'll have to figure out the exact query to get it, but the basic gist of it is to get a list of VMs where any of it's disks are not a datastore.  In our world if we see a physical disk attached to a VM and it's not a datastore, it's a RDM. I just have to figure out exactly how to do it.