WilliamLam.com

  • About
    • About
    • Privacy
  • VMware Cloud Foundation
  • VKS
  • Homelab
    • Resources
    • Nested Virtualization
  • VMware Nostalgia
  • Apple
You are here: Home / Automation / Inventory standalone ESXi host core count for vSphere+

Inventory standalone ESXi host core count for vSphere+

05.04.2023 by William Lam // Leave a Comment

To help customers inventory their existing vSphere and vSAN CPU core usage for the vSphere+ and vSAN+ Cloud Service, you can take advantage of this inventory script HERE that I have created and generates a report (including CSV) by connecting to your existing vCenter Server(s) for analysis.

While the majority of our customers use vCenter Server to manage their ESXi host(s), we do have customers that run standalone ESXi hosts for various reasons. Recently, I had a few inquires on how customers could inventory their standalone ESXi hosts as they plan to transition those standalone ESXi hosts into the vSphere+ Cloud Service?

The benefit of using the vSphere API in creating the initial script is that the exact same API model also applies to a standalone ESXi host, so the core logic was there but a small modification of the script was required as we now have individual ESXi hosts that we need to connect and inventory. In addition, I also wanted to make the user experience as easy as possible to run the script and require as little input as possible.

The solution is a new PowerCLI function that takes in a simple text file that is delimited by a comma with each line containing the following:

  • ESXi Hostname/IP Address
  • ESXi Uesrname (does not require root and can even be read-only account)
  • ESXi Password

The script will then read the file and connect to each host using Connect-VIServer cmdlet and leverage the exact same code from the original script to inventory the CPU core usage and output either to the console and/or to CSV file.

Step 1 - Install the script from PSGallery by running the following command:

Install-Script StandaloneHostvSpherePlusCPUSocketToCoreUsage

Step 2 - We now need to "source" the script which is saved into your local home directory under .local/share/powershell/Scripts

. /Users/${env:USER}/.local/share/powershell/Scripts/StandaloneHostvSpherePlusCPUSocketToCoreUsage.ps1

Once you have created your host text file (which can be named anything), we simply pass it to the Get-StandalonevSpherePlusCPUSocketToCoreUsage function as show in the example below:

Get-StandalonevSpherePlusCPUSocketToCoreUsage -InputFile host.txt

Here is an example output which connects to 3 standalone ESXi hosts and produces the following output:


If you prefer to save the output to CSV file, you can run the following:

Get-StandalonevSpherePlusCPUSocketToCoreUsage -InputFile host.txt -Csv

More from my site

  • Programmatically accessing the Broadcom Compatibility Guide (BCG)
  • Enhancements to VMware Cloud Foundation (VCF) & vSphere Automated Lab Deployment Scripts
  • Frequently asked scenarios about Subscription & Entitlement for vSphere+, vSAN+ and VCF+
  • Frequently asked scenarios about Global Inventory for vSphere+, vSAN+ and VCF+
  • Frequently asked scenarios about Cloud Consumption Interface (CCI) for vSphere+, vSAN+ and VCF+

Categories // Automation, VMware Cloud, vSphere Tags // vSphere

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