VMware Cloud Community
sastre
Enthusiast
Enthusiast

Inconsistent Results for Guest OS with powered off VMs

Hi,

We have a number of VMs that remain powered off for various reasons, so reporting on the VM estate and installed operating systems is difficult, not helped by the number of ways in which you seem to be able to obtain the same / similar information:

$vm = Get-VM myvm

$vm.Guest                                 

$vm.Guest.GuestID                        

$vm.Guest.OSFullName                      

$vm.Guest.ExtensionData.GuestFullName     

$vm.ExtensionData.Guest.GuestFullName    

$vm.ExtensionData.Guest.GuestFamily       

$vm.ExtensionData.Guest.GuestID          

$vm.ExtensionData.Config.GuestFullName

$vm.ExtensionData.Config.GuestId

($vm | get-view).Summary.Config.GuestID

($vm | get-view).Summary.Config.GuestFullName

($vm | get-view).Config.GuestID

($vm | get-view).Config.GuestFullName

($vm | get-view).Guest.GuestID

($vm | get-view).Guest.GuestFullName

- as far as I can tell the lines:

$vm.ExtensionData.Config.GuestFullName

$vm.ExtensionData.Config.GuestId
pulls information from the VMX file, or more likely the database which does appear to store the content of the VMX file.

Using PowerCLI to run against two VMs, both of which are powered off, yields different results; one returns OS information and the other does not.

guestosstuff01.PNG

In the vSphere Client both are configured to use the same underlying OS:

guestosstuff02.PNG

and on the summary page for each VM they both report the same thing, but yet, only one of the VMs will return this information when queried via PowerCLI.

guestosstuff03.PNG

Does anyone know why this might be the case?

Thanks.

2 Replies
Grzesiekk
Expert
Expert

Hi there,

i think your screenshots do not reflect your observations:

In both examples you are trying to pull data from the vmware tools, and not from $_.extensiondata.Config.GuestFullName   

Greg

--- @blog https://grzegorzkulikowski.info
0 Kudos
LucD
Leadership
Leadership

You are comparing two different things.

The Guest property in the VirtualMachine object reflects what is discovered through the VMware Tools.

Note that if a VM is powered for a longer time, the values in these properties disappear.

The info you are seeing in the vSphere Client is what you specify when you create the VM.

This is stored in guestId property in the VirtualMachineConfigInfo object.

This is not checked in any way, you can specify for a VM that will be running a Linux OS, while you install a Windows OS  inside the VM later on.

You can't rely on this property to find out what OS is actually running.

In conclusion, the only way to find out what OS is inside a VM, is by powering the VM on, and checking through the VMware Tools.

Or eventually checking inside the guest OS through for example the Invoke-VMScript cmdlet.


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