Automating VCF Host Commissioning with ESXi Kickstart
As a Senior Staff Solution Architect in the VMware Cloud Foundation (VCF) Division at Broadcom, I have had the pleasure of working with a variety of customers to help them automate their ESXi provisioning and management processes. One of the most frequent use cases that I encounter is the need to automate the host commissioning process for VMware Cloud Foundation (VCF) environments. In this blog post, I will show you how to incorporate the VCF host commissioning workflow automatically as part of an ESXi Kickstart installation.
Background and Challenges
Traditionally, after an ESXi host has been provisioned, it needs to be manually added to VMware SDDC Manager before it can be consumed for either expanding or deploying a new workload domain. This multi-step process can be time-consuming and prone to errors, especially when dealing with a large number of hosts. Moreover, this process requires user interaction, which can be a challenge for automated provisioning scenarios.
Solution Overview
To address these challenges, I came up with an idea to incorporate the VCF host commissioning workflow automatically as part of an ESXi Kickstart installation. The approach involves hosting a simple host mapping text file on a web server that contains the ESXi FQDN to the SDDC Manager (including service account token and network pool ID) details. The ESXi host will then use this file to remotely invoke the VCF Commission REST API and commission itself to the appropriate SDDC Manager.
Implementation Details
Here are the implementation details of the solution:
1. Host Mapping Text File:
Host a simple host mapping text file (sddcm-mapping.txt) on a web server that contains the ESXi FQDN to the SDDC Manager (including service account token and network pool ID) details. The format of the file is as follows:
For example:
my-esxi-host.local:10.10.10.10:my-service-account:my-network-pool
2. ESXi Kickstart Configuration:
Modify the %firstboot section of your ESXi Kickstart to include the following code:
download /path/to/sddcm-mapping.txt &&
parse_ini /path/to/sddcm-mapping.txt ESXi_FQDN SDDC_Manager_IP Service_Account_Token Network_Pool_ID &&
curl -kL https://
This code will download the sddcm-mapping.txt file, parse it to extract the ESXi FQDN, SDDC Manager IP, service account token, and network pool ID, and then use these details to invoke the VCF Commission REST API and commission the host to the appropriate SDDC Manager.
3. VCF Host Commissioning Workflow:
Once the ESXi host has finished provisioning and has rebooted, it will attempt to run the firstboot script. The firstboot script will download the sddcm-mapping.txt file and check whether there is a configuration entry that directs it to commission itself to a specific SDDC Manager. If an entry is found, the script will use the credentials and construct the required payload and invoke the VCF host commission REST API. If everything was set up correctly, you should now see a task within your SDDC Manager which has been initiated by the ESXi host after it has finished provisioning, completely automating the host commissioning process.
Benefits and Future Enhancements
The benefits of this solution are numerous:
* Zero-touch provisioning: The entire host commissioning workflow is automated, eliminating the need for user interaction.
* Scalability: This solution can be easily scaled to accommodate large numbers of ESXi hosts.
* Flexibility: The solution allows for dynamic assignment of SDDC Managers, making it easier to manage and maintain your VCF environment.
In the future, I would love to see this feature integrated into ESXi Kickstart as a native capability, further simplifying the host commissioning process. Additionally, the solution could be enhanced to support multiple SDDC Managers and more advanced workflows, such as automated network pool allocation and VM deployment.
Conclusion
Incorporating the VCF host commissioning workflow automatically into an ESXi Kickstart installation provides a simple yet powerful solution for automating the host provisioning process in your VCF environment. By eliminating user interaction and leveraging the power of automation, you can significantly improve the efficiency and scalability of your VCF deployment.