Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
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"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment