VMware Cloud Community
TronAr
Commander
Commander

get-vmhost reports connected andpoweredoff ?

Hi,

just starting to babystep in powercli and striked me as odd that a host be reported as connected and poweredoff.

PowerCLI F:\> get-vmhost

WARNING: 3 columns do not fit into the display and were removed.

Name           ConnectionState PowerState NumCpu CpuUsageMhz CpuTotalMhz

----           --------------- ---------- ------ ----------- -----------

esxi3          NotResponding   Unknown         2           0        6820

esxi2          Connected       PoweredOn       2         172        6820

esxi1          Connected       PoweredOff      2           0        6820

How can that be ? This is VS5.5, power cli connected to a vcenter inside the poweredoff host Smiley Happy

Hosts nested inside workstation, should that matter.

TIA,

-Carlos

0 Kudos
4 Replies
LucD
Leadership
Leadership

That is indeed odd, the Connected state is shown when the vCenter receives heartbeats from the ESXi server, which would be difficult with a powered off ESXi server.

The only explanation I could see is that your are connected to the ESXi server itself, instead of the vCenter.

When using an ESXi server connection, the state is always connected (of course).

WHat is in $global:defaultviservers ?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
TronAr
Commander
Commander

Nothing there other than the vcenter.

I have a theory now... this is a lab environment and I have a lonely vm running in a cluster.

I would propose that PoweredOff is derived from the fact that 0 MHz are being used.

I've just started the lab again, and now is the other host that has 0 MHz and its state

shows as PoweredOff. This is kind of risky though. It seems not to be a good idea to

depend on the PowerState host status to make decisions...

(I thought that vcenter was running on esxi1, but ...)

PowerCLI F:\> Connect-VIServer -Server 172.30.0.55 -User root -Password hunter2

Name                           Port  User

----                           ----  ----

172.30.0.55                    443   root

PowerCLI F:\> echo $defaultviservers

Name                           Port  User

----                           ----  ----

172.30.0.55                    443   root

PowerCLI F:\> Get-VMHost

WARNING: 3 columns do not fit into the display and were removed.

Name           ConnectionState PowerState NumCpu CpuUsageMhz CpuTotalMhz

----           --------------- ---------- ------ ----------- -----------

esxi3          NotResponding   Unknown         2           0        6820

esxi2          Connected       PoweredOff      2           0        6820

esxi1          Connected       PoweredOn       2        4212        6820

0 Kudos
LucD
Leadership
Leadership

I don't think it is related to the CPU usage.

I think that the ConnectionState reflects the fact if the ESXi was added to the vCenter, and the vCenter installed the vpxa agent on the ESXi server.

And independent if the ESXi is powered on or not, it is that connection that determines what is shown in the ConnectionState property.

This is also reflected in the State parameter on the Set-VMHost cmdlet.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
TronAr
Commander
Commander

Nope, because esxi3 is also registered and shows as not responding... so connected seems esxi is talking to vcenter.

In any case, the thing is with power state...

0 Kudos