VMware Cloud Community
frDrakkarDrf
Contributor
Contributor
Jump to solution

Check if vCenter is UP

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 !

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

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

View solution in original post

0 Kudos
2 Replies
LucD
Leadership
Leadership
Jump to solution

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

0 Kudos
frDrakkarDrf
Contributor
Contributor
Jump to solution

Thank you Luc !

I missed the first idea Test-Connection

0 Kudos