When launching a new workload VM in an AWS VPC, you can install NSX Tools by providing the NSX Tools download and installation instructions in the User Data field.

When you launch an AWS EC2 instance, you have the option of passing user data to the instance that can be used to perform common automated configuration tasks, including running scripts after the instance starts. You can pass two types of user data to AWS EC2: shell scripts and cloud-init directives.

Copy the download and installation instructions for NSX Tools from CSM and paste into User Data when launching a new workload VM.

Prerequisites

Before installing NSX Tools using User Data, ensure that the Transit and Compute VPCs are peered. This is required so that FQDN given in the download command, such as, nsx-gw.vmware.local can be resolved from the launching instance.

Procedure

  1. Log in to AWS console and start the process of launching a new workload VM.
  2. In another browser window, log in to CSM.
    1. Go to Clouds > AWS > VPCs
      Note: Transit VPC/VNet is where one or a pair of PCGs is deployed and running. Compute VPC/VNet is the one linked to a Transit and can use the PCGs deployed there.
    2. Click on a Transit or Compute VPC.
    3. From the NSX Tools Download & Installation section of the screen, copy the Download Location and the Installation Command under Linux or Windows depending on what OS you are using for your workload VM. You can also copy-paste the following shell script:
      #!/bin/bash
      sudo wget http://nsx-gw.vmware.local:8080/factory_default/linux/install_nsx_vm_agent.sh
      sudo chmod +x install_nsx_vm_agent.sh && sudo ./install_nsx_vm_agent.sh
  3. In AWS, in the steps for launching a new workload VM instance, paste the download location and the installation command as Text in User Data in the Advanced Details section.

Results

The workload VM is launched and NSX Tools are installed on it automatically.