NSX Advanced Load Balancer can be managed through the web interface, REST API, or command-line interface (CLI). This section explains how to install the CLI shell onto a client's PC.

The CLI shell provides access to the NSX Advanced Load Balancer Controller through a PC client version of the Controller’s CLI. Two versions of the CLI shell installation package are available:

  • avi_shell-18.2.1-9010.tar.gz (or later) – Can be used with all infrastructure types. For installing this version of the CLI shell package, continue referring to the later Sections.

  • avi_lbaas-18.2.1-9010.tar.gz (or later) – Can be used if the infrastructure type is OpenStack and Keystone support is enabled. (This option is chosen during the initial NSX Advanced Load Balancer Controller setup and can also be configured later). To install this version of the CLI shell, see Installing LBaaS Driver CLI Shell for OpenStack topic in the VMware NSX Advanced Load BalancerInstallation Guide.

Note:

The CLI packages are available on the VMware customer portal, below the NSX Advanced Load Balancer Controller download option for each version.

For more information on VMware's customer portal, see VMware CUSTOMER CONNECT.

Requirements to Enable Remote CLI Shell

CLI shell server listens on TCP port 5054. To use the remote CLI shell, port 5054 must be permitted in the firewall rules between the CLI client and the NSX Advanced Load Balancer Controller.

OS Versions Supported

Versions of the CLI shell available for Linux and Mac are as follows:

  • Linux Ubuntu Docker container

  • Linux (not in a Docker container)

  • Mac

The steps are the same for each OS.

Prerequisites

The NSX Advanced Load Balancer CLI shell requires the following software:

  1. pip (install package manager for Python). Starting in version 20.1, Python 3.x is required.

  2. Virtual environment (virtualenv): Command syntax included below.

  3. NSX Advanced Load Balancer CLI shell installation file: From AWS S3.

  4. Python 3.x is required for CLI Shell from versions 20.1 and later.

s

The following sections provide steps for installing the NSX Advanced Load Balancer CLI shell.

Install the CLI Shell on a Ubuntu Docker Container

To install the NSX Advanced Load Balancer CLI shell on a Ubuntu Docker container, download the shell package onto the host and enter the following commands. Edit the “/tmp” in “/tmp ubuntu” to the directory where the image is downloaded.

 docker run -it -v /tmp:/tmp ubuntu
    sudo apt-get update
    sudo apt-get install python-pip

Log in to the CLI Shell

Log in to the NSX Advanced Load Balancer CLI shell as shown below.

  avi_shell --address 10.10.10.99
   Login: admin
   Password *****

The IPADDR is the Controller's IP address (10.10.10.99 in this example).

After logging in, NSX Advanced Load Balancer CLI commands can be entered into the shell. The show version controller command in the following example displays the NSX Advanced Load Balancer version:

show version controller
+-----------------+---------------------------------------+
| Controller Name | Version                               |
+-----------------+---------------------------------------+
| 10.10.25.44     | 18.2.1 (9010) 2019-12-03 22:42:48 UTC |
+-----------------+---------------------------------------+

Leave the CLI Virtual Environment

Exit the CLI shell virtual environment as shown below.

deactivate

Restart the CLI Shell

After the CLI shell is installed, enter the following command to start it the next time.

 $> avi_shell/bin/avi_shell 

show version controller
+-----------------+---------------------------------------+
| Controller Name | Version                               |
+-----------------+---------------------------------------+
| node-1          | 18.2.1 (9010) 2019-12-04 16:45:38 UTC |
| node-2          | 18.2.1 (9010) 2019-12-04 16:45:38 UTC |
| node-3          | 18.2.1 (9010) 2019-12-04 16:45:38 UTC |
+-----------------+---------------------------------------+