I'm attempting to gather details on VM guest OS and provide an easy way to sort Windows and Linux guests, so I want to gather the OS Full and OS Family into separate columns on a spreadsheet. I think I've run into an interesting bug here...
Starting with just a basic PowerCLI command to get the data on a folder of VMs I use for VMmark3. All happen to be CentOS VMs cloned from the same template file - configured (and verified) OS Class: Linux and OS Type CentOS 4/5/6/7 (64-bit) in the web client.
Get-VM -location Tile0 | Select Name,@{N="OS Full";E={$_.ExtensionData.Guest.guestFullName}},@{N="OS Family";E={$_.ExtensionData.Guest.guestFamily}}
Here's the output I get:
Name OS Full OS Family
---- ------- ---------
DS3DB0 CentOS 4/5/6/7 (64-bit) linuxGuest
AuctionMSQ0
AuctionAppA0
ElasticLB0 Red Hat Enterprise Linux 7 (64-bit) linuxGuest
AuctionNoSQL0 Red Hat Enterprise Linux 7 (64-bit) linuxGuest
DS3WebA0 CentOS 4/5/6/7 (64-bit) linuxGuest
AuctionAppB0
DS3WebB0 CentOS 4/5/6/7 (64-bit) linuxGuest
ElasticWebA0 Red Hat Enterprise Linux 7 (64-bit) linuxGuest
AuctionWebB0 Red Hat Enterprise Linux 7 (64-bit) linuxGuest
ElasticAppA0 Red Hat Enterprise Linux 7 (64-bit) linuxGuest
AuctionDB0 Red Hat Enterprise Linux 7 (64-bit) linuxGuest
DS3WebC0
ElasticWebB0 Red Hat Enterprise Linux 7 (64-bit) linuxGuest
Standby0 CentOS 4/5/6/7 (64-bit) linuxGuest
AuctionLB0 Red Hat Enterprise Linux 7 (64-bit) linuxGuest
AuctionWebA0 Red Hat Enterprise Linux 7 (64-bit) linuxGuest
ElasticDB0 Red Hat Enterprise Linux 7 (64-bit) linuxGuest
ElasticAppB0 Red Hat Enterprise Linux 7 (64-bit) linuxGuest
This is leaving me with large gaps of cells I need to fill in by hand and it doesn't really make sense as to why they would be empty. Let's pick on AuctionMSQ0 as it happens to be the top of the list of offenders.
get-vmguest AuctionMSQ0 | FL
results in:
OSFullName :
IPAddress : {}
State : Running
Disks :
HostName :
Nics :
ScreenDimensions : {Width=800, Height=600}
VmId : VirtualMachine-vm-265
VM : AuctionMSQ0
VmUid : /VIServer=vsphere.local\administrator@[redacted]:443/VirtualMachine=VirtualMachine-vm-265/
VmName : AuctionMSQ0
Uid : /VIServer=vsphere.local\administrator@[redacted]:443/VirtualMachine=VirtualMachine-vm-265/VMGuest=/
GuestId :
ConfiguredGuestId : centos64Guest
RuntimeGuestId :
ToolsVersion :
ExtensionData : VMware.Vim.GuestInfo
GuestFamily :
I've attached a snap of the VM settings to prove it's set correctly as far as I can see.
Any ideas?
Ok, after a few minutes, the VM has updated... now it's reporting that it's running RHEL 7, when it's clearly not.
OSFullName : Red Hat Enterprise Linux 7 (64-bit)
IPAddress : {10.X.X.X}
State : Running
Disks : {Capacity:14879293440, FreeSpace:6818304000, Path:/, Capacity:520794112, FreeSpace:155787264, Path:/boot,
Capacity:14879293440, FreeSpace:6818304000, Path:/tmp, Capacity:14879293440, FreeSpace:6818304000,
Path:/var/tmp}
HostName : AuctionMSQ0
Nics : {Network adapter 1:Dev_portgroup}
ScreenDimensions : {Width=800, Height=600}
VmId : VirtualMachine-vm-265
VM : AuctionMSQ0
VmUid : /VIServer=vsphere.local\administrator@[Redacted]:443/VirtualMachine=VirtualMachine-vm-265/
VmName : AuctionMSQ0
Uid : /VIServer=vsphere.local\administrator@[Redacted]:443/VirtualMachine=VirtualMachine-vm-265/VMGuest=/
GuestId : rhel7_64Guest
ConfiguredGuestId : centos64Guest
RuntimeGuestId : rhel7_64Guest
ToolsVersion :
ExtensionData : VMware.Vim.GuestInfo
GuestFamily : linuxGuest
Reconfiguring for the config only and not relying on the Guest OS or Tools to report seems to help. This isn't ideal as it only reports what the VM is configured for - not what it's actually running. It's a workaround for now...
Get-VM -location Tile0 | Select Name,@{N="Config Full";E={$_.ExtensionData.config.guestFullName}},@{N="Config GuestID";E={$_.ExtensionData.config.guestID}}
Name Config Full Config GuestID
---- ----------- --------------
DS3DB0 CentOS 4/5/6/7 (64-bit) centos64Guest
AuctionMSQ0 CentOS 4/5/6/7 (64-bit) centos64Guest
AuctionAppA0 CentOS 4/5/6/7 (64-bit) centos64Guest
ElasticLB0 CentOS 4/5/6/7 (64-bit) centos64Guest
AuctionNoSQL0 CentOS 4/5/6/7 (64-bit) centos64Guest
DS3WebA0 CentOS 4/5/6/7 (64-bit) centos64Guest
AuctionAppB0 CentOS 4/5/6/7 (64-bit) centos64Guest
DS3WebB0 CentOS 4/5/6/7 (64-bit) centos64Guest
ElasticWebA0 CentOS 4/5/6/7 (64-bit) centos64Guest
AuctionWebB0 CentOS 4/5/6/7 (64-bit) centos64Guest
ElasticAppA0 CentOS 4/5/6/7 (64-bit) centos64Guest
AuctionDB0 CentOS 4/5/6/7 (64-bit) centos64Guest
DS3WebC0 CentOS 4/5/6/7 (64-bit) centos64Guest
ElasticWebB0 CentOS 4/5/6/7 (64-bit) centos64Guest
Standby0 CentOS 4/5/6/7 (64-bit) centos64Guest
AuctionLB0 CentOS 4/5/6/7 (64-bit) centos64Guest
AuctionWebA0 CentOS 4/5/6/7 (64-bit) centos64Guest
ElasticDB0 CentOS 4/5/6/7 (64-bit) centos64Guest
ElasticAppB0 CentOS 4/5/6/7 (64-bit) centos64Guest
The configured OS has no value whatsoever for reporting purposes, you can put whatever in there, and still install another guest OS.
Which vSphere version are you working with?
Are these VMs using the VMware Tools that come with ESXi or are they using the guest provided VMware Tools or the open-vm-tools?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference