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 / How to retrieve the default VM hardware configuration for a specific Guest OS in vSphere?

How to retrieve the default VM hardware configuration for a specific Guest OS in vSphere?

03.28.2022 by William Lam // Leave a Comment

Have you ever wondered how or where the vSphere UI generates the default Virtual Machine hardware configuration after selecting a specific Guest OS during the VM creation wizard?


The answer is simply by asking the vSphere platform 🙂 and of course this is provided as an API for any client to consume including our own vSphere UI.

This is a topic I had written about back in 2013 here and here, which demonstrates how to use the EnvironmentBrowser API to query for the list of supported Guest OS and Virtual Hardware Compatibility. In addition to this information, we can also ask the vSphere platform on what are the default hardware configuration for all supported Guest OS using the QueryConfigOption API.

To demonstrate how to use the QueryConfigOption API, I have created two simple PowerCLI function which can be found in this example vmDefaultHardwareConfig.ps1

Before we can retrieve the VM hardware configuration for a specific Guest OS, we need to specify the supported VM hardware compatibility. To do this, you can use the Get-VMHardwareVersion function and specify the desired vSphere Cluster to query this information as shown in the screenshot below.

$ClusterName = "Supermicro-Cluster"
Get-VMHardwareVersion -ClusterName $ClusterName


Once we have the list of supported VM hardware compatibility versions, then we can use the Get-VMHardwareConfig function and specify the desired vSphere Cluster and the VM hardware compatibility version to retrieve the list of all Guest OS and their default hardware configurations.

$results = Get-VMHardwareConfig -ClusterName $ClusterName -VMHardwareVersion "vmx-19"
$results


The results from the function is an array of all Guest OSes and you filter the results further by keying off of the Id or FullName property.

More from my site

  • VMware has the best platform to run latest Windows 10 Desktop, Server & Hyper-V Tech Preview!
  • Changing GuestOS Type Using a Custom vCO Workflow in the vSphere Web Client
  • Extracting GuestOS IDs From vCloud Director
  • How to run Kali Linux on ESXi-Arm
  • How to Create Bootable ESXi 5 ISO & Specifying Kernel Boot Options

Categories // Automation, ESXi, vSphere Tags // guest os

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