Figuring out how to use the openstack CLI tools ('nova', 'oscli' or 'openstack') with rackspace was quite non-obvious. Perhaps I was missing some documentation.
This is just a simple wrapper to set my creds for interaction
with the openstack cli tools to interact with rackspace. I have similar wrappers for
other clouds (vexxhost
, server-stack
, runabove
, dreamcompute
).
The values here have worked for me with on Rackspace public cloud with 18.04 versions of 'swift', 'openstack, and 'nova' as of 2018-04-20. In a fresh lxd container:
$ apt-get install -y python3-openstackclient python3-novaclient python3-swiftclient
$ rackspace nova server list
$ rackspace openstack server list
$ rackspace swift list
You need to edit the script to add your credentials.
Since it has your credentials, you should probably: chmod go-rwx ~/bin/rackspace
.
- OS_AUTH_URL: Leave this to its setting
- OS_USERNAME: This is your "Account Name". Mine is 'smoser'. Find it in the web UI in the top right.
- OS_TENANT_NAME: account number. Mine is 6 digits. See in the web ui under your username. Some tools may need you to also set OS_PROJECT_NAME to this, but I could not verify that recently.
- OS_PASSWORD: This is the password you log into the web UI with. Mine of course is 'password'.
- OS_REGION_NAME: This controls which region is used. Some known values are: DFW, ORD, IAD
- REGION_NAME: Set this in your environment before invoking the script or modify the default value (DFW).
- KEYNAME: If you use 'rackspace ubuntu', this is what will be used for '--key-name' argument. You have to already have a key loaded with this name.
You can use it like:
-
no arguments: export needed environment and invoke $SHELL:
$ rackspace launching shell [/bin/bash] (rackspace-DFW)smoser@milhouse:~/$
-
command to run. instead of running 'bash', set up environment and run that command.
$ rackspace openstack image list | grep 16.04.*PV | 8b7<trim>220 | Ubuntu 16.04 LTS (Xenial Xerus) (PVHVM) | active |
-
Special arguments: Shortcuts for humans to 'nova' or 'openstack':
rackspace image-list
->nova image-list
rackspace server list
->openstack server list
rackspace flavor list
->oscli flavor list
-
ubuntu: special "launch me an ubuntu" shortcut
$ rackspace --dry-run ubuntu openstack server create --key-name=brickies \ --flavor="512MB Standard Instance" \ --image="Ubuntu 16.04 LTS (Xenial Xerus) (PVHVM)" \ ubuntu-20180420-133330