Earlier this week, we demonstrated that we could deploy a VMware Cloud Foundation (VCF) Management Domain using just a single ESXi host. In addition, we can further optimize the deployment for homelab purposes by removing the CPU and memory reservations for NSX when deploying either a VCF Management or Workload Domain.
The most logical question that I am sure some of you are probably asking ... besides, how much time I actually spent testing these scenarios out!? (I rather not comment 😵💫) ... is what about deploying a VCF Workload Domain with just a single ESXi host? 🤔
You guessed it, it is definitely possible!
Disclaimer: This is not supported by VMware, use at your own risk. As of writing this blog post, this trick is functional with the latest VCF 4.5 release.
By default, SDDC Manager will only allow a Workload Domain to be created with two or more ESXi hosts and to be able to deploy with just a single ESXi host, the deployment will need to be initiated from the VCF REST API and within the SDDC Manager.
Step 1 - Before starting a VCF Workload Domain deployment, SSH to the SDDC Manager VM using the vcf user account and then switch to root by running the following command and providing the credentials to the vcf user:
su -
Step 2 - We then need to update the SDDC Manager configuration to allow for single ESXi host for Workload Domain and restart the service. The command below includes few other settings that can also benefit homelab environments including a single NSX Manager and increasing the timeout period while NSX is getting configured.
cat >> /etc/vmware/vcf/domainmanager/application-prod.properties << EOF expected.minimum.hosts=1 vc7.deployment.option=tiny nsxt.manager.formfactor=small nsxt.management.resources.validation.skip=true nsxt.manager.cluster.size=1 nsxt.manager.wait.minutes=120 EOF systemctl restart domainmanager.service
Step 3 - Next, we need to register or commission our single ESXi host that will be used to deploy the Workload Domain with SDDC Manager. This step can be accomplished by using either the SDDC Manager UI or API. For detailed UI steps, please refer to the official VCF documentation.
Step 4 - Since we need to use the VCF REST API to deploy the Workload Domain, we need to retrieve the ID that has been associated with our commissioned ESXi host, which was completed from the previous step. Run the following command on the SDDC Manager which should return both the ID and hostname of your ESXi host. Please make a note of the ID as it will be needed in the next step.
curl -s http://localhost/inventory/extensions/vi/esxis?unassignedOnly=1 | json_pp | jq '.[] | .id, .hostname'
Step 5 - Download the example JSON deployment file vcf45-workload-domain-example.json and adjust the values or append additional configurations based on your environment. In addition to changing the hostname/IP Addresses you will also need to complete the following:
- Replace the FILL_ME_IN_COMMISSION_HOST_ID string with the ID generated from Step 4
- Replace all the FILL_ME_IN_VCF_*_LICENSE_KEY with valid VCF 4.5 licenses
- The additionalManagerNodesSpec section must still contain valid DNS/IP Address entries EVEN if you intend to only deploy a single NSX due to VCF REST API pre-checks
Once you have completed all of your changes, copy the JSON file to the SDDC Manager.
Step 6 - Lastly, to begin the Workload Domain deployment, run the following command and pass in the modified JSON configuration file:
curl -X POST -H "Content-Type:application/json" http://127.0.0.1/domainmanager/vidomains -d[at]vcf45-workload-domain-example.json
If the SDDC Manager accepts the JSON configuration file, you should see a task response in the command-line and you can then monitor the rest of the deployment progress using the SDDC Manager UI.
If everything was configured correctly, you should eventually see a new Workload Domain appear in in the SDDC Manager UI with a status of ACTIVE as shown in the screenshot above.
For my testing, I deployed using my Nested ESXi Virtual Appliance VMs and as you can see from the screenshot below, here are the final set of VMs that were deployed for my particular setup.
Note: While SDDC Manager does provide a remote public VCF REST API for deployments among all other operations, I found that the external JSON format differs from the one that is accepted when directly calling from within SDDC Manager. It may be possible to deploy a VCF Workload Domain using a single ESXi host using the public API, but that was something I did not have time to try and would be a good exercise for those familiar with the VCF REST API. Additionally, if you need to troubleshoot your deployment, a good place to look is SDDC Manager logs at /var/log/vmware/vcf/domainmanager/domainmanger.log which can provide some insights on what might be failing.
Gareth Corbett says
I got as far as step 6.
Please can you update with better example of how to upload the json file?
I get the error: (3) URL using bad/illegal format or missing URL
Cory says
You can post a json file with curl like so:
curl -X POST -H "Content-Type: application/json" -d @FILENAME DESTINATION
so for example:
curl -X POST -H "Content-Type: application/json" -d @../data/cats.json http://localhost:8080/mSfvMwNAfj
Danilo Perillo Chiacchio says
Hi William, great article!
Is this a way to define the vCenter Server size for VI deployments on VCF 5.1.1?
Thank you,
Danilo.
Nathan Chan says
Thanks William ! Would you happen to have a 5.2 workload domain template example ? Thanks
Nathan Chan says
I can confirm it worked on 5.2 after i got rid of my Typo ! 🙂