Change authorization data
If you need to manage the resources of another account, project, pool or under a different service user, change the authorization details.
The process of changing data depends on how you have configured OpenStack API authorization:
- if you configured authorization using the operating system - change the authorization data in the OS;
- if you configured authorization in the Docker container - change the authorization data in the Docker container.
Change authorization data in the OS
Linux/macOS
Windows
-
Open the CLI.
-
Open the RC file in the
nanotext editor:nano /<directory_name>/<rcfile_name>Specify:
<directory_name>- name of the directory with the RC file and Dockerfile;<rcfile_name>- name of the RC file you downloaded to customize the OpenStack CLI. The default is.rc.sh
-
Change the authorization data in the file:
export OS_PROJECT_DOMAIN_NAME='<account_id>'
export OS_PROJECT_ID='<project_id>'
export OS_TENANT_ID='<project_id>'
export OS_REGION_NAME='<pool>'
export OS_USER_DOMAIN_NAME='<account_id>'
export OS_USERNAME='<user_name>'Specify:
<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 row of the desired project, press ;<pool>- pool for exampleru-2;<user_name>- the name of the service user who has access to resource management. Can be viewed in the control panel: in the top menu, click Account → section Service Users.
-
Exit the
nanotext editor with your changes saved: press Ctrl+X and then Y+Enter. -
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 default isrc.sh -
Enter the OpenStack password, which is the password for the service user you specified in step 3.
-
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, the response will list them. If no servers have been created yet, the response will contain an empty string.
-
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 row of the desired project, press ;<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);<pool>- pool for exampleru-2;<user_name>- the name of the service user who has access to resource management. Can be viewed in the control panel: in the top menu, click Account → section Service Users;<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, the response will list them. If no servers have been created yet, the response will contain an empty string.
Change authorization data in Docker container
-
Open the CLI.
-
Open the RC file in the
nanotext editor:nano /<docker_directory>/<rcfile_name>Specify:
<docker_directory>- the name of the directory where you moved the RC file and Dockerfile;<rcfile_name>- name of the RC file you downloaded to customize the OpenStack CLI. The default is.rc.sh
-
Change the authorization data in the file:
export OS_PROJECT_DOMAIN_NAME='<account_id>'
export OS_PROJECT_ID='<project_id>'
export OS_TENANT_ID='<project_id>'
export OS_REGION_NAME='<pool>'
export OS_USER_DOMAIN_NAME='<account_id>'
export OS_USERNAME='<user_name>'Specify:
<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 row of the desired project, press ;<pool>- pool for exampleru-2;<user_name>- the name of the service user who has access to resource management. Can be viewed in the control panel: in the top menu, click Account → section Service Users.
-
Exit the
nanotext editor with your changes saved: press Ctrl+X and then Y+Enter. -
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 the RC file was created.
-
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.