Skip to content

Instantly share code, notes, and snippets.

@virtualistic
Last active October 27, 2021 12:29
Show Gist options
  • Save virtualistic/bc9118e3d142718fb5e48f3cf9c4f3aa to your computer and use it in GitHub Desktop.
Save virtualistic/bc9118e3d142718fb5e48f3cf9c4f3aa to your computer and use it in GitHub Desktop.
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
Clear-Host
$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