VMware Cloud Community
johnjohnjjj
Contributor
Contributor
Jump to solution

What are the differences between "PowerState" and "Guest.State" when I run the Get-VM powercli command

I run the following powercli script:-

Get-VM |Export-Csv -Path c:\test.csv -NoTypeInformation -UseCulture

And from there I found 2 properties that describe the VM status:-

1. PowerState which can be either ;PoweredOn OR PoweredOff

2. Guest.State which can be either ; running or not running

So can anyone advice about the differences between these two properties ? . Could I have for example a vm with PowerState = PowerOn , while its Guest.State = not running ?

0 Kudos
1 Solution

Accepted Solutions
ccalvetTCC
Enthusiast
Enthusiast
Jump to solution

PowerState if the state of the virtual machine itself.

vSphere 6.0 Documentation Center

PoweredOff

PoweredOn

Suspeneded

Everything related to .guest is obtained through VMware tools and will provide information from the OS itself.

(VMware tools must be installed and running properly in the OS to get anything from this property)

vSphere 6.0 Documentation Center

NotRunning

Resetting

Running

ShuttingDown

Standby

Unknown

Could I have for example a vm with PowerState = PowerOn , while its Guest.State = not running ?

Yes.

For example, if a VM is started and VMware tools have never been installed on it, it will report exactly that.

From the vSphere Client you will get in the Summary>General>VMware Tools

Not running (Not installed)



You will get even more information by using the API via PowerCLI.

.extensiondata.runtime.PowerState #poweredON

.extensiondata.guest.GuestState #notRunning

.extensiondata.guest.ToolsStatus #toolsNotInstalled



Blog: http://thecrazyconsultant.com/ | Twitter: @ccalvetTCC

View solution in original post

0 Kudos
1 Reply
ccalvetTCC
Enthusiast
Enthusiast
Jump to solution

PowerState if the state of the virtual machine itself.

vSphere 6.0 Documentation Center

PoweredOff

PoweredOn

Suspeneded

Everything related to .guest is obtained through VMware tools and will provide information from the OS itself.

(VMware tools must be installed and running properly in the OS to get anything from this property)

vSphere 6.0 Documentation Center

NotRunning

Resetting

Running

ShuttingDown

Standby

Unknown

Could I have for example a vm with PowerState = PowerOn , while its Guest.State = not running ?

Yes.

For example, if a VM is started and VMware tools have never been installed on it, it will report exactly that.

From the vSphere Client you will get in the Summary>General>VMware Tools

Not running (Not installed)



You will get even more information by using the API via PowerCLI.

.extensiondata.runtime.PowerState #poweredON

.extensiondata.guest.GuestState #notRunning

.extensiondata.guest.ToolsStatus #toolsNotInstalled



Blog: http://thecrazyconsultant.com/ | Twitter: @ccalvetTCC
0 Kudos