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

  • 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+
  • Frequently asked scenarios about VM Provisioning & Management for vSphere+, vSAN+ and VCF+
  • Frequently asked scenarios about vCenter Desired State Configuration 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

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

  • Dynamically generate custom vSAN ESA HCL JSON for VMware Cloud Foundation (VCF) 5.1 12/06/2023
  • vSphere Code Capture is your ChatGPT for vSphere Automation 11/30/2023
  • ESXi 8.0 Update 2 not detecting Apple NVMe on Apple Mac Mini 2018 11/28/2023
  • Is there a vSphere REST API for ... 11/21/2023
  • Custom vSAN HCL JSON for VMware Cloud Foundation (VCF) 5.1 and vSAN ESA using Nested ESXi 11/20/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...