1 Reply Latest reply on Mar 6, 2013 4:57 AM by yezdi

    PowerCLI to find disk details of VM which doesn't have  RDM attached

    yezdi Master
    vExpert

      Hi All,

       

      Following code helps me to find out the details of RDMs attached to the VMs in a cluster.

       

       

      $cluster_name = "Cluster 4"
      get-cluster $cluster_name | Get-VM | Get-HardDisk -DiskType "RawPhysical","RawVirtual" |
      Select Parent,Name,@{N="CapacityMB";E={[int]($.CapacityKB/1024)}},@{N="CapacityGB";E={[int]($.CapacityKB/(1024*1024))}},DiskType,ScsiCanonicalName,DeviceName |
      Export-Csv NoTypeInformation  "Z:\output\RDM-list$cluster_name.csv"

       

      I need similar script to find out the hard disk details of a VM which doesnt have any RDMs attached. Can you please help?