Skip to content

Programmatically connecting to openstack and command line clients

  1. Esure you can connect using OpenVPN
  2. Create an application credential on https://cloud.er.kcl.ac.uk/identity/application_credentials/.
    • make sure you are in the correct project
    • Download and save the generated yaml file.
  3. To ensure a secure connection between your local machine and the CREATE OpenStack download and save the KCL-ER-Root-CA.crt.
  4. Add the root CA certificate to your trust store for API access.

Connect with OpenStack API

There are a range of options to how the APIs can be called. The example given here uses the python openstack client.

  1. Create a python virtual environment in the same directory as the downloaded yaml and activate it.
  2. Install the openstack client in the virtual environment with: pip install python-openstackclient
  3. View a list of servers in your project with: openstack --os-cloud=openstack server list

Take note

To use the python openstack client in a virtual environment, please write the KCL-ER-Root-CA.crt to the certificate chain of your virtual environment. The following example can be used:

openssl x509 -in KCL-ER-Root-CA.crt -text >> venv/lib/python3.8/site-packages/certifi/cacert.pem

Please note, path directories may be different based on which operating system or virtual environment build used.