# How to make OpenStack accessible through CLI?

### Overview

OpenStack offers an integrated command-line client, allowing you to use simple commands to access the project API (collection of settings, credentials, and metadata about the application(s) you're working on). Additionally, the majority of OpenStack projects include a command-line client for each service. For instance, a nova command-line client is offered by the Compute service. The commands can be used to automate processes directly from the command line or by incorporating them into the code scripts. You can execute these commands on any computer by just entering your OpenStack credentials.&#x20;

In this tutorial, we'll help you to create your own resources as a cloud user via CLI.

### Get Started

**Step 1:** Log in to [OpenStack.](https://console.openstack.acecloudhosting.com/auth/login/?next=/)&#x20;

**Step 2: Download the rc file**&#x20;

An OpenStack rc file, also known as an openrc.sh file is a type of environment file that must be created in order to specify the necessary environment variables for the OpenStack command-line clients. You may download the file from your [OpenStack console](https://console.openstack.acecloudhosting.com/auth/login/?next=/). The login information for all OpenStack services is stored in this project-specific environment file. The variables allow communication between OpenStack services running in the cloud and OpenStack client commands.&#x20;

Download the file in your computer, as shown in the figure below:

&#x20;

<figure><img src="http://customer.acecloudhosting.com/index.php?rp=/images/kb/513_0.jpg" alt=""><figcaption></figcaption></figure>

**Step 3: Working on the terminal**&#x20;

Open the code editor of your choice that allows SSH key authentication because it is the only way to access OpenStack instances. Here we are using MobaXterm, which you may download from [here](https://mobaxterm.mobatek.net/download.html).&#x20;

After setting up, run the following commands:&#x20;

1\. Enter into the root user:&#x20;

```
sudo - i  
```

2\. Install pip for python 3 with all the required dependencies and python modules:&#x20;

```
apt install python3-pip 
```

<figure><img src="http://customer.acecloudhosting.com/index.php?rp=/images/kb/514_1.jpg" alt=""><figcaption></figcaption></figure>

3\. Execute the following command to install the OpenStack client in a virtual environment.&#x20;

```
apt install python3-openstackclient -y 
```

<figure><img src="http://customer.acecloudhosting.com/index.php?rp=/images/kb/515_2.jpg" alt=""><figcaption></figcaption></figure>

**Step 4: Uploading the rc file**&#x20;

You may directly upload the already downloaded rc file in your code editor.&#x20;

{% hint style="info" %}
**Note:** If the upload option is not available, then you may create a file using the text editor and copy the data of the downloaded OpenStack rc file into the newly created file.&#x20;
{% endhint %}

**Step 5: Copying rc file**&#x20;

1. As we are performing all the functions in the root user, you need to copy your rc file from /home/ubuntu to root, using the following command:&#x20;

```
cp /home/ubuntu/<rc.sh file name here> /root 
```

&#x20;    2\. Use the following command to list all the files in the root user directory. Below screenshot highlights the copied rc.sh file.

```
ls 
```

<figure><img src="http://customer.acecloudhosting.com/index.php?rp=/images/kb/517_3.jpg" alt=""><figcaption></figcaption></figure>

**Step 6: Execute the rc file**

1. Source the Linux shell, on which you want to run the OpenStack commands, using the command below:&#x20;

```
source <rc file name> 
```

&#x20;    2\. Enter your Openstack console password.&#x20;

{% hint style="info" %}
**Note**: The entered password will not be visible on the CLI.&#x20;
{% endhint %}

<figure><img src="http://customer.acecloudhosting.com/index.php?rp=/images/kb/521_MicrosoftTeams-image.png" alt=""><figcaption></figcaption></figure>

**Step 7: Access OpenStack with CLI**&#x20;

The OpenStack is now ready to work directly through CLI. Now, you can access and manage your servers, instances, volumes, networks, IPs, security groups etc with the suitable commands. You can refer to the official [OpenStack documentation](https://docs.openstack.org/python-openstackclient/pike/cli/command-list.html) for the same.&#x20;

&#x20;

<figure><img src="http://customer.acecloudhosting.com/index.php?rp=/images/kb/518_4.jpg" alt=""><figcaption></figcaption></figure>

<img src="http://customer.acecloudhosting.com/index.php?rp=/images/kb/520_6.jpg" alt="" height="359" width="800">


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.acecloud.ai/knowledge-base/tutorials/how-to-make-openstack-accessible-through-cli.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
