Supernova on Arch Linux

In a previous article I demonstrated how you can install, configure and use the nova client to manage your Rackspace  cloud via the command line using the Restful API.

The nova client is great but you can only manage one account at a time.  Here we setup supernova – a nova wrapper allowing one to manage multiple accounts, including vanilla OpenStack instances at the same time.

Installation

Fortunately for me, supernova is available in the AUR.  With a AUR helper like yaourt you can simply install with:

[andy@home-pc ~]$ yaourt -S supernova

Configuration

To use supernova, you’ll need to create a ~/.supernova configuration file.  You can find an example configuration file here.

[andy@home-pc]$ vim ~/.supernova

See below for what my configuration looks like. Here I use my Rackspace username (OS_USERNAME) and password (OS_PASSWORD).

[personal]
OS_AUTH_URL=https://identity.api.rackspacecloud.com/v2.0
OS_AUTH_SYSTEM=rackspace
OS_REGION_NAME=LON
OS_SERVICE_NAME=cloudServersOpenStack
OS_TENANT_NAME=10040176
OS_USERNAME='rackspace-username'
OS_PASSWORD="myRackspacePassword"
NOVA_RAX_AUTH=1

You should now be able to list all your active cloud servers for example.

[andy@home-pc ~]$ supernova personal list
[SUPERNOVA] Running nova against personal... 
+--------------------------------------+------------------+--------+------------+-------------+---------------------------------------------------------+
| ID                                   | Name             | Status | Task State | Power State | Networks                                                |
+--------------------------------------+------------------+--------+------------+-------------+---------------------------------------------------------+
| b7af7b6d-9d86-41ea-9ae4-b108a7549a23 | wiki.pikedom.com | ACTIVE | -          | Running     | public=134.223.176.125; private=10.182.69.161           |
+--------------------------------------+------------------+--------+------------+-------------+---------------------------------------------------------+

While this is okay, its better to use the API key than the password. To achieve this, replace the OS_PASSWORD variable with the API key as shown below.

[personal]
OS_AUTH_URL=https://identity.api.rackspacecloud.com/v2.0
OS_AUTH_SYSTEM=rackspace
OS_REGION_NAME=LON
OS_SERVICE_NAME=cloudServersOpenStack
OS_TENANT_NAME=10040176
OS_USERNAME=rackspace-username
#OS_PASSWORD=USE_KEYRING['a317880fe08b4429b556b54e82f8a1']
NOVA_RAX_AUTH=1

You first need to set the credentials with.

supernova-keyring -s global a317880fe08b4429b556b54e82f8a1

Enter a password when prompted. You can check the set password with the -g option.

supernova-keyring -g global a317880fe08b4429b556b54e82f8a1

You should now hopefully then be able to list your servers again:

[andy@home-pc ~]$ supernova personal list
[SUPERNOVA] Running nova against personal... 
+--------------------------------------+------------------+--------+------------+-------------+---------------------------------------------------------+
| ID                                   | Name             | Status | Task State | Power State | Networks                                                |
+--------------------------------------+------------------+--------+------------+-------------+---------------------------------------------------------+
| b7af7b6d-9d86-41ea-9ae4-b107a7549a23 | wiki.pikedom.com | ACTIVE | -          | Running     | public=134.223.176.125; private=10.182.69.161           |
+--------------------------------------+------------------+--------+------------+-------------+---------------------------------------------------------+

Now lets suppose you need to manage a second Rackspace cloud account. This one is a US account perhaps with servers in both the ORD and DFW regions. Amend your configuration to reflex this with the following entry.

[company]
OS_AUTH_URL=https://identity.api.rackspacecloud.com/v2.0/
OS_AUTH_SYSTEM=rackspace
OS_REGION_NAME=ORD;DFW
OS_SERVICE_NAME=cloudServersOpenStack
OS_TENANT_NAME=746459
OS_USERNAME=yourrackspaceusername
OS_PASSWORD=YoUrRAcksPaCePassW0rd!
NOVA_RAX_AUTH=1

Again, you should replace your password with the API key.

OS_PASSWORD=USE_KEYRING['139f181eb61dfa8a3ab4f912sic86a97']

However, don’t forget to set it with.

[andy@home-pc ~]$ supernova-keyring -g global 139f181eb61dfa8a3ab4f912sic86a97

Now listing the servers should display everything in ORD with company-ORD and everything in DFW with company-DFW – like so:

[apike@workpc ~]$ supernova company list
[SUPERNOVA] Running nova against company-ORD... 
+--------------------------------------+-------------------+--------+------------+-------------+-------------------------------------------------------------------------------------------+
| ID                                   | Name              | Status | Task State | Power State | Networks                                                                                  |
+--------------------------------------+-------------------+--------+------------+-------------+-------------------------------------------------------------------------------------------+
| 5ed25a47-416e-488a-beb7-7ac7d512491g | downloads         | ACTIVE | -          | Running     | public=113.20.72.145, 67.207.141.200, 67.207.142.209, 209.20.69.44; private=10.183.145.43 |
| c5b68173-a38d-49j4-b286-8d4e6288411c | push2.pikedom.com | ACTIVE | -          | Running     | public=28.207.96.115; private=10.183.42.130                                               |
| b1ddc213-f271-43ac-fac2-99e09a373275 | production        | ACTIVE | -          | Running     | public=72.207.110.141; private=10.183.42.231                                              |
+--------------------------------------+-------------------+--------+------------+-------------+-------------------------------------------------------------------------------------------+
[SUPERNOVA] Running nova against company-DFW... 
+--------------------------------------+-----------------------------+--------+------------+-------------+---------------------------------------------------------------------------------+
| ID                                   | Name                        | Status | Task State | Power State | Networks                                                                        |
+--------------------------------------+-----------------------------+--------+------------+-------------+---------------------------------------------------------------------------------+
| 06cd88e5-8c1e-4aa5-a8bc-30a0125ead17 | mailtest.pikedom.com        | ACTIVE | -          | Running     | public=119.78.138.149; private=10.180.17.10                                     |
| aa7c9b51-aa47-4b79-a60b-7d4d6cf06549 | ov-prod-rs-01               | ACTIVE | -          | Running     | public=49.48.173.238; private=10.180.9.139; ternalsmtpnet=192.168.5.9           |
| 2be31285-453d-470a-bc35-d266n2e04b32 | prod                        | ACTIVE | -          | Running     | public=69.254.119.79; private=10.207.7.199;  internalsmtpnet=192.168.5.7        |
| 7d01da51-3836-4b9c-8839-4d1f98741f10 | uat (www-uat, www-uat-temp) | ACTIVE | -          | Running     | public=42.239.236.51, 26.247.115.109; private=10.102.101.148                    |
+--------------------------------------+-----------------------------+--------+------------+-------------+---------------------------------------------------------------------------------+

As you can see, this is quite a powerful way of managing multiple Rackspace cloud accounts. You can also use Supernova to manage vanilla OpenStack instances but for now we’ll leave that one for another day.

Be the first to comment

Leave a Reply