Openstack CLI
Note
In this stage we will use previously created vms to make our work easier
1. Openstack CLI installation
- Login to an instance with SSH.
- On the instance we execute following commmands:
sudo apt update sudo apt install -y python3-pip python3-dev sudo pip3 install --upgrade pip sudo pip3 install python-openstackclient
2. Environment file - Openstack rc file
- Download Openstack openrc file from OVHcloud panel
Warning
Openrc file has to be downloaded for the region where our instance is spawned. Example:
-
We copy file to the instance.
scp -i ~/roadshow-workspace/key openrc ubuntu@<public_ip>:~/
We copy content of the file with clipboard to the ~/openrc file on the instance.
-
We want to replace prompt inside openrc file with proper password, so openstack won't ask us every time.
-
We use openrc file to connect to the Openstack API
source openrc
3. Locking the instance
- We need to find id of our instance with command:
openstack server list
- Using command we lock operations on the server:
openstack server lock <vm_id>
- We have to ensure, that machine is immutable in the OVHcloud Panel.
- We release the lock on the instance.
openstack server unlock <vm_id>
- We remove the instance in OVHcloud Panel.