Quantcast
Channel: VMware Communities : Blog List - All Communities
Viewing all articles
Browse latest Browse all 3135

Report VM's RDMs via PowerCLI

$
0
0

If you want get the RDMs defined in your vmware environment using PowerCLI, then you can just use this:

 

 

$allvms = Get-VM

 

foreach ($vm in $allvms) {

  

    $vmrdm = Get-HardDisk -VM $vm -DiskType "RawPhysical","RawVirtual"

  

    foreach ($rdm in $vmrdm) {

  

        if ($rdm.Name) {

        $row = "" | select Parent,Name,DiskType,ScsiCanonicalName,DeviceName,FileName,CapacityGB

      

        $row.Parent = $rdm.Parent

        $row.Name = $rdm.Name

        $row.DiskType = $rdm.DiskType

        $row.ScsiCanonicalName = $rdm.ScsiCanonicalName

        $row.DeviceName = $rdm.DeviceName

        $row.FileName = $rdm.FileName

        $row.CapacityGB = ($rdm.CapacityKB/1024)/1024

      

      

      

        $report += $row } # End if ($rdm.Name)

 

                  

} # End foreach ($rdm in $vmrdm)

 

 

} # End foreach ($vm in $allvms)

 

 

 

$report

 

 

 

 

 

(Remember to use the Connect-VIServer cmdlet before!)

 

 

Best regards,

Pablo

 

P.D: Got from this vmware's KB


Viewing all articles
Browse latest Browse all 3135

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>