1. Overview
This guide explains how to install and configure the OpenStack Command Line Client (CLI) on a Linux system. After installation and configuration, you can use the CLI to manage OpenStack resources from the command line.
2. Prerequisites
Before you begin, ensure that:
- You have access to an OpenStack environment.
- You have administrative (root or sudo) privileges.
- Python 3.x is installed on the system.
- The system has an active internet connection to download the required packages.
3. Installation Overview
The OpenStack CLI can be installed on a Linux system using pip (Python package manager).
Before installing the client, install the required Python dependencies. After installation, configure the CLI using an OpenStack RC file to authenticate with your OpenStack environment.
4. Install the OpenStack CLI
Step 1: Install Required Dependencies
Ubuntu / Debian
sudo apt update
sudo apt install python3-pip python3-dev python3-venvCentOS / RHEL
sudo yum install python3-pip python3-develStep 2: Install the OpenStack Client
Install the OpenStack CLI using pip:
pip install python-openstackclientNote: It is recommended to install the OpenStack client inside a Python virtual environment to avoid conflicts with other Python packages.
Step 3: Verify the Installation
After the installation is complete, verify that the OpenStack CLI is installed successfully:
openstack –versionThe command displays the installed version of the OpenStack client.
5. Configure the OpenStack CLI
Step 1: Download the OpenStack RC File
Download the OpenStack RC file from the OpenStack Dashboard.
Navigate to:
Project → API Access → Download OpenStack RC FileThe RC file contains the authentication details required to access your OpenStack project.
Step 2: Source the RC File
Run the following command to load the authentication environment variables:
source /path/to/openstack_rc_file.shExample RC file:
export OS_AUTH_TYPE=v3applicationcredential
export OS_AUTH_URL=”https://in-west3.controlcloud.app:5000/v3″
# Application credential
export OS_APPLICATION_CREDENTIAL_ID=””
export OS_APPLICATION_CREDENTIAL_SECRET=””
# Optional
export OS_REGION_NAME=”RegionOne”
Update the Application Credential ID and Application Credential Secret with your own values before using the file.
Step 3: Verify the Configuration
Run the following command:
openstack token issueIf the configuration is correct, the command returns an authentication token, confirming that the CLI can communicate with the OpenStack environment.
6. Common OpenStack CLI Commands
List Servers
openstack server listCreate a Server
openstack server create –image <image_id> –flavor <flavor_id> –network <network_id> <server_name>List Networks
openstack network listCreate a Network
openstack network create <network_name>Create a Volume
openstack volume create –size 10 <volume_name>7. Troubleshooting
Authentication Failed
If you receive an Authentication failed error:
- Verify that the OpenStack RC file has been sourced correctly.
- Confirm that the authentication credentials are correct.
Command Not Found
If the openstack command is not available:
- Verify that the OpenStack client was installed successfully.
- Reinstall the package using pip if necessary.
8. Conclusion
After installing the OpenStack CLI and configuring it with the appropriate RC file, you can manage your OpenStack resources directly from the command line.
Always ensure that you source the correct RC file before running OpenStack commands.
For additional information, refer to the official OpenStack documentation.