Following up from my previous Hybrid Cloud Extension (HCX) Automation article which looked at deploying the HCX Manager OVA, this article will now focus on automating the initial configuration of HCX Manager including the registration to HCX Cloud which will enable the on-prem HCX Manager to be used with VMware Cloud on AWS (VMC). Once HCX Manager is up and running, customers can configure the system using the HCX VAMI interface which is available on port 9443 via the UI or in our case with the HCX VAMI APIs.



I have updated my HCX PowerShell Module to include 8 additional functions that can be used for initial configuration of HCX Manager:

Set-HcxVCConfig

Set-HcxLicense

Get-HcxNSXConfig

Set-HcxNSXConfig

Get-HcxLocation

Set-HcxLocation

Get-HcxRoleMapping

Set-HcxRoleMapping

Get-HcxProxy

Set-HcxProxy

Remove-HcxProxy

In addition, I have also created a simple PowerShell script called configure_hcx_manager.ps1 which demonstrates how these functions can be used to setup HCX Manager.

Step 1 - Download and import the HCX PowerShell Module

Import-Module ./VMware.HCX.psm1

Step 2 - Next, we need to generate an HCX activation key that we can use to register our HCX Manager with HCX Cloud. Login to VMware Cloud on AWS (VMC) portal and under "Add-Ons" for your SDDC, click on the HCX link to open. From here, navigate to the "Activation Keys" and create a new key. Make a note of the key as this will be needed later.



Step 3 - Download the configure_hcx_manager.ps1 PowerShell script and edit the variables at the top and replace it with the configuration of your environment including the HCX activation key from the previous step.

Step 4 - Connect to to the HCX VAMI endpoint using the Connect-HcxVAMI cmdlet and specify the HCX Manager and the credentials you have configured when you deployed the OVA.



Note: Make sure that your HCX Manager has outbound connectivity to HCX Cloud (https://connect.hcx.vmware.com), as this is required for the initial registration. You may need to work with your network team to allow traffic through the firewall for this particular endpoint.

Step 5 - Once you have confirmed the login was successful, you can now run the configure_hcx_manager.ps1 script which will start configuring HCX Manager.



If everything was configured correctly, you should see similar output to the above screenshot. At this point, you can now login to your on-prem vCenter Server that you have registered HCX Manager and you should now see a new vSphere UI plugin for HCX. From here, you create a pairing between you on-prem vCenter Server and the VMC vCenter Server along with deploying the HCX Fleet appliances which includes the HCX Gateway, Interconnect & WAN Optimization.

Lastly, we can also verify our HCX configuration by using the various Get-Hcx* commands, below are examples of using the Get-HcxVCConfig, Get-HcxNSXConfig, Get-HcxLocation & Get-HcxRoleMapping functions: