Skip to content

Command-line access

Everything you can do in the Horizon dashboard, you can also do from the command line using the openstack client. This is useful for automation and for tasks that are tedious to click through in the GUI.

Install the client

pip install python-openstackclient

Get your credentials

  1. In Horizon, go to Project → API Access (sometimes Compute → Access & Security → API Access) and click Download OpenStack RC File.
  2. Open the downloaded file and set OS_CLOUD or (on older setups) source it directly:
source openrc.sh

When asked, enter your TU Wien password. The environment variables are only active in the current shell.

Note

The RC file contains your credentials in plain text. Do not commit it to a repository or share it.

Useful commands

openstack flavor list                        # available flavors
openstack image list                         # available images
openstack server list                        # your instances
openstack server create --flavor a1.standard.4 --image ubuntu-noble-24.04 --key-name mykey myvm
openstack server ssh --login ubuntu myvm    # ssh into an instance by name
openstack floating ip create public          # allocate a floating IP
openstack server add floating ip myvm <ip>  # attach it to an instance
openstack server delete myvm

Replace <ip> and mykey/myvm with your own values. For the full command reference, see the official OpenStack CLI documentation.

Scripting

Because the client is just a set of commands, you can script it with your shell of choice. The Ansible openstack.cloud collection is also available if you prefer declarative infrastructure.