Skip to content

Openstack CLI

Note

In this stage we will use previously created vms to make our work easier

1. Openstack CLI installation

  1. Login to an instance with SSH.
  2. 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

  1. Download Openstack openrc file from OVHcloud panel

download openrc file

Warning

Openrc file has to be downloaded for the region where our instance is spawned. Example: download openrc

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

  2. We want to replace prompt inside openrc file with proper password, so openstack won't ask us every time.

  3. We use openrc file to connect to the Openstack API

    source openrc
    

3. Locking the instance

  1. We need to find id of our instance with command:
    openstack server list
    
  2. Using command we lock operations on the server:
    openstack server lock <vm_id>
    
  3. We have to ensure, that machine is immutable in the OVHcloud Panel. removal error
  4. We release the lock on the instance.
    openstack server unlock <vm_id>
    
  5. We remove the instance in OVHcloud Panel.