Home > Blogs > VMware {code}

Automating VMware Cloud on AWS One Host SDDC Deployments

The latest release of VMware Cloud on AWS introduces a brand-new deployment configuration. We can now deploy an SDDC which consists of a single host! This is exciting for many reasons, but biggest reason for me is being able to access all the APIs without occupying the standard minimum SDDC footprint of four hosts.

More information on the One Host release is available here: VMware Cloud on AWS – Single Host Access

We’re going to take a quick look at how we can quickly and easily deploy one of these 1 host SDDCs through the Developer Center API Explorer, PowerCLI, and Datacenter CLI (DCLI).

AWS Customer Account Linking

If this is the first time you’re deploying an SDDC, you will need to link your AWS account to the VMware Cloud on AWS service. This linking allows us to do many things but, for the purpose of an SDDC deployment, it will allow us to connect our SDDC to our existing AWS VPC.

The easiest way to create this link is by logging in to the VMware Cloud on AWS Cloud Console, heading to the ‘Developer Center’ tab from the top menu, then the ‘API Explorer’ sub-tab. We will then want to expand the ‘AWS Account Connection Operations’ section, followed by also expanding the ‘GET /orgs/{org}/account-link’ section. After verifying the ‘org’ parameter already has a value set, click the ‘Execute’ button.

VMWonAWS - Account Linking API Usage

We’ll want to then copy the URL associated with the ‘template_execution_url’ and paste it into our browser of choice. This URL take us to AWS’ CloudFormation service and run through a template that will configure the account linking on our behalf.

VMWonAWS - Account Linking API Usage

We’re now ready to start deploying our SDDC with the method of our choice!

Developer Center API Explorer

The Developer Center continues to be one of my favorite manners of learning, exploring, and even using the VMware Cloud on AWS APIs. Let’s start with deploying a one host SDDC with the built in API Explorer.

If you’re not still in the API Explorer from the previous section, the API Explorer can be found by logging into the VMware Cloud on AWS Cloud Console, selecting the ‘Developer Center’ tab from the top menu, then selecting the ‘API Explorer’ sub-tab.
Now that we’re in the API Explorer, we’ll want to browse for the ‘SDDCs’ section and expand that. We’ll then also want to expand the following top section labeled ‘POST /orgs/{org}/sddcs’. We’ll see the ‘org’ parameter already has our Org Id filled in as well as a blank ‘sddcConfig’ value. We can populate that value with an example JSON body containing empty values by clicking on the ‘AwsSddcConfig’ link in the ‘Data Type’ column.

  • connected_account_id: Enter the AWS account this SDDC should be connected to.
    Note: This is the ID for the account which can be pulled from the API with the following:
    Method: GET /orgs/{org}/account-link/connected-accounts
    Property: ID
  • customer_subnet_ids: Enter the desired subnet ID for VPC traffic.
    Note: This is the ID for the VPC subnet which can be pulled from the API with the following:
    Method: GET /orgs/{org}/account-link/compatible-subnets
    Property: subnet_id
  • deployment_type: Enter whether this SDDC should be contained with a singular availability zone or across multiple availability zones.
    Note: one host SDDCs can only be of a type ‘SingleAZ’
  • name: Enter the desired name of the SDDC
  • numOfHosts: Enter the number of desired hosts, in this case: 1
  • provider: Enter the provider, which would be ‘AWS’
  • region: Enter the desired region. (Case sensitive format example: US_WEST_2)
  • sddc_template_id: Enter the SDDC Template ID
  • sddc_type: Enter the SDDC type
  • sddc_domain: Enter the desired SSO domain (Default: vmc.local)
  • vpc_cidr: Enter the desired subnet to use that corresponds with preferred management subnet (Default: 10.2.0.0/16)
  • vxlan_subnet: Enter a VXLAN IP subnet to be used.

A minimal sddcConfig would look like the following:

Click ‘Execute’ and the response should be a task object including the details for your newly deploying SDDC!

PowerCLI Deployment

PowerCLI has the ability to interact with the VMware Cloud on AWS APIs through a low-level, API access only, module. The following script makes the process of deploying a single node SDDC easy and straightforward. Download the sample script below, update lines 9 through 12 with values for your environment, and run the script!

Datacenter CLI Deployment

DCLI also has the ability to interact with the VMware Cloud on AWS APIs. There’s also a script which allows DCLI to easily create a single node SDDC. Download the sample script below, update line 10 to point to the location of JQ, also update lines 13 through 15 with values for your environment, and run the script!

Summary

The latest update to VMware Cloud on AWS brings a great new way to access all the features, services, and APIs the service has available, just in a smaller footprint. These one host SDDCs can be deployed and managed the same way as standard SDDCs. This blog post took a look at how to use the RESTful API as well as two CLIs (PowerCLI and DCLI) to deploy this new configuration.

Let us know in the comments what your preferred method of deployment is!

Getting Started with the PowerCLI Module for VMware Cloud on AWS

It’s time for another new edition of Talking Code! In this one I’ll be walking through how to get started using the PowerCLI module for VMware Cloud on AWS.

Getting Started with the PowerCLI module for VMware Cloud on AWS

For more information on this module, check out the PowerCLI blog post: Getting Started with the VMware Cloud on AWS Module

For more videos in the Talking Code series, see the Talking Code Archive

As always, let us know in the comments what other videos you’d like to see in the future!

Talking Code: VMware Cloud on AWS – API Endpoint Overview

We’re back with another edition of Talking Code! This time we have a lightboard walkthrough of the API endpoints that are available as part of VMware Cloud on AWS!

VMware Cloud on AWS – API Endpoint Overview

For more information, check out the VMware Code Developer Center microsite for VMware Cloud on AWS.

For more videos in the Talking Code series, see the Talking Code Archive

As always, let us know in the comments what other videos you’d like to see in the future!

Talking Code: DCLI Interactive Mode

VMware Code is kicking off a brand new series of informational videos that are going to be called ‘Talking Code’. This series is going to take an in-depth look at some of the tools, documentation, example scripts, and more that is available for developers and automation specialists from VMware!

This first video is going to take a look at the interactive mode of Datacenter CLI (DCLI). This is especially important as DCLI recently received a huge update in the form of version 2.9.1!

Talking Code – DCLI Interactive Mode

For more information on DCLI, please see the following page: VMware Code – DCLI

Let us know in the comments what other videos you’d like to see in the future!

Improving Association of Samples and VMware Products

On Friday, we deployed an update to Sample Exchange on VMware {code} that allows you to select any VMware product or SDK when contributing a sample. As a result, developers looking for samples for VMware products and services will have an easier time finding relevant content. Continue reading

VMware Code Developer Center Microsite – VMware Cloud on AWS

VMware Code has a terrific set of Developer Center microsites already available for vRealize Automation, NSX, Workspace ONE, and Apteligent. Each of these Developer Centers give easy access to documentation, developer and automation tools, code samples, and more. As of today, we are happy to announce the brand-new microsite dedicated to VMware Cloud on AWS!

VMware Code Developer Center Microsite for VMware Cloud on AWS

The VMware Code Developer Center microsite for VMware Cloud on AWS gives direct access to those resources developers and automation specialists desire most! There’s an overview featuring what’s available through the VMware Cloud on AWS service as well as some videos that dive right into the available APIs and tooling available. This is followed up by a more detailed overview of the available core capabilities. Then, the key use cases are outlined along with the ability to find out more information about each of them and what kind of development efforts are estimated.

The Developer Resources section has a ton of great information available. This section gives direct links to the SDKs and CLIs that support VMware Cloud on AWS. There is also a detailed list of documentation and blog posts to help better understand each aspect of the service as well as how to quickly and easily get started using each of those SDKs and CLIs. Lastly, this section features code that’s been contributed by both VMware and the community to the VMware Code Sample Exchange in a variety of formats. From PowerCLI to Python, CloudFormation to Terraform, there’s some great resources already available and we more than welcome additional contributions!

The last section is dedicated to Community! Community involvement is an important aspect of the automation and developer resources and this section includes links to get involved directly. Joining VMware Code allows for access to an active Slack group with over 5,000 members, receive regular newsletters with the latest VMware information, and access to the developer forums!

Check out the VMware Code Developer Center microsite for VMware Cloud on AWS today!
Let us know in the comments what you think and/or if there’s anything missing that you may be looking for.

Datacenter CLI – Installation Walkthrough

Datacenter CLI (DCLI) 2.9.1 has been released and the new features are fantastic! One of the key new updates is how we install this new version of DCLI. In the past, DCLI was installed as part of vSphere CLI (vCLI). In this current version, DCLI is installed through the Python Package Index (PyPI) using pip. PyPI is the official, third-party, online repository for Python packages. Pip is a package management system which handles the installation process of Python packages from repositories like PyPI.

If you already have Python installed, version 2.7 or later, we can install DCLI with the following command:

DCLI Installation Process

Let’s cover a couple scenarios where the above might not work.

Command Not Found – MacOS

MacOS comes with Python installed by default. However, this version of Python is generally used for system related tasks, isn’t up to date, and doesn’t always include pip. That means that there is a chance you could be greeted with the following:
DCLI Install - pip command not found

Installing a new, updated, version of Python is quite simple and can be done in multiple ways. My preferred way of installing Python on MacOS is with Homebrew, a widely used command line driven package manager. It can be easily downloaded and installed with the following command:

Example: Installing Homebrew

Then, we can install Python with the following command:

Afterwards, pip will now be available and we can now easily install DCLI with the command above!

Command Not Found – Windows

Windows does not come natively with Python installed. The first step will be to download and install a supported version of Python (2.7 or better). This can be obtained from the Python Downloads page. When performing the installation, ensure the ‘Add Python x.x to PATH’ option is checked.

DCLI Installation - Python Install

Once the installation is complete, open up your favorite terminal window (I used PowerShell), and run the following command:

DCLI Installation - pip install dcli

Summary

Datacenter CLI 2.9.1 greatly expands the available features and changed the installation process. This blog took a detailed look at the installation process and how to the more well-known issues people have ran into.

For more information about the DCLI 2.9.1 release, see the following vSphere blog post: New Release: VMware Datacenter CLI 2.9.1 For more specific information about, see the VMware Datacenter CLI (DCLI) User’s Guide.

VMware Cloud on AWS Developer Center Updates

VMware Cloud on AWS does a tremendous job at enabling our automation experts, developers, and DevOps teams. With a robust set of RESTful APIs, open-sourced SDKs, then capping it all off with the Developer Center located directly in the Cloud Console, access has never been easier. One of the key features of VMware Cloud on AWS is the more frequent update cadence. This allows us to release enhancements on a more regular basis, of which the Developer Center is also included.

With that said, I am happy to announce some of the latest updates to the Developer Center!

API Explorer Redesign

The API Explorer is one of the easiest ways to start learning, modeling, and even using the VMware Cloud on AWS RESTful APIs. It has received several extremely nice updates! After clicking on the “API Explorer” tab, you’ll notice immediately how the layout has been changed. The new side bar allows us to easily switch between the API namespaces as well as auto-populate parameter fields. These may seem like minor updates, but they really help to streamline its usage.

Let’s take an example: we need to list out the logical networks within a particular SDDC, in this case the “CPBU-TMM” SDDC.

If you’re consuming the REST calls directly through an SDK, REST API client, or a programming language, you will need to perform the following calls to retrieve that information:

  1. Obtain the Org ID: GET /orgs
  2. Obtain the SDDC ID, using the Org ID: GET /orgs/{orgID}/sddcs
  3. Obtain the logical networks, using both the Org and SDDC IDs: GET /orgs/{orgID}/sddcs/{sddcID}/networks/4.0/sddc/networks

If you’re using the API Explorer, thanks to the new side menu, we can consolidate that down to a single call!

VMware Cloud on AWS Developer Center Updates - API Explorer

From the above example, you can also see the other new addition in the form of a yellow warning bar. This is just a friendly reminder that the API Explorer is running against your live environment. If you make an API call in the API Explorer, that call will actually run. If you delete something, it really will get deleted! Just keep that in mind as you’re exploring these APIs.

Code Sample Updates

The Code Samples section has also received some updates! This section has been updated to reference the VMware Code Sample Exchange. Therefore, as samples are added to the VMware Code Sample Exchange, those samples will start being populated within the Code Samples tab. We can see several examples which have been created in the example below.

VMware Cloud on AWS Developer Center Updates - Code Samples

SDK Updates

The last of the updates is to the SDKs section. The layout has been updated to match the look and feel of the other tabs. It’s the same great information, just with a consistent look and feel!

VMware Cloud on AWS Developer Center Updates - SDKs

Summary

The VMware Cloud on AWS Developer Center is a great resource which provides a central location to access all kinds of automation and developer based information. The Developer Center is also receiving updates on a regular basis to provide optimized access to all of those resources. The latest update adds a redesigned API Explorer, integrated Code Samples with the VMware Code Sample Exchange, and a consistent theme through all of the available sections.

Let us know in the comments what your favorite feature of the Developer Center is and what functionality you’re most looking forward to us adding!

New APIs and SDKs for vSphere 6.7

The time has come! vSphere 6.7 has been released, and with it comes a host of new APIs and SDKs for automating, extending, and integrating the vSphere platform. Continue reading

VMware Cloud on AWS Integrations with CloudFormation

The latest update to VMware Cloud on AWS has some real gems in it for developers and automation engineers. As well as the introduction of the Developer Center (which is amazing). It’s such a terrific resource, I’m finding myself using it all the time! The other big news was the addition of an Open Sourced Github repository to showcase VMware Cloud on AWS integrations written by both VMware and the community at large.

The first of these integrations is the support for CloudFormation and Terraform integrations.

In this blog post we’re going to walk through how easy it is to create a software defined data center (SDDC) using the CloudFormation template available in the VMware Cloud on AWS Integration Examples repository. Please note, this will require an AWS account and may incur AWS charges.

First things first, we need to get access to the template. We can clone the repository locally with the following command:

CloudFormation Stack Creation

In order to deploy our SDDC with CloudFormation, we’ll need to start by logging into the AWS Console and checking to make sure we’re in the Oregon region. If you’re not in that region, there is a drop-down box towards the top right-hand side with a site name that’s located between your user account and the “Support” drop-down. Click on the drop-down and select “US West (Oregon)”.

Example: Selecting the Oregon Region

We’ll now want to go to the CloudFormation service. We can find the service by clicking on the “Services” drop-down and locating it in the “Management Tools” section. Alternatively, just type “CloudFormation” in the AWS services search box on the main screen of the console.

Once in the CloudFormation service, we will want to create a new stack by clicking on the “Create New Stack” button. This stack will be used to deploy our SDDC that will be based on the template we’ll import on the next screen.

Example: Creating a new CloudFormation Stack

As part of the stack creation process, we’ll need to either create a new template or select an existing template. We can upload the template we retrieved from the GitHub repo by choosing “Upload a template to Amazon S3” then clicking on “Choose File”. Browse to the location the repo was cloned to, select the “vmc-aws-cloud-cf-template.txt”, and click “Next”.

Example: Choosing the repository sourced template

On the next screen we will need to specify a stack name. In this case, I used “VMWonAWS-CF” as the stack name.

Example: Assigning the new stack a name

For the “Options” screen, there is nothing to update, so we can click “Next”. On the last screen, review the details and check the box that you “acknowledge that AWS CloudFormation might create IAM resources”. We’re now ready to create our stack by clicking the “Create” button!

After few moments, we should see a screen like the following indicating that the stack creation has been successfully completed.

Example: stack creation process

SDDC Creation

We’ve now laid out the groundwork to deploy our new SDDC. One piece of which is the result of the stack creation, in the form of a new Lambda function. We’ll use this function to input our SDDC criteria and then ultimately deploy our new SDDC.

While we’re still in the CloudFormation service, we’ll want to click on our newly created stack to retrieve the details. Once on the “Stack Detail” page, expand the “Resources” section. There we see the IAM Role and Lambda function. Click on the physical ID of the Lambda function, which will take us to the function’s page.

Example: Examining the newly created stack resources

Once on the newly created Lamda function page, scroll down to the “Environmental variables” section. This section is where we need to input the criteria for the SDDC variables:

  • connected_account_id: Enter the AWS account this SDDC should be connected to.
    Note: This is the ID for the account which can be pulled from the API with the following:
    Method: GET /orgs/{org}/account-link/connected-accounts
    Property: ID
  • email: Enter an email address which you would like notified when the process has completed.
  • name: Enter the desired name of the SDDC
  • numOfHosts: Enter the number of desired hosts. (Minimum is 4)
  • orgId: Enter the Org ID for which the SDDC will be assigned. (This is available in the VMware Cloud Console in the “Support Info” tab)
  • region: Enter the desired region. (Case sensitive format: US_WEST_2)
  • customer_subnet_ids: Enter the desired subnet ID for VPC traffic.
    Note: This is the ID for the VPC subnet which can be pulled from the API with the following:

    Method: GET /orgs/{org}/account-link/compatible-subnets
    Property: subnet_id
  • user_refresh_token: Enter the creating user’s OAuth Refresh Token.
    Note: This is available in the VMware Cloud Console by clicking your username then “OAuth Refresh Token”.
  • vpc_cidr: Enter the desired subnet to use that corresponds with preferred management subnet. (Default is 10.2.0.0/16)

Example: Filling in the SDDC variables for the lambda resource

With all of our variables now input, we’re ready to save and run our function. First, click “Save” then click “Test”. On the “Configure test event” pop out, give the test event a name and click “Create”.

Example: Creating a lambda test event

Next to the “Test” button is a drop-down list of events. Make sure that list is set to our previously created test event and then click “Test” again. If everything was set properly, we should see a response like the following:

Example: lambda test event results

We can note from the above image that the response is a task. If we source out the ID, we can then follow along using the tasks API until the creation is complete. Alternatively, we can also watch the deployment process on the SDDCs tab of our Cloud Console.

Example: VMware Cloud on AWS Cloud Console results

Summary

The latest update to VMware Cloud on AWS introduced a couple great features for developers and automation specialists as well as a way for you to share your integrations. This blog covered the newly released integrations with CloudFormation. We showed how to access the CloudFormation template in the VMware Cloud on AWS Integration Examples repository. We then walked through how to easily get started deploying SDDCs in VMware Cloud on AWS using the CloudFormation template.

Get started with it today and let us know how you’re planning on integrating this into your existing workflows in the comments below!