Ok, been looking for this one, but need some help... If a VM is powered off, or does not have the VMware tools installed you can not get the OS Family or OS Full Name? That can just not be right... it is in the VMX file, in the VI Client GUI, so PowerCLI must be able to get it some how, right? Someone has to have tackled this one! Right?
Partially right.
The OS that you see in the VIC or in the VMX is what the creator of the guest defined during the creation.
It corresponds with the -GuestId parameter on the New-VM cmdlet.
See for some more info on this GuestId.
The problem is that the creator of the guest can define whatever he wants in here, it doesn't have to correspond with the actual installed OS on the guest !
You can get that entry like this
(Get-VM <VM-name> | Get-View).summary.config.guestFullName
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Partially right.
The OS that you see in the VIC or in the VMX is what the creator of the guest defined during the creation.
It corresponds with the -GuestId parameter on the New-VM cmdlet.
See for some more info on this GuestId.
The problem is that the creator of the guest can define whatever he wants in here, it doesn't have to correspond with the actual installed OS on the guest !
You can get that entry like this
(Get-VM <VM-name> | Get-View).summary.config.guestFullName
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Nuts, I must have looked right past the 'summary' sub-object structure when I was walking through the objects! Thanks LucD.
Hi,
Sorry to bring up this old thread, but I'm looking to not only obtain the Guest Full Name, but also the Guest OS family.
With this I mean that I would like to get whether it is a Windows, Unix or Linux machine.
How can this be retrieved?
Thanks!
Filip
Do you have VMware Tools installed ?
Then you could do
Get-VM | Select Name,
@{N="OS Full";E={$_.ExtensionData.Guest.guestFullName}},
@{N="OS Family";E={{$_.ExtensionData.Guest.guestFamily}}
If you don't have the VMware Tools, the guest family will be difficult to retrieve.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Hello Luc,
Thanks for your reply, does this the trick!
However, I have 8 templates, all of them have VMWare Tools installed.
Some of them have this field populated, others don't.
Do you have any idea how this can be populated?
I guess that these templates were VMs before ?
And that these VMs must have been running with VMware Tools active, and that the properties got populated that way.
If you can't switch these templates back to VMs and let them run for some time, you could clone a VM from the templates, and obtain the values from these cloned VMs. But I admit that this is a rather cumbersome procedure
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Luc,
Thanks for the tip.
I've converted them to a VM and have booted them.
I'll check the property tomorrow morning en will let you know whether it has been populated or not.
Regards,
Filip
Hi Luc,
I converted them back to a template this morning.
For 2, the field didn't get populated (Windows 2008 & Windows 7).
The other 2 did populate the field (Windows server 2012 & Windows 😎 .
What could be causing this? Do you have any ideas?
VMWare tools are current and were running.
To be honest I have no clue what could be causing this.
Did you try a restart of the VMware Tools service inside the guest OS ?
Does that make any difference ?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference