Skip to content

PowerCLI Script to Calculate VSAN VSPP Points

VMware includes Virtual SAN in their VSPP program. Unfortunately their vCloud Usage Meter, the tool that helps to create a license report, does not support Virtual SAN by now. I wrote a little PowerCLI script to gather the required information.

vsan-vspp-script

Taken from the latest VSPP Product Usage Guide, Virtual SAN is licenced based on the allocated capacity.

"0.08 points per GB per month for allocated capacity"

The allocated capacity is defined as the storage capacity configured to a virtual machine disk (VMDK). At creation, a virtual machine is assigned one or more VMDKs; the total allocated capacity to the virtual machine is equal to the sum of the allocated capacity to each VMDK.

The allocated capacity is the capacity configured to a virtual machine during provisioning, irrespective of:

  • the actual storage consumption (e.g. thin provisioning).
  • the capacity consumed by VM copies created by Virtual SAN for availability purposes.
  • the total raw storage capacity of the Virtual SAN datastore.

It is therefore my understanding that you have to add up the capacity of all virtual disks to get the required point value you have to report.

PowerShell snippet to calculate VSAN Points:

$datastore = Get-Datastore vsanDatastore

$VSPPcapacity = Get-Datastore $datastore | Get-HardDisk | Measure-Object -Property CapacityGB -Sum
Write-Host Allocated Capacity: $VSPPcapacity.Sum "GB"
Write-Host "VSPP Points per month: " ($VSPPcapacity.Sum * 0.08)

You can also run the script unattended by adding a vCenter connection to the script:

$VC = ""
$VCuser = ""
$VCpassword = ""

if (!(get-pssnapin -name VMware.VimAutomation.Core -erroraction silentlycontinue)) {
  add-pssnapin VMware.VimAutomation.Core
}
Connect-VIServer -Server $VC -user $VCuser -password $VCpassword

$datastore = Get-Datastore vsanDatastore

$VSPPcapacity = Get-Datastore $datastore | Get-HardDisk | Measure-Object -Property CapacityGB -Sum
Write-Host Allocated Capacity: $VSPPcapacity.Sum "GB"
Write-Host "VSPP Points per month: " ($VSPPcapacity.Sum * 0.08)

Disconnect-VIServer $VC -Confirm:$False

 

1 thought on “PowerCLI Script to Calculate VSAN VSPP Points”

  1. Pingback: PowerCLI Script to Calculate VSAN vCAN Points Per Month - VIRTUALIZATION IS LIFE!

Leave a Reply

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