How to

Automating VMware Cloud on AWS SDDC Cluster Lifecycle with DCLI

VMware Cloud on AWS has the ability to add new clusters to an existing SDDC. This is most useful for workload separation. A cluster could be specified as the failover resource, a development environment, and so forth. However, as of Version 1.6, there’s a new reason to add new clusters to an SDDC: custom core counts! The ability to control the CPU count for hosts in a cluster is extremely important when it comes to running mission-critical applications that happen to be licensed per-core. Even better, it is extremely easy to automate the lifecycle of a cluster with Datacenter CLI (DCLI).

Let’s check out some examples of how we can manage clusters within VMware Cloud on AWS.

Environment Setup

As part of this blog, I will be using a previously deployed SDDC and will be using the ‘filter’ parameter of DCLI heavily. Therefore, while we always encourage you to be on the latest version of DCLI, you will need DCLI 2.10.2 or better. We will start by opening a terminal session and authenticating to the VMware Cloud on AWS service with our API Token. Then, we need to identify a couple services to use. These services will be the following:

  • com vmware vmc orgs
  • com vmware vmc orgs sddcs
  • com vmware vmc orgs sddcs clusters
  • com vmware vmc orgs tasks

One last setup requirement, we will need to grab IDs for the Organization and SDDC which we’ll be working with.

We can summarize the above criteria with the following code:

Example: DCLI Environment Setup

Cluster Creation – Interactive

The first example we’ll take a look at is using DCLI’s interactive mode to create a new cluster. To do this, while in the DCLI terminal, we can use DCLI’s convenient tab-complete option to help figure out how to make the command. First, enter ‘sddcs clusters’ and we will see there are two available options to complete the command: create and delete. We can then see the required and optional parameters for our ‘create’ method by entering the following command: sddcs clusters create

Example: Cluster Create Parameter expectations

The first three parameters are the most important ones and are required. The only parameter we are not yet familiar with, num-hosts. This is an integer based parameter used to tell VMware Cloud on AWS how many hosts we want the new cluster to be deployed with. We can also use the host-cpu-cores-count parameter to specify the CPU cores the hosts in this new cluster should have available. The other available parameter is storage-capacity and is only used in conjunction with EBS.

Creating a new cluster containing one host with only 8 CPU Cores available will look something like the following command:

Example: Creating a new cluster with 1 host containing 8 CPUs

The response from the above command is a task object, which we have used the filter parameter to return back some basic information. The returned object is a task because it will a little bit of time to create the cluster, deploy the host/s, and configure the cluster. We can follow along with the task using the tasks service, as follows:

Example: Output status of a task

Cluster Creation – Scripted

For this example, we will be creating another cluster by taking the commands from our prior section and creating a script compatible with DCLI’s scripted mode. Instead of copy/pasting each of the IDs into our script, we will use the filter parameter to populate a couple parameters and also output some basic information as the script runs.

Example: Running a script to create a new cluster

Cluster Information

We have deployed two new clusters, making a total of three clusters available in our SDDC. This example will take a look at how we can retreive information about those clusters. Remembering back to the first section, there were only methods available for create and remove. This is because the clusters are available as part of the SDDC object as the “clusters” property. We can retrieve some basic information about our clusters with the following command:

Example: Listing basic cluster information from an SDDC

Cluster Removal

The last example will complete the lifecycle management of our SDDC’s cluster, and that task is the removal of the cluster. The ‘delete’ method has three parameters, all of which are required. At this point, the first two can be assumed to be Org and SDDC IDs. The third is the Cluster ID, which we can reference from the prior section.

Removing a cluster from an SDDC will look something like the following command:

Example: Removing a Cluster from an SDDC


VMware Cloud on AWS based SDDCs can contain multiple clusters, which is beneficial for a couple reasons. First, workload separation. A cluster could be specified as the failover resource, a development environment, and more. Second, and new as of Version 1.6, these clusters can be deployed with a specific amount of CPU cores. This control is certainly important when it comes to running mission-critical applications that happen to be licensed per-core. All of the cluster actions are available via the VMware Cloud on AWS APIs, and therefore DCLI as well! This blog post walked us through how to deploy new clusters, identify the deployed clusters, and remove clusters which are no longer needed.

Let us know in the comments how you’re making use of additional clusters in your automation workflows!


Leave a Reply

Your email address will not be published. Required fields are marked *