In this second part, I’ll discuss the actual Code Stream pipeline.
As stated before, the inspiration was William Lams wonderful Power Shell scripts to deploy a nested environment from a CLI. His original logic was retained as much as possible, however due to the nature of K8S a few things had to be changed. I’ll try to address those as they come up.
After some thought I decided to NOT allow the requester to select the amount of Memory, vCPU, or VSAN size. Each Esxi host has 24G of Ram, 4 vCPU, and contributes a touch over 100G to the VSAN. The resulting cluster has 72G of RAM, 12 vCPUs and a roughly 300G VSAN. Only Standard vSwitches are configured in each host.
The code, pipeline and other information is available on this github repo.
Deployment of the Esxi hosts is initiated by ‘deployNestedEsxi.ps1’. There are few changes from the original script.
- The OVA configuration is only grabbed once. Then only the specific host settings (IP Address and Name are changed.
- The hosts are moved into a vApp once built.
- The NetworkAdapter settings are performed after deployment.
- Persisted the log to /var/workspace_cache/logs/vsphere-deployment-$BUILDTIME.log.
Deployment of the vCSA is handled by ‘deployVcsa.ps1’ Some notable changes from the original code include.
- Hardcoded the SSO username to firstname.lastname@example.org.
- Hardcoded the size to ‘tiny’.
- Save the log file to /var/workspace_cache/logs/NestedVcsa-$BUILDTIME.log.
- Save the configuration template to /var/workspace_cache/vcsajson/NestedVcsa-$BUILDTIME.json.
- Move the VCSA into the vApp after deployment is complete.
And finally ‘configureVc.ps1’ sets up the Cluster and VSAN. Some changed include.
- Hardcoded the Datacenter name (DC), and Cluster (CL1).
- Import the Esxi hosts by IP (No DNS records setup for the hosts or vCenter).
- Append the configuration results to /var/workspace_cache/logs/vsphere-deployment-$BUILDTIME.log.
So there you go, down and simple Code Stream pipeline to deploy a nested vSphere environment in about an hour.
Stay tuned. The next article will include an NSX-T deployment.