VMware Cloud Community
MCioe
Enthusiast
Enthusiast
Jump to solution

Is there a way to ask an ESXi host if it is being managed by a vCenter server?

I am working on a script intended to be executed on ESXi servers that do NOT have a vCenter.

I am currently using ESXi 6.0 with a plan to migrate to ESXi 6.5.

Is there a command that I can use to ask the ESXi server if it is being managed by a vCenter?

Tags (1)
1 Solution

Accepted Solutions
MCioe
Enthusiast
Enthusiast
Jump to solution

The first thing the script in the Virtually Ghetto link  is connect to vCenter which kind of defeats the purpose.

However, the following does work.

    connect-VIServer $ipAddressOfESXi

   $hostView = get-vmhost | get-view

   if ($hostview.ManagementServerIP -eq $null) { write-host "No vCenter associated with server" }

View solution in original post

2 Replies
SupreetK
Commander
Commander
Jump to solution

Please check if this https://www.virtuallyghetto.com/2016/07/remotely-query-an-esxi-host-without-adding-it-to-vcenter-ser...​ is helpful. If not, you can remotely SSH into the host and grep for the parameter 'serverIp' in the file </etc/vmware/vpxa/vpxa.cfg>. This will be the IP of the vCenter that is managing this host.

Please consider marking this answer as "correct" or "helpful" if you think your questions have been answered.

Cheers,

Supreet

Reply
0 Kudos
MCioe
Enthusiast
Enthusiast
Jump to solution

The first thing the script in the Virtually Ghetto link  is connect to vCenter which kind of defeats the purpose.

However, the following does work.

    connect-VIServer $ipAddressOfESXi

   $hostView = get-vmhost | get-view

   if ($hostview.ManagementServerIP -eq $null) { write-host "No vCenter associated with server" }