Aujourd’hui un petit script Powercli tout simple qui vous permettra de connaître l’utilisation de vos partitions dans chacune de vos VMs. Ce script est très pratique pour faire un rapide constat de l’utilisation de l’espace. (Si bien sûr vous avez les VMware tools d’installés).
Il suffit donc de copier cette ligne de commande.
$Cluster = « Nom du cluster »
$AuditVM =ForEach ($VM in (Get-Cluster $Cluster|Get-VM|Get-View)){($VM.Guest.Disk |Select @{N=“Name“;E={$VM.Name}},DiskPath, @{N=“Capacity(MB)“;E={[math]::Round($_.Capacity/ 1MB)}}, @{N=“FreeSpace(MB)“;E={[math]::Round($_.FreeSpace / 1MB)}}, @{N=“FreeSpace(%)“;E={[math]::Round(((100 * ($_.FreeSpace))/ ($_.Capacity)),0)}}, @{N=“UsedSpace“;E={[math]::Round((($_.Capacity – $_.FreeSpace) /1MB),0)}}
) | Format-Table -AutoSize}
$AuditVM | out-file d:\auditvm$cluster.csv
Voici un exemple de sortie :