WilliamLam.com

  • About
    • About
    • Privacy
  • VMware Cloud Foundation
  • VKS
  • Homelab
    • Resources
    • Nested Virtualization
  • VMware Nostalgia
  • Apple
You are here: Home / Automation / How to programmatically retrieve vCenter Server Patch & Update History?

How to programmatically retrieve vCenter Server Patch & Update History?

10.08.2021 by William Lam // 3 Comments

Homelab just upgraded successfully to vSphere 7.0 Update 3!

I really appreciate the “History” view to be able to see all the updates/patches that have been applied for your vCenter Server. Its the little things pic.twitter.com/Go9eicpeSp

— William Lam (@lamw.bsky.social | @*protected email*) (@lamw) October 7, 2021

After upgrading my homelab to the latest vSphere 7.0 Update 3 release, I was just looking at the "History" tab within the Virtual Machine Management Interface (VAMI), which gives you a historical view of all the patches and updates that have been applied to your vCenter Server since its initial deployment. I am not exactly sure when this was feature was introduced, but it can definitely be useful for both auditing but also debugging/troubleshooting purposes.

Of course, I was curious about this information and wanted to see if I could retrieve it using something like PowerCLI. However when I started to look for the API, I realized that there may not be a public API for this ... but that did not stopped me and taking a look at Chrome Developer, I quickly saw the endpoint which was /rest/appliance/update/history and I was able to figure out a workaround giving the same data.

Below are two examples on accessing this data using either PowerShell or cURL

PowerShell

$VAMI_USERNAME="FILL_ME_IN"
$VAMI_PASSWORD="FILL_ME_IN"
$VCSA_HOSTNAME="vcsa.primp-industries.local"

$pair = "${VAMI_USERNAME}:${VAMI_PASSWORD}"
$bytes = [System.Text.Encoding]::ASCII.GetBytes($pair)
$base64 = [System.Convert]::ToBase64String($bytes)
$basicAuthValue = "Basic $base64"

$headers = @{
    "authorization"="$basicAuthValue"
    "Content-Type"="application/json"
    "Accept"="application/json"
}

$uri = "https://${VCSA_HOSTNAME}:5480/rest/appliance/update/history"

$results = Invoke-WebRequest -Uri $uri -Method GET -Headers $headers -UseBasicParsing -SkipCertificateCheck
$jsonResults = ($results.Content | ConvertFrom-Json).Value

cURL

VAMI_USERNAME=FILL_ME_IN
VAMI_PASSWORD=FILL_ME_IN
VCSA_HOSTNAME="vcsa.primp-industries.local"

curl -s -k -u ${VAMI_USERNAME}:${VAMI_PASSWORD} https://${VCSA_HOSTNAME}:5480/rest/appliance/update/history | jq

 

More from my site

  • Quick Tip - vCenter Server Advanced Settings Reference
  • Downgrading new VMware vSphere Foundation (VVF) or VMware Cloud Foundation (VCF) licenses to 7.x
  • Updating handshakeTimeoutMs setting for ESXi 7.x & 8.x using configstorecli
  • Identifying vSphere with Tanzu Managed VMs
  • Quick Tip - New remote version of ESXCLI 8.x

Categories // Automation, PowerCLI, VCSA, vSphere 7.0 Tags // vSphere 7.0

Comments

  1. *protectedSteve says

    10/11/2021 at 7:24 am

    The scrip works well on v7, but I get errors on v6.5

    Reply
    • William Lam says

      10/11/2021 at 2:03 pm

      Do you see "History" tab in your VCSA 6.5? I suspect not and this feature was probably introduced in vSphere 7.0 🙂

      Reply
      • *protectedSteve says

        10/12/2021 at 7:12 am

        I realized that after I posted 🙂

        Reply

Leave a Reply to William LamCancel 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

  • 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
  • vCenter Identity Federation with Authelia 04/16/2025
  • vCenter Server Identity Federation with Kanidm 04/10/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...