Providing Access to OpenStack CLI through a Proxy Server

You can make the OpenStack command line interface (CLI) accessible through a proxy server.

To provide access to the OpenStack CLI through a proxy server, you must first set the environment variable for the proxy server in the OpenStack RC file.

For example, if is the URL of the proxy server, and 3128 is the port number, you can edit the OpenStack RC file to specify the URL and port number with the export command as follows.

export http_proxy=
export https_proxy=

If the proxy server requires a username and password, then add the username and password to the URL.

In general, the export command must have the following format.

 export http_proxy=http://<username>:<password>@<server-ip>:<port>/

Replace the <username>, <password>, <server-ip>, and <port> with the appropriate values from your configuration.

If one or more OpenStack services can be accessed locally, you can specify the exception with the export command in the OpenStack RC file. For instance, you might want to access OpenStack Glance locally. In this case, you can add the following command to the OpenStack RC file, to access Glance locally.

glance_endpoint_id=$(openstack endpoint list -f value | awk '/glance / { print $1 }')
glanceIP=$(openstack endpoint show "$glance_endpoint_id" -c publicurl -f value | sed 's|http://||')
export no_proxy=localhost,,$glanceIP

In the aforementioned command, is your localhost IP and the glance IP address is gathered via the openstack endpoint list command.

Note: If you know the exact IP address of your glance API server, you could directly assign it to glanceIP in the above command, as in glanceIP=<Glance API server IP address>. 

The OpenStack RC file can be sourced on the machine where a user wants to run the OpenStack CLI so that the OpenStack CLI is available through the proxy server.

source <path to saved OpenStack RC file>

Tip: Alternatively, you can add the aforementioned export commands to the /etc/environments on the machine, on which you want to run the OpenStack CLI.

The browser you are using is outdated. For the best experience please download or update your browser to one of the following: