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

List independent vdisks using powershell/powercli in ESXi

$
0
0

Hello,

in order to list the vdisks of type independent, you can use this powercli code:

 

$allvms = Get-VM | where-object {($_.powerstate -ne "PoweredOff")}

foreach ($vm in $allvms | Get-View){

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

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

      if($dev.Backing.DiskMode -eq "independent_persistent") {

        $vm.Name + "`t" + $dev.Backing.FileName

        $vm.Name + "`t" + $dev.Backing.DiskMode

   

            }   

        }

     }

}

 

(As usual, remember to use the Connect-VIServer cmdlet before!)

 

 

 

 

Best regards,

Pablo


Viewing all articles
Browse latest Browse all 3135

Trending Articles



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