Capacity and Efficiency per VM

This (probably poorly written) Powershell code will go grab all the VVols on a SolidFire system, group them by VM and then give you a read out of allocated and consumed capacity. It also reports on the overall efficiency of each VM.


#Connect to SolidFire system if no connection already exists
Connect-SFCluster -Username admin -Password solidfire | Out-Null

#Misc stuff
$separator = ".","_"

#Get a list of all the VVols and their stats
$VVols = Get-SFVirtualVolume -Details $true

#Group VVols by VM
#The VMW_VmID uniquely identifies the VVols associated with a VM
#Get list of unique VMW_VmID

foreach ($VmID in $VVols.metadata.VMW_VmID | Sort | Get-Unique) {

    #Get a unique VM object
    $VMObject = $VVols | select VirtualVolumeID,VolumeInfo,Metadata | where-object {$_.Metadata.VMW_VmID -match $VmID}
    $VMName = $VMObject.metadata.VMW_VVolName 
    $NumVVols = $VMObject.count
    $VMVVolStats = $VMObject.VolumeInfo.VirtualVolumeID | Get-SFVolumeStatsByVirtualVolume
    $VMVolEfficiencies = $VMObject.VolumeInfo.VolumeID | Get-SFVolumeEfficiency
    #Do some math for Agreegate capacity
    foreach ($VMVVolStat in $VMVVolStats) {
        $VMAllocatedCapactiy += $VMVVolStat.volumesize 
        $VMConsumedBlocks += $VMVVolStat.NonZeroBlocks
    #Create estimated efficiency per volume
    For ($i=0; $i -lt $VMVVolStats.Count; $i++) {

    #Catch if there is a 0 compression or deduplication number, if so set to 1
    If ($VMVolEfficiencies[$i].Deduplication -eq "0") { 
        $VMVolEfficiencies[$i].Deduplication = 1
    If ($VMVolEfficiencies[$i].Compression -eq "0") {
        $VMVolEfficiencies[$i].Compression = 1

    $VMVVolEfficiency = $VMVolEfficiencies[$i].Deduplication * $VMVolEfficiencies[$i].Compression
    $VMDiskEffectiveSize = (($VMVVolstats[$i].NonZeroBlocks * 4096) /1gb) / $VMVVolEfficiency
    $TotalVMEffective += [math]::Round($VMDiskEffectiveSize,2)                

    #Turn blocks into bytes (not quite as exciting as water to wine)
    $VMConsumedCapacity = [math]::Round($VMConsumedBlocks * 4096 /1gb,2)
    $VMEffectiveEfficiency = [math]::Round($VMConsumedCapacity / $TotalVMEffective,2)

    #Total Counters
    $AllVMConsumed += $VMConsumedCapacity
    $AllVMEffective += $TotalVMEffective
    $AllEfficiency = [math]::Round(($AllVMConsumed / $AllVMEffective),2)

    #Note, all the capacity values are in GiB, not GB
    Write-Host "`nVM Name: $($VMName.split($separator) | select -first 1)" -ForegroundColor DarkGray
    Write-Host "Number of VVols: $NumVVols" -ForegroundColor Green
    Write-Host "VM Allocated GiB: $($VMAllocatedCapactiy /1gb)" -ForegroundColor Green
    Write-Host "VM Consumed GiB: $VMConsumedCapacity" -ForegroundColor Green
    Write-Host "VM Effective GiB: $TotalVMEffective" -ForegroundColor Green
    Write-Host "VM Effective Efficiency: $VMEffectiveEfficiency" -ForegroundColor Green

    #Clear out counters
    $VMAllocatedCapactiy = 0
    $VMConsumedBlocks = 0
    $TotalVMEffective = 0
    $VMDiskEffectiveSize = 0
    $TotalVMEffective = 0
    $VMConsumedCapacity = 0
    $VMEffectiveEfficiency = 0
Write-Host "`nTotal Consumed GiB Used by VMs:"  $AllVMConsumed
Write-Host "Total Effective GiB Used by VMs:" $AllVMEffective
Write-Host "Total Effective Efficiency:" $AllEfficiency

I’ll just come right out and say that the efficiency number really isn’t all that useful by itself. The reason being that the GetVolumeEfficiency call looks at a volume in isolation. This means it only reports the efficiency within the individual volumes, not across volumes. Practically that means the reported number is a worst case scenario.

However, it is useful in the sense that it provides a pretty decent expected ratio among a set of VMs. In the example above, I can see that my vra-2012r2 template reduced 1.91x and my vra-sql2014 template reduced 1.62x – a difference of ~ 15%. Generally speaking that means I can expect to get roughly 15% better efficiency rates with the vra-2012r2 VMs vs the vra-SQL2014 VMs. That might be useful information to have.

To test if this holds in a deployment, I created two storage containers (vra-2012r2 and vra-SQL2014) and deployed 50 VMs to each from the respective VM templates.


This allows SolidFire to report the efficiency for all the VMs in those two storage containers independently so we can see how well we dedupe/compress across the VMs in the same storage container. Given the numbers reported per-VM earlier I would expect the vra-2012r2 storage container to get roughly 15% better numbers.


So we did, in fact, get better efficiency for the vra-2012r2 VMs and the difference in efficiency is ~20% which is in the ball park Smile After 24 hours the the difference was ~17%, almost exactly matching the original difference in the templates. So, not an exact science, but useful for general sizing estimates.

Leave a Reply

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