WilliamLam.com

  • About
    • About
    • Privacy
  • VMware Cloud
  • Tanzu
    • Application Modernization
    • Tanzu services
    • Tanzu Community Edition
    • Tanzu Kubernetes Grid
    • vSphere with Tanzu
  • Home Lab
  • Nested Virtualization
  • 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

  • Finding vCenter Cloud Gateway Deployments in your environment
  • How to audit vCenter Cloud Gateway & vCenter Server Registrations for vSphere+
  • Logging into vCenter when vCenter Cloud Gateway (VCGW) is disconnected from vSphere+ Cloud Service
  • How to check if your vCenter Server is using vSphere+ / vSAN+ Subscription?
  • Automating subscription and usage retrieval for vSphere+ and vSAN+ Cloud Service

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

Author

William Lam is a Senior Staff Solution Architect working in the VMware Cloud team within the Cloud Infrastructure Business Group (CIBG) at VMware. He focuses on Cloud Native, Automation, Integration and Operation for the VMware Cloud based Software Defined Datacenters (SDDC) across Private, Hybrid and Public Cloud

Connect

  • Email
  • GitHub
  • LinkedIn
  • RSS
  • Twitter
  • Vimeo

Recent

  • Will this Arm SoC work with ESXi-Arm? 06/02/2023
  • Converting VirtualBox VDI (Virtual Disk Image) to VMDK for use with ESXi 8.x 05/31/2023
  • Quick Tip - How to monitor when ESXi filesystem and partitions are filling up? 05/30/2023
  • DDR5 SODIMM capable kits for ESXi 05/30/2023
  • ESXi on ASUS PN64-E1 05/24/2023

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 © 2023

 

Loading Comments...