Hello all,
I'd like to add in my script a check for vCenter availability after a reboot.
The script is like :
Connect to vCenter
Do things on vCenter
Reboot vCenter
Wait vCenter is back online <= the part I'm looking for
Reconnect to vCenter
Do things on vCenter
Does someone have a method for this
Thanks in advance !
I would use a Test-Connection as a first check (provided ICMP packets are allowed on your network).
Once the VCSA replies, you can test the Connect-VIServer in a loop.
Make sure to ignore the terminating exception, check the $global:defaultVIServer variable to verify the connection was made.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I would use a Test-Connection as a first check (provided ICMP packets are allowed on your network).
Once the VCSA replies, you can test the Connect-VIServer in a loop.
Make sure to ignore the terminating exception, check the $global:defaultVIServer variable to verify the connection was made.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thank you Luc !
I missed the first idea Test-Connection