Last active
October 27, 2021 12:29
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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