Start the OpenStack CLI
The OpenStack CLI startup process depends on how you have configured OpenStack API authorization:
- if you configured authorization using the operating system - run the OpenStack CLI in the operating system;
- if you configured authorization in the Docker container - run the OpenStack CLI in the Docker container.
Start the OpenStack CLI in the OS
Linux/macOS
Windows
-
Open the CLI.
-
Apply the environment variables from the RC file:
source <rcfile_name>Specify
<rcfile_name>is the name of the RC file you downloaded to configure the OpenStack CLI. The defaultis rc.sh. -
Enter the OpenStack password - the password of the service user for whom you downloaded the RC file.
-
Verify that the OpenStack CLI is running. To do this, open the list of cloud servers:
openstack server listIf cloud servers have been created in the pool and project specified in the variables, their list will appear in the command output. If no servers have been created yet, the command output will be empty.
-
Open the CLI.
-
Add environment variables:
set OS_AUTH_URL=<url>
set OS_IDENTITY_API_VERSION=3
set OS_VOLUME_API_VERSION=3
set CLIFF_FIT_WIDTH=1
set OS_PROJECT_DOMAIN_NAME=<account_id>
set OS_PROJECT_ID=<project_id>
set OS_TENANT_ID=<project_id>
set OS_TENANT_NAME=<project_name>
set OS_REGION_NAME=<pool>
set OS_USER_DOMAIN_NAME=<account_id>
set OS_USERNAME=<user_name>
set OS_PASSWORD=<user_password>Specify:
<url>- address (URL) for authorization in the API. The URL depends on the region and pool, and can be viewed in the URL list;<account_id>- account number. You can look it up in control panel in the upper right corner;<project_id>- Project ID. Can be copied in control panel: in the top menu click Products and select Cloud Servers → open the projects menu (name of the current project) → in the project line, click ;<project_name>- project name. You can view it in control panel: in the top menu, click Products and select Cloud Servers → open the project menu (name of the current project) → copy the project name;<pool>- pool for exampleru-2. It will be possible to manage the project infrastructure only in this pool;<user_name>- the name of the service user who has access to resource management;<user_password>- service user password. After creating a user, you cannot view the password - you can only generate a new one. More details in the subsection Change service user password instructions Change user data and role.
-
Verify that the OpenStack CLI is running. To do this, open the list of cloud servers:
openstack server listIf cloud servers have been created in the pool and project specified in the variables, their list will appear in the command output. If no servers have been created yet, the command output will be empty.
Run the OpenStack CLI in a Docker container
-
Open the CLI.
-
Start the Docker container:
docker run -ti --rm -v $(pwd):/workspace osc:dalmatian -
Apply the environment variables from the RC file:
source <rcfile_name>Specify
<rcfile_name>is the name of the RC file you downloaded to configure the OpenStack CLI. The defaultis rc.sh. -
Enter the OpenStack password - the password of the service user for whom you downloaded the RC file.
-
Verify that the OpenStack CLI is running. To do this, open the list of cloud servers:
openstack server listIf cloud servers have been created in the pool and project specified in the variables, their list will appear in the command output. If no servers have been created yet, the command output will be empty.
-
After working with the OpenStack CLI, log out of the Docker container:
exit