In development and training environments, it is frequently needed to repeatedly deploy one or more resources for the tasks at hand. For VMware Cloud on AWS, there’s a few choices.
Our team frequently runs training sessions that involve attendees deploying their very own single host SDDC in VMware Cloud on AWS. While this is a great opportunity for people to get “hands-on” experience with the service, the deployment processing time is not optimal for a time limited class. If people really want to see the manual deployment process within just a few minutes, they can deploy a Zerocloud SDDC instance. This gives them the deployment “experience” in a fraction of the time.
A better use of hands-on time is to have SDDCs pre-deployed. This can be done:
- Manually (No thanks! 15-30 manual deployments of SDDCs will take a very long, interactive, time)
Obviously we want to investigate the scripting options here. During my exploration of this topic, I found you could use the DCLI, PowerShell, or directly call the REST API. As some may know, I’m not much of a PowerShell/PowerCLI guy so I started by looking at the DCLI. Unfortunately, I found this to be quite cumbersome and inconsistent in the couple hours that I attempted to work with it. Rather than spend much more time troubleshooting, seeking assistance, etc… I chose to look into working directly with the REST API since I have more experience in that area due to my work with vRealize Orchestrator. Fortunately, I came across this example code: Curl example usage for VMware Cloud on AWS by Alan Renouf and this article by William Lam: Using VMC API to answer commonly asked questions about your SDDC. These were a perfect starting point since I was already familiar with curl and bash scripting.
The results of my effort can be found on my vmc-aws-scripts repository on Github.
The scripts in that repository represent a starting point of functional example scripts that may be cloned and modified to suit your own needs. If you are a scripter comfortable with bash, curl, jq, and REST APIs and would like to contribute additional reusable scripts, please do submit a Pull Request to get your additions added!