Last active
December 2, 2016 17:24
-
-
Save jeffgreenca/b384a238e5c453f50d7b to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#vmotion-validation-test.ps1 | |
#vMotion a VM over all hosts in a cluster, twice. | |
$cluster = Read-Host "Cluster Name" | |
$vm = Read-Host "Test VM Name" | |
function validate-vmotion($cluster, $vm) { | |
$totalms = 0 | |
$count = 0 | |
get-cluster $cluster | get-vmhost | foreach { | |
$duration = Measure-Command { | |
move-vm -Destination $_ -VM $vm -Confirm:$false | |
} | |
echo "vMotion Completed in $($duration.TotalSeconds)s" | |
$totalms = $totalms + $duration.TotalMilliseconds | |
$count = $count + 1 | |
} | |
echo "Total Time (ms): $totalms" | |
echo ("Average Time (ms): " + ($totalms / $count)) | |
} | |
validate-vmotion -cluster $cluster -vm $vm | |
validate-vmotion -cluster $cluster -vm $vm |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment