WilliamLam.com

  • About
    • About
    • Privacy
  • VMware Cloud Foundation
  • VKS
  • Homelab
    • Resources
    • Nested Virtualization
  • VMware Nostalgia
  • Apple
You are here: Home / Automation / Quick Tip - Retrieving vSAN Congestion Health Programmatically

Quick Tip - Retrieving vSAN Congestion Health Programmatically

09.05.2024 by William Lam // 1 Comment

While catching up on post-Explore email, I received a question from a customer who has a large number of vSAN deployments spanning their ROBO environment. In one of their environment, they had some physical congestion issue that caused some problems for their vSAN stretched cluster and they were looking for a way to monitor the vSAN congestion health, which is available as part of vSAN Health.


Since this information is available as part of vSAN Health, we can certainly leverage the vSAN Health API to retrieve this information programmatically but we can also look at using the PowerCLI Test-VsanClusterHealth cmdlet to get this information in a quicker manner for administrators.

Here is a quick PowerCLI snippet that will retrieve the disk health metrics for a given vSAN Cluster from vSAN Health, which is what provides the congestion information:

$vsanClusterName = "vcf-m01-cl01"

$healthTestResults = Test-VsanClusterHealth -Cluster (Get-Cluster $vsanClusterName) -TestResultFilter PhysicalDiskHealth

foreach ($result in $healthTestResults.DiskHealthResult) {
    Write-Host "`n$($result.host)"
    foreach ($diskHealth in $result.DiskHealth) {
        Write-Host "$($diskHealth.Disk) $($diskHealth.CongestionValue)"
    }
}

Here is an example of the output which provides congestion health for each device within an ESXi host as shown in the screenshot below:


While you can periodically monitor the congestion health, a more proactive way is to leverage vCenter Alarms and we an out of the box congestion alarm called vSAN physical disk alarm 'Congestion' allowing you to specify custom thresholds, so you can get notified when a warning threshold is thrown before an error is observed.

More from my site

  • Programmatically accessing the Broadcom Compatibility Guide (BCG)
  • Enable TRIM/UNMAP from Nested vSAN OSA/ESA to physical vSAN OSA
  • Enhancements to VMware Cloud Foundation (VCF) & vSphere Automated Lab Deployment Scripts
  • Quick Tip - Retrieving vSAN usage & overhead information using vSAN API
  • Quick Tip - vSAN ESA Cluster Health Check returns Error message: Expecting value: line 1 column 1 (char 0)

Categories // Automation, PowerCLI, VSAN Tags // VSAN

Comments

  1. *protectedRegina says

    09/10/2024 at 12:57 am

    pretty nice

    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

  • 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...