Skip to main content

Change authorization data

Last update:

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:

Change authorization data in the OS

  1. Open the CLI.

  2. Open the RC file in the nano text 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
  3. 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 example ru-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.
  4. Exit the nano text editor with your changes saved: press Ctrl+X and then Y+Enter.

  5. 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 is rc.sh

  6. Enter the OpenStack password, which is the password for the service user you specified in step 3.

  7. Verify that the OpenStack CLI is running. To do this, open the list of cloud servers:

    openstack server list

    If 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

  1. Open the CLI.

  2. Open the RC file in the nano text 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
  3. 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 example ru-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.
  4. Exit the nano text editor with your changes saved: press Ctrl+X and then Y+Enter.

  5. Start the Docker container:

    docker run -ti --rm -v $(pwd):/workspace osc:dalmatian
  6. 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 is rc.sh.

  7. Enter the OpenStack password - the password of the service user for whom the RC file was created.

  8. Verify that the OpenStack CLI is running. To do this, open the list of cloud servers:

    openstack server list

    If 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.