12 Replies Latest reply on Jan 20, 2010 3:26 AM by GeorgeYacubovich

    Get RDM size

    gboskin Hot Shot

       

      Hi all and a happy new year to evryone..

       

       

      The Following script gives a good list of all the RDM ..

       

       

       

       

       

      $report1 = @()

       

       

      $vms = Get-VM |Sort Name -Descending | 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") -or *

       

       

      ($dev.Backing.CompatibilityMode -eq "virtualMode")){

       

       

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

       

       

      $row.VMName = $vm.Name

       

       

      $row.HDDeviceName = $dev.Backing.DeviceName

       

       

      $row.HDFileName = $dev.Backing.FileName

       

       

      $row.HDMode = $dev.Backing.CompatibilityMode

       

       

      +$report1 = $row

       

       

      }

       

       

      }

       

       

      }

       

       

      }

       

       

      $report1 | ConvertTo-Html -title "Virtual Machine information" -body "<H2>RDM information.</H2>" -head "<link rel='stylesheet' href='style.css' type='text/css' />" | Out-File -Append $filelocation

       

       

       

       

       

      is there a way i can get the actual size (capacity) of the RDms..????