OpenStack CLI
The OpenStack Command line interface (OpenStack CLI) allows you to work with VK Cloud platform services via the console. To use the OpenStack CLI, install the OpenStack client and authenticate.
1sudo apt update 2sudo apt install python3-openstackclient
If necessary, install packages to work with individual OpenStack services:
pip install python-<service name>client
Service names:
cinder
– block storage API and extensions;glance
– images API;heat
– orchestration API;manila
– shared file systems API;neutron
– network API;nova
– cloud computing (VM) and extensions API;octavia
— load balancer API;sahara
– Big Data processing API;trove
– databases API.
-
Go to personal account VK Cloud.
-
Make sure that two-factor authentication and API access are enabled.
-
Select a project.
-
On the page Project settings go to the tab API access.
-
Click Download openrc version 3. A file
<project name>-openrc.sh
will be uploaded. -
Specify the authentication credentials in the environment variables.
LinuxWindows-
Run the script execution:
source <project name>-openrc.sh
-
Enter the password of the project user.
-
-
Check the availability of the OpenStack client:
openstack --version
If the OpenStack client is installed, its version will be displayed in the console output.
-
Make sure that the environment variables match the project by running the command:
LinuxWindowsenv | grep OS_
The environment variables must contain authentication credentials corresponding to the project.
-
Run the command that uses the OpenStack client. For example:
openstack project list
The console output should display a list of available projects.
-
View the list of available flavors:
openstack flavor list
Example of the result of executing the command
1+--------------------------------------+-------------------+-------+------+-----------+-------+-----------+ 2| ID | Name | RAM | Disk | Ephemeral | VCPUs | Is Public | 3+--------------------------------------+-------------------+-------+------+-----------+-------+-----------+ 4| 09dc3eb9-fc46-44b1-8928-acd42f723747 | Standard-4-12 | 12288 | 0 | 0 | 4 | True | 5| 12dc66d3-828c-4495-a5ca-ea1710c33174 | Advanced-12-24 | 24576 | 0 | 0 | 12 | True | 6| 19b38715-48cd-495b-9391-4c4e9d424518 | Basic-1-2-40 | 2048 | 40 | 0 | 1 | True | 7| 25ae869c-be29-4840-8e12-99e046d2dbd4 | Basic-1-2-20 | 2048 | 20 | 0 | 1 | True | 8| 283fa444-8d59-4e83-b6f4-90613c52a5a4 | Advanced-8-16-100 | 16384 | 100 | 0 | 8 | True | 9| 2c7c3f57-b5a4-4139-af7d-d5f05d70c703 | Standard-6-24 | 24576 | 0 | 0 | 6 | True | 10| 4e115a9b-0ac2-440d-a120-95cf130d63c7 | Standard-2-2 | 2048 | 0 | 0 | 2 | True |
-
Output information about a separate image:
openstack image show c6320138-035f-40d8-XXXX-e814edb2ce5f
Example of the result of executing the command
1+------------------+------------------------------------------------------+ 2| Field | Value | 3+------------------+------------------------------------------------------+ 4| checksum | 896ea37e28d82a548cedf1e0aa92XXXX | 5| container_format | bare | 6| created_at | 2023-03-29T14:06:44Z | 7| disk_format | raw | 8| file | /v2/images/c6320138-035f-40d8-XXXX-e814edb2ce5f/file | 9| id | c6320138-035f-40d8-XXXX-e814edb2ce5f | 10| min_disk | 0 | 11| min_ram | 0 | 12| name | Alt-Linux-P9-Starter-Kit | 13| owner | b5b7ffd4ef0547e5b222f44555dfXXXX | 14| properties | base_image_ref='1a8aa332-d8ef-4c40-XXXX-cade8b59aea3', boot_roles='mcs_owner', direct_url='s3://user:key@h-int.icebox.q/images-b5b7ffd4ef0547e5b222f44555dfXXXX/c6320138-035f-40d8-XXXX-e814edb2ce5f', hw_qemu_guest_agent='True', hw_video_model='qxl', hw_vif_multiqueue_enabled='True', hw_watchdog_action='reset', image_location='snapshot', image_state='available', image_type='image', instance_uuid='f19e1e54-bce9-4c25-XXXX-e0f40e2cff14', is_ephemeral_root='True', locations='[{'url': 's3://user:key@h-int.icebox.q/images-b5b7ffd4ef0547e5b222f44555dfXXXX/c6320138-035f-40d8-XXXX-e814edb2ce5f', 'metadata': {}}]', mcs_name='Alt Linux P9 Starter Kit', mcs_os_distro='debian', mcs_os_type='linux', mcs_os_version='P9', os_admin_user='altlinux', os_distro='altlinux-p9', os_require_quiesce='True', os_type='linux', os_version='p9', owner_project_name='mcsXXXX', owner_specified.openstack.md5='XXXX', owner_specified.openstack.object='images/alt-p9-cloud-x86_64', owner_specified.openstack.sha256='XXXX', owner_user_name='test@vk.team', self='/v2/images/c6320138-035f-40d8-XXXX-e814edb2ce5f', store='s3', user_id='5f48556ef89444dbab8fa82669dXXXX' | 15| protected | False | 16| schema | /v2/schemas/image | 17| size | 1653604352 | 18| status | active | 19| tags | | 20| updated_at | 2023-03-29T14:08:15Z | 21| visibility | private | 22+------------------+------------------------------------------------------+