Question for class.
I have a workflow where i reboot a host and i do a pretty simple check to see if the reboot is done and i was curious if anyone had any better way of doing it.
The workflow looks like this:
The "Wait for host" step looks like this:
Server.log(currenthost.runtime.connectionState.value);
// Wait for 5 minutes to make sure that the host has disconnected from vCenter due to the reboot.
System.sleep(5 * 60 * 1000);
while( currenthost.runtime.connectionState.value != "connected" )
{
// Wait a second before checking again
System.sleep(1 * 60 * 1000);
}
It works, but it just feels like a ugly hack to wait for 5 minutes, what if something is whack and it takes longer than 5 minutes for it to drop out of vCenter?
Thanks,
Magnus
Check out my orchestration blog here: http://ullberg.us/orchestrate/