Quantcast
Channel: VMware Communities : All Content - All Communities
Viewing all articles
Browse latest Browse all 180329

PowerCLI Script for VM Disk over 250GB

$
0
0

So you may be mid-planning for your upgrade to 5.x but still adding to your current environment. As you add datastores the question of block size comes up. Here is a script to list any VMs with a disk greater than 250GB (yes, 256 is the magic number but lets be honest...who really makes a 256GB disk). If you don't have any VMs greater than 250, stick with the 1MB so conversion to VMFS5 is just a little easier.

 

 

$data = @()

 

 

$vc ="YOUR VC"

 

 

Connect-VIServer $vc

 

 

$vms =Get-VM

 

 

 

foreach($vmin$vms)

 

 

{

 

 

     $disks=$vm | Get-HardDisk | where {$_.CapacityKB -gt 262144000}

 

     if($disks-ne$null)

     {

 

          foreach($din$disks)

          {

           $myItem="" | SelectVM , Disk , Size

           $myItem.VM=$vm.Name

           $myItem.Disk=$d.ExtensionData.DeviceInfo.Label

           $myItem.Size= [math]::round(($d.CapacityKB/ 1048576),2)

           $data+=$myItem

          }

     }

}

 

Disconnect-VIServer -Server*-Confirm:$false

 

$data

 

 


Viewing all articles
Browse latest Browse all 180329

Trending Articles



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