Home > Blogs > VMware {code} > Monthly Archives: June 2018

Monthly Archives: June 2018

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.