WilliamLam.com

  • About
    • About
    • Privacy
  • VMware Cloud Foundation
  • VKS
  • Homelab
    • Resources
    • Nested Virtualization
  • VMware Nostalgia
  • Apple
You are here: Home / Automation / New detailed GuestOS data in vSphere 8.0 Update 2

New detailed GuestOS data in vSphere 8.0 Update 2

11.02.2023 by William Lam // 5 Comments

Your workloads are constantly changing both from an application standpoint but also the underlying guest operating system (GuestOS) including patches and upgrades. While many organizations have a change management database (CMDB), it can still be a challenge to true up that information from when the workload was first deployed to what it is currently running.

Back in 2019, VMware enhanced VMware Tools to make it easier to identify applications and processes that was running within a VM and this also provided a programmatic way for retrieving this inventory information which could then be fed back into their CMDB.

Applications are not the only things that change inside of a VM, the GuestOS probably receives the most updates (patches/upgrades) and being able to accurately inventory this information without relying on an in-guest agent is still a challenge for many.

In vSphere 8.0 Update 2, we have enhanced the available GuestOS data using VMware Tools and we have also made it easier to inventory and collect this information even when the VM has been powered off.

A new guestDetailedData vSphere API property has been introduced, which can contain the following 10 fields, which are populated by VMware Tools:

Field Description VMware Tools Version Required
architecture Arm or X86 11.2.0
bitness 32 or 64 11.2.0
buildNumber OS build number 11.2.0
cpeString NIST Common Platform Enumeration Specification standardized identifier string for the OS 11.2.0
distroAddlVersion Longer OS version string that may contain additional info (e.g. version name) 12.2.0
distroName OS distribution name 11.2.0
distroVersion OS version string 11.2.0
familyName OS family name (Windows; Linux; etc.) 11.2.0
kernelVersion Linux kernel version or Windows 10+ patch number or Windows build number 11.2.0
prettyName Officially specified distro "pretty name" 11.2.0

As you can see, you will need to have at least VMware Tools 11.2.0 or 12.2.0 to see all of these fields. The API property can be retrieved while the VM is powered on and depending on the GuestOS, all or a subset of these fields will be available. When a VM is powered off, VMware Tools is no longer running and the property would be empty or null as expected.

The developers wanted to make it easier for users to retrieve this information, especially if it has not changed from the last time it was collected and make this persistent so that you can quickly inventory your VMs even if it is powered off. As mentioned in the vSphere API documentation, the last known values are persisted and is available when the VM is powered off. This information is stored in the VM Advanced Setting called guestinfo.detailed.data and will contain the last known values when the VM was running.

To make it even easier for our users to consume this new vSphere API, I have created the following PowerCLI snippet which will retrieve only this property for all VMs and store that into custom object which you can then process further:

$vms = Get-View -ViewType VirtualMachine -Property Name,Config.extraConfig

$results = @()
foreach ($vm in $vms) {
    $detailedData = ($vm.Config.ExtraConfig | where {$_.key -eq 'guestInfo.detailed.data'}).Value
    # Split the pairs
    $keyValuePairs = $detailedData -split "(?<=') " -replace "'", ""

    # Clear variables
    $architecture = $bitness = $distroName = $buildNumber = $cpeString = $distroAddlVersion = $distroVersion = $familyName = $kernelVersion = $prettyName = $null

    # Loop through key-value pairs
    foreach ($pair in $keyValuePairs) {
        $key, $value = $pair -split '=', 2

        if ($key -eq "architecture") { $architecture = $value }
        elseif ($key -eq "bitness") { $bitness = $value }
        elseif ($key -eq "buildNumber") { $buildNumber = $value }
        elseif ($key -eq "cpeString") { $cpeString = $value }
        elseif ($key -eq "distroAddlVersion") { $distroAddlVersion = $value }
        elseif ($key -eq "distroName") { $distroName = $value }
        elseif ($key -eq "distroVersion") { $distroVersion = $value }
        elseif ($key -eq "familyName") { $familyName = $value }
        elseif ($key -eq "kernelVersion") { $kernelVersion = $value }
        elseif ($key -eq "prettyName") { $prettyName = $value }
    }

    $tmp = [pscustomobject] [ordered]@{
        Name = $vm.Name;
        Architecture = $architecture;
        Bitness = $bitness;
        BuildNumber = $buildNumber;
        CPEString = $cpeString;
        DistroName = $distroAddlVersion;
        DistroVersion = $distroName;
        DistroAddlVersion = $distroVersion;
        FamilyName = $familyName;
        KernelVersion = $kernelVersion;
        PrettyName = $prettyName;
    }
    $results+=$tmp
}

$results

Here is an example of what the output might look like:

More from my site

  • Quick Tip - Suppress in-guest VMware Tools update notifications
  • Quick Tip - Using PowerCLI to query VMware Tools Configuration at scale 
  • Is there a vSphere REST API for ...
  • ESXi on Lenovo ThinkStation P3 Ultra
  • Easily disable vSphere Cluster Services (vCLS) using UI/API in vSphere 8.0 Update 2

Categories // Automation, vSphere 8.0 Tags // vmware tools, vSphere 8.0 Update 2

Comments

  1. *protectedBill A says

    11/03/2023 at 3:01 am

    This is something we've been wrestling with for quite a while, a very welcome addition in the tool box! Thanks for documenting, and creating a code snippet.

    Reply
  2. *protectedRobert says

    11/03/2023 at 5:12 am

    Thanks for the great website William. I hope you are able to continue this after Broadcom takes over. Your blog is invaluable to VMware administrators.

    Reply
  3. *protectedWee Sung Cheng says

    11/03/2023 at 2:43 pm

    Echoing many people, your documentation has me, and probably many others, gems that cannot be sourced anywhere else. Hope the transition to Broadcom goes will for you and teams.

    Reply
  4. *protectedDan says

    11/04/2023 at 3:22 am

    Small note cmdb commonly refers for configuration management database.
    Thanks for highlighting this feature improvement.

    Reply
  5. *protectedTelkom University says

    11/12/2023 at 6:25 pm

    What specific enhancements have been made to the GuestOS data in the latest vSphere 8.0 Update 2 release?

    Reply

Thanks for the comment!Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Search

Thank Author

Author

William is Distinguished Platform Engineering Architect in the VMware Cloud Foundation (VCF) Division at Broadcom. His primary focus is helping customers and partners build, run and operate a modern Private Cloud using the VMware Cloud Foundation (VCF) platform.

Connect

  • Bluesky
  • Email
  • GitHub
  • LinkedIn
  • Mastodon
  • Reddit
  • RSS
  • Twitter
  • Vimeo

Recent

  • VMware Flings is now available in Free Downloads of Broadcom Support Portal (BSP) 05/19/2025
  • VMUG Connect 2025 - Minimal VMware Cloud Foundation (VCF) 5.x in a Box  05/15/2025
  • Programmatically accessing the Broadcom Compatibility Guide (BCG) 05/06/2025
  • Quick Tip - Validating Broadcom Download Token  05/01/2025
  • Supported chipsets for the USB Network Native Driver for ESXi Fling 04/23/2025

Advertisment

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy

Copyright WilliamLam.com © 2025

 

Loading Comments...