Installing the Avi Vantage CLI Shell
Avi Vantage can be managed through the web interface, REST API, or command line interface (CLI). This article explains how to install the CLI shell onto a client PC.
Overview
The CLI shell provides access to the Avi 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 CLI shell package, continue referring to this article.
-
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 is an option to be chosen during initial Avi Controller setup and can also be configured later). To install this version of the CLI shell, refer to Installing LBaaS Driver CLI Shell for OpenStack instead.
Note: The CLI packages are available on the Avi customer portal, below the Avi Controller download option for each version.
For more information on Avi customer portal, refer to Access to Avi Customer Portal.
Requirements to enable remote CLI shell
CLI shell server listens on TCP port 5054. In order to use the remote CLI shell, port 5054 must be permitted in the firewall rules between the CLI client and the Avi Controller.
OS Versions Supported
Versions of the CLI shell are available for Linux and Mac.
- Linux Ubuntu Docker container
- Linux (not in a Docker container)
- Mac
The steps are the same for each OS.
Prerequisites
The Avi Vantage CLI shell requires the following software:
- pip (install package manager for Python).
- Virtual environment (virtualenv): Command syntax included below.
- Avi Vantage CLI shell installation file: From AWS S3.
The following sections provide steps for installing the Avi Vantage CLI shell.
Installing the CLI Shell on a Ubuntu Docker Container
To install the Avi Vantage 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
Installing the CLI Shell on Linux or Mac
This section provides steps for installing the Avi Vantage CLI shell onto the Linux or Macintosh. The steps are the same for either OS.
Note: For installing a CLI shell to manage an OpenStack write access mode deployment with Keystone support enabled, refer to Installing the LBaaS CLI Shell (OpenStack with Keystone).
-
Install pip, if not already installed.
- Install
virtualenv
, if not already installed:
sudo pip install virtualenv Downloading virtualenv-14.0.6-py2.py3-none-any.whl (1.8MB) 100% |████████████████████████████████| 1.8MB 178kB/s Installing collected packages: virtualenv Successfully installed virtualenv-14.0.6
- Create a virtual environment for the CLI shell:
virtualenv avi_shell New python executable in /home/user/git/clean/avi-dev/build/avi_shell/bin/python Installing setuptools, pip, wheel...done.
- Go to the CLI shell virtual environment:
cd avi_shell/ source ./bin/activate
- Install the CLI shell package:
pip install /tmp/avi_shell-18.2.1-9010.tar.gz Processing /tmp/avi_shell-18.2.1-9010.tar.gz Collecting cmd2==0.6.8 (from shell-client==18.2) Collecting iso8601==0.1.11 (from shell-client==18.2) Using cached iso8601-0.1.11-py2.py3-none-any.whl ... ... Successfully installed cmd2-0.6.8 commentjson-0.6 iso8601-0.1.11 prettytable-0.7.2 pyparsing-2.1.0 pytz-2015.7 requests-2.9.1 requests-toolbelt-0.5.1 shell-client-17.2.17 urllib3-1.14 virtualenv-13.1.2 wheel-0.26.0 wrapt-1.10.6
Logging Onto the CLI Shell
Log into the Avi Vantage CLI shell as shown below:
avi_shell --address 10.10.10.99
Login: admin
Password *****
The IPADDR is the IP address of the Controller (10.10.10.99 in this example).
After login, Avi Vantage CLI commands can be entered into the shell. The show version controller
command in the following example displays the Avi Vantage version:
show version controller
+-----------------+---------------------------------------+
| Controller Name | Version |
+-----------------+---------------------------------------+
| 10.10.25.44 | 18.2.1 (9010) 2019-12-03 22:42:48 UTC |
+-----------------+---------------------------------------+
Leaving the CLI Virtual Environment
Exit the CLI shell virtual environment as shown below:
deactivate
Restarting 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 |
+-----------------+---------------------------------------+