Using my Automated VMware Cloud Foundation (VCF) Lab Deployment script, you can quickly get to a functional VCF Management Domain which includes deploying the required Nested ESXi VMs and the Cloud Builder appliance, end-to-end automated deployment .
After recently enhancing the script to support the latest VCF 5.1 release and enabling users to also specify the Nested ESXi VMs that can be used to setup a VCF Workload Domain, I wanted to take it one step further and also automate the VCF Workload Domain deployment and utilizing the infrastructure that was setup in the initial deployment script.
Previously, if you wanted to create a Workload Domain, you would need to deploy the required Nested ESXi VMs, commission the ESXi hosts into SDDC Manager and then either use the Workload Domain creation wizard in SDDC Manager or manually construct the required JSON configuration file for an automated installation.
While there is certainly merit in using the SDDC Manager UI to create a Workload Domain, it can be time consuming if you have already experienced that before and this is where automation and using the SDDC Manager API can really help! Instead of having to "figure" out how to use the SDDC Manager APIs, I am using this as an opportunity to play with PowerVCF, a PowerShell Module for VCF using the SDDC Manager APIs.
Long story short, I have created a supplemental automation script called vcf-automated-workload-domain-deployment.ps1 which will assume you have successfully ran the vcf-automated-lab-deployment.ps1 script and it will look for the auto-generated ESXi host commission file (vcf-commission-host-api.json) in the same working directory. After updating the script to match your desired deployment, you will get a similar user experience as the original VCF deployment script, prompting for confirmation before starting the deployment as you can see from the screenshot below.
Using the ESXi host commission file, it will automatically connect to your SDDC Manager and commission the ESXi hosts and then construct the Workload Domain JSON configuration deployment file and automatically submit that to SDDC Manager for deployment.
This all happens fairly quickly (within a few minutes) with the rest of the heavy lifting being performed by SDDC Manager to start deploying your Workload Domain, which you can monitor the progress by logging into the SDDC Manager UI.
After some time, your Workload Domain should hopefully complete without any issues and show a ready status within the SDDC Manager UI under Workload Domains
If you login to either your Management or Workload Domain vCenter Server, you should see the following inventory as shown in the screenshot below.
Hopefully folks enjoy this additional automation, there was definitely quite a bit of testing and effort that went into developing this script! 😅
Just read that the Free ESXi is gone. So sad. Broadcom strikes again.
No more vsphere homelabs. Heard Vmug may go away or increase in price as well.
El Cloud Builder quedo en conectando....120 segundos.......
William,
Thank you for this script, and so many other scripts and helpful blog posts of yours that I've been led to over the years!
I am trying to use this script to setup my home lab, and have had success up to the point where it is trying to check for a URI GET response from the Cloud Builder. It says "Cloud Builder is not ready yet, sleeping for 120 seconds ...". I tried running the command manually from another PowerShell window after setting the proper variables for admin creds, and I get the response:
Invoke-WebRequest : The operation has timed out.
At line:1 char:1
+ Invoke-WebRequest -Uri "https://192.168.111.121/v1/sddcs" -Method GET ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebExc
eption
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
However, if I put the URL in a browser "https://[cb01 IP address]/v1/sddcs" and put in the proper creds, I get:
{
"elements": []
}
Is that the expected response? If I login to the Cloud Builder directly as admin, it goes to the screen:
VMware Cloud Builder
Select platform based on your datacenter needs.
The only thing I can think of that is causing this issue is that I had forgotten to enter the cb01 into DNS before I ran the script - I put that in after this sleep loop started, thinking that was the issue, (but then noticed that command line is using the IP, not the FQDN). I also rebooted the CB after that. Both IP and FQDN respond to pings, etc.
I don't know if you'll see this any time soon, but if you do, can I break out of the script here and restart it without having to re-deploy everything? I may try doing that and if it wants to do everything over again, skipping to the part after the CB ready check. It looks like after that it wants to use "Invoke-RestMethod" instead of "Invoke-WebRequest", so I don't know what the chances are that the latter will work when the former is failing. I'm running this in PowerShell ISE, so I won't lose any variables if I kill it and skip over all the earlier parts...
Thanks!