VMware Cloud Community
MCioe
Enthusiast
Enthusiast
Jump to solution

How can I tell if a host is associated with a vCenter server

Once my ESXi 5.0 host is managed by/assoicated with a vCenter server, there are certain commands that you can only perform through the vCenter.

     In particular, set-harddisk size, set-SCSIController and Set-VMReservations.

In the case where my vCenter is down, I would like to exit my (PowerCLI 5.5r1) script with an error that these operations can't be run until vCenter is started up or the host containing the VM is disassociated with vCenter.  I think it will be safer to let the user decide how he wants to proceed in this case and not build it into my script.

Is there a cmdlet to ask the host if it is associated with a vCenter server?  When you use VI Client to connect to the host, you can see the link in the lower right hand side of the Summary tab that says "Disassociate host from vCenter Server...". 

The get-VMHost cmdlet seems like it should have this info, but I haven't been able to find it.

Thanks for any suggestions

Maureen

0 Kudos
1 Solution

Accepted Solutions
a_p_
Leadership
Leadership
Jump to solution

Please take a look at Determine vCenter managing host to see whether this helps.


André

View solution in original post

0 Kudos
2 Replies
a_p_
Leadership
Leadership
Jump to solution

Please take a look at Determine vCenter managing host to see whether this helps.


André

0 Kudos
MCioe
Enthusiast
Enthusiast
Jump to solution


Yikes, that is a very convoluted solution.  Is there some readable documentation that describes the get-view and it's subtypes?  The cmdlet reference page is lacking.

Thanks again for the help

0 Kudos