Skip to content

Instantly share code, notes, and snippets.

virtualistic / convert_vcenter_readytime_ms_to_perct.ps1
Last active October 27, 2021 12:29
Simple script to convert the VMWare vCenter realtime readytime of a VM in milliseconds to percentage
# Script to convert vcenter realtime readytime in milliseconds to readytime in percentage
$readytime_ms = read-host " Enter the amount of readytime in ms "
$vcpu = read-host " Enter the amount of vCpus configured in the VM "
$readytime_per_vcpu = ($readytime_ms / $vcpu) # get the readytime value per vcpu
Write-Host ""
$total_readytime = ($readytime_per_vcpu/(20*1000)) * 100 # the vcenter realtime chart refreshes every 20 seconds (20000 ms)
Write-Host " The VM has a readytime of $total_readytime% per vCPU"