Для управления серверами через CLI можем использовать Openstackclient:

# sudo pip3 install python-openstackclient

 

Создаем конфиг:

vi openstack_vars.sh

export OS_PROJECT_DOMAIN_NAME=This email address is being protected from spambots. You need JavaScript enabled to view it.

export OS_USER_DOMAIN_NAME=users

export OS_PROJECT_ID=$UUID_PROJECT

export OS_USERNAME=This email address is being protected from spambots. You need JavaScript enabled to view it.

export OS_PASSWORD=$PASS

export OS_AUTH_URL=https://infra.mail.ru:35357/v3/

export OS_IDENTITY_API_VERSION=3

export OS_IMAGE_API_VERSION=2

 

Применяем конфиг:

source openstack_vars.sh

 

Тестируем работу клиента:

# openstack --os-cloud dev availability zone list

# openstack --os-cloud dev network list

# openstack --os-cloud dev flavor list

# openstack --os-cloud dev server list

и т.д.

 

Подставляем актуальные UUIDы и создаем виртуалку testcreate33:

# openstack --os-cloud dev server create --image 64995697-2d04-42b0-b5d2-c78dcd4c4b84 --flavor df3c499a-044f-41d2-8612-d303adc613cc --network 298117ae-3fa4-4109-9e08-8be5602be5a2 --config-drive True --security-group 9ed6b1e9-9543-465f-8023-cc021e9b8e24 --key-name hss-txt-SgNlX4kL testcreate33

 

Смотрим её IP:

# openstack --os-cloud dev server list

 

Удаляем сервер:

# openstack --os-cloud dev server delete 0f8ecbc0-d68c-48c2-b562-e5318f54b884