Datastore Capacity – Which one should i deploy to?

With a lot of VMs using Thin Provisioning ive been working with service desk users to find a quick way of them figuring out which Datastore they should deploy VMs to while ensuring they dont over-allocate. I know over-allocation is a big perk of thin provisioning but regardless were working towards ensuring that we dont provision more than the available capacity.
Ive come up with the following which uses my usual variables:

$global:DCChoice – DC Choice
$Global:CLUChoice – Cluster Choice

Function WhichDatastoreShouldIUse
$DiskSize = Read-Host " Please Enter total disk size"
$RAMSize = Read-Host " Please Enter total RAM size"
$VMSize = [int]$DiskSize + [int]$RAMSizeGet-Datacenter $global:DCChoice | Get-Cluster $Global:CLUChoice |
Get-Datastore | Select Datacenter, Name, Type, CapacityGB,
@{N='ProvisionedGB';E={[math]::Round(($_.ExtensionData.Summary.Capacity - $_.ExtensionData.Summary.FreeSpace + $_.ExtensionData.Summary.Uncommitted)/1GB)}},
@{N='OverProvisioned';E={If ((($_.ExtensionData.Summary.Capacity - $_.ExtensionData.Summary.FreeSpace + $_.ExtensionData.Summary.Uncommitted)/1GB) -gt $_.CapacityGB) {"OverProvisioned"} Else {"Capacity Available"} }}, state |
Sort OverProvisioned | Where {([int]$_.ProvisionedGB + [Int]$VMSize) -lt [Int]$_.CapacityGB -and $ -notlike "
-Local"} | ft
Write-Host -NoNewLine 'Press any key to continue…';
$null = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown');

 775 total views,  1 views today

Leave a Reply

Your email address will not be published. Required fields are marked *