Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 230613

Re: VM Disk details convert to html

$
0
0

This will add the vendor and model of the backing lun.

 

Connect-VIServer -Server $vc -ErrorAction SilentlyContinue  
Get-VM | ForEach-Object {     $vm = $_     $VM | get-harddisk | ForEach-Object {         $HddDS = $_ | get-datastore        $Lun   = Get-ScsiLun -VmHost (get-vmhost $vm.vmhost) -CanonicalName ($HddDS.ExtensionData.Info.Vmfs.Extent[0].DiskName)        [pscustomobject]@{             VMname         = $vm.name             Host           = $VM.vmhost             Cluster        = ($vm | Get-Cluster).Name             DiskName       = $_.name             DiskType       = $_.disktype             DiskCapacityGB = $_.CapacityGB             FileName       = $_.FileName             Datastore      = $HddDS.name             NAA            = $HddDS.ExtensionData.Info.Vmfs.Extent[0].DiskName             Vendor         = $Lun.Vendor            Model          = $Lun.Model            DSCapacityGB   = [math]::Round($HddDS.CapacityGB,1)             DSFreeSpaceGB  = [math]::Round($HddDS.FreeSpaceGB,1)             DSPercentFree  = [math]::Round(($_.FreeSpaceGB)/($_.CapacityGB)*100,2)         }     } 
} | ConvertTo-Html | Out-File C:\Report.html 

Viewing all articles
Browse latest Browse all 230613

Trending Articles



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