WilliamLam.com

  • About
    • About
    • Privacy
  • VMware Cloud
  • Tanzu
    • Application Modernization
    • Tanzu services
    • Tanzu Community Edition
    • Tanzu Kubernetes Grid
    • vSphere with Tanzu
  • Home Lab
  • Nested Virtualization
  • Apple
You are here: Home / Automation / Automating HCX Add On for VMware Cloud on AWS

Automating HCX Add On for VMware Cloud on AWS

06.19.2019 by William Lam // 1 Comment

Enabling Hybrid Cloud Extension (HCX) for a VMware Cloud on AWS SDDC is just a click of a button and is completely self-service which makes consuming the HCX Service extremely easy! All the hard work of deploying and configuring the required HCX infrastructure for your SDDC is completely automated for you by VMware when you click on "Deploy HCX" button.


Once the HCX infrastructure has been deployed in your SDDC, you can then deploy the respective HCX components for your on-premises vSphere environment which you can fully automate end-to-end which I have blogged about here.

Although the deployment of the HCX components for the SDDC is just click of a button, I recently had a need to automate this and I figure this would be a nice addition to my HCX PowerShell Community Module and complete the end-to-end story quite nicely from enabling the HCX Cloud Service to automating the deployment and configuration of the on-premises HCX components.

The HCX Cloud Service APIs is pretty straight forward which allows customers to enable the service and deploy to an SDDC, generate license keys for both HCX Cloud and Enterprise deployments and retrieving basic information about your account and SDDCs. To demonstrate the use of the HCX Cloud APIs, I have implemented the following 6 new PowerShell functions in my HCX Module:

  • Connect-HcxCloudServer
  • Get-HCXCloudSubscription
  • Get-HCXCloud
  • Get-HCXCloudActivationKey
  • New-HCXCloudActivationKey
  • Set-HCXCloud

Before we can use the functions, we need to authenticate to the HCX Cloud Service which is through the use of a CSP Refresh Token.

Here is an example of using the Connect-HCXCloudServer and your Refresh Token:

Connect-HCXCloudServer -RefreshToken $RefreshToken

Once connected, we can list all SDDCs for the given Organization using the Get-HCXCloud function:


In addition to the name, you will get the SDDC ID which is parameter required to deploy HCX to a specific SDDC but we can also see the current HCX Status and Region information, simliar to what you would see in the HCX Cloud Service UI.

For Subscription information and specifically when you need to generate a new license key, the Subscription ID (SID) is required and you can use the Get-HCXCloudSubscription function:


To request a new license key, simply use the New-HCXCloudActivationKey and provide the SID which can be found by using the previous command. You can also list all license keys and filter by usage by using the Get-HCXCloudActivationKey function.


So far, all of these functions are pretty granular based on the underlying HCX Cloud APIs. However, when it comes to enabling the deployment of HCX to an SDDC, from the UI standpoint, it is just a click. That is the user experience which I wanted to mimic from an Automation standpoint.

The Set-HCXCloud function actually encompasses the handling of the license request, so that you do not have to do it manually and the only input is the SDDC ID which can be retrieved from the Get-HCXCloud function.

Here is an example of enabling the HCX deployment for "SDDC-01" which did not have HCX enabled.

Set-HCXCloud -Activate -SDDCID $SDDCID


As indicated by the output above, the HCX deployment can take some time and you can either monitor the progress using the HCX Cloud Service UI


You can also retrieve the status by just using the Get-HCXCloud function as shown in the screenshot below.


With this final Automation in place, customers can now fully automate HCX deployments for VMC from enabling the service for an SDDC to fully deploying, configuring and associating the on-premises HCX components with the HCX Cloud instance!

More from my site

  • Automating HCX Multi-Site Service Mesh configuration using the new HCX PowerCLI cmdlets
  • Automating complete HCX deployment and configuration to first cloud migration using PowerCLI
  • Automating Hybrid Cloud Extension (HCX) Manager initial configuration for VMC
  • Quick Tip - How to clear all Hybrid Cloud Extension (HCX) Migrations in the vSphere UI
  • Create vCenter Alarms for monitoring HCX migration events

Categories // Automation, HCX, PowerCLI, VMware Cloud on AWS Tags // HCX, Hybrid Cloud Extension, VMC, VMware Cloud on AWS

Comments

  1. mikes says

    06/19/2019 at 11:31 am

    My hero!!! I swear, all I have to do is think it and somehow you make it a reality and BLAM!
    Now I just need to do is hook a Clapper up to: make new SDDC, install/config/connect HCX from on-prem to VMC on AWS-SDDC, turn on DR.. go to beach!
    Now THAT is Dramas.
    Thank You!!!!!!

    Reply

Thanks for the comment! Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Search

Author

William Lam is a Senior Staff Solution Architect working in the VMware Cloud team within the Cloud Infrastructure Business Group (CIBG) at VMware. He focuses on Cloud Native technologies, Automation, Integration and Operation for the VMware Cloud based Software Defined Datacenters (SDDC)

Connect

  • Email
  • GitHub
  • LinkedIn
  • RSS
  • Twitter
  • Vimeo

Recent

  • How to disable the Efficiency Cores (E-cores) on an Intel NUC? 03/24/2023
  • Changing the default HTTP(s) Reverse Proxy Ports on ESXi 8.0 03/22/2023
  • NFS Multi-Connections in vSphere 8.0 Update 1 03/20/2023
  • Quick Tip - How to download ESXi ISO image for all releases including patch updates? 03/15/2023
  • SSD with multiple NVMe namespaces for VMware Homelab 03/14/2023

Advertisment

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy

Copyright WilliamLam.com © 2023

 

Loading Comments...