Up and running on Rackspace

Rackspace is now running a developer discount, so I thought I’d give them a try. Once I signed up for the account and got my credentials, here’s how I got up and running with the command-line tools. I got this info from Rackspace’s Getting Started guide.

First, install the OpenStack Compute client with rackspace extensions.

sudo pip install rackspace-novaclient

Next, create your openrc file, which will contain environment variables that the client will use to authenticate you against the Rackspace cloud. You’ll need the following information

  1. A valid region. When you’re logged in to your account, you can see the region names. In the U.S., they are:
    • DFW (Dallas)
    • IAD (Northern Virginia)
    • ORD (Chicago)
  2. Your username (you picked this when you created your account)

  3. Your account number (appears in parentheses next to your username when you are logged in to the control panel at http://mycloud.rackspace.com)

  4. Your API key (click on your username in the control panel, then choose “Account Settings”, then “API Key: Show”)

Your openrc file should then look like this (here I’m using IAD as my region):

export OS_AUTH_URL=https://identity.api.rackspacecloud.com/v2.0/
export OS_AUTH_SYSTEM=rackspace
export OS_REGION_NAME=IAD
export OS_USERNAME=<your username>
export OS_TENANT_NAME=<your account number>
export NOVA_RAX_AUTH=1
export OS_PASSWORD=<your API key>
export OS_PROJECT_ID=<your account number>
export OS_NO_CACHE=1

Finally, source your openrc file and start interacting with the cloud. Here’s how I added my public key and booted an Ubuntu 13.04 server:

$ source openrc
$ nova keypair-add lorin --pub-key ~/.ssh/id_rsa.pub
$ nova boot --flavor 2 --image 1bbc5e56-ca2c-40a5-94b8-aa44822c3947 --key_name lorin raring
(wait a while)
$ nova list
+--------------------------------------+--------+--------+-------------------------------------------------------------------------------------+
| ID                                   | Name   | Status | Networks                                                                            |
+--------------------------------------+--------+--------+-------------------------------------------------------------------------------------+
| 7d432f76-491f-4245-b55c-2b15c2878ebb | raring | ACTIVE | public=2001:4802:7800:0001:f3bb:d4fc:ff20:06ab, 162.209.98.198; private=10.176.6.21 |
+--------------------------------------+--------+--------+--------------------------------------------------------------------- 

There were a couple of things that caught me by surprise.

First, nova console-log returns an error:

$ nova console-log raring
ERROR: There is no such action: os-getConsoleOutput (HTTP 400) (Request-ID: req-5ad0092b-6ff1-4233-b6aa-fc0920d42671)

Second, I had to ssh as root to the ubuntu instance, not as the ubuntu user. In fact, the Ubuntu 13.04 image I booted doesn’t seem to have cloud-init installed, which surprised me. I’m not sure how the image is pulling my public key from the metadata service.

EDIT: I can’t reach the metadata service from the instance, so I assume that there is no metadata service running, and that they are injecting the key directly into the filesystem.

3 thoughts on “Up and running on Rackspace

  1. Thanks for giving this a try and providing some feedback. You are correct that console-log, config drive, cloud-init and metadata service are not yet available. Keypairs are only a recent addition. We’re still catching up on some implementations. I think the key is inject via the agent that works with XenStore (since we are a XenServer HV installation.)

    We are in the testing phases with all of the additional items. console-log is close and config-drive, metadata service and cloud-init configuration are on the roadmap.

    I was curious on how big of an issue you see the ubuntu user vs. root. It has just recently come to my attention that we are a bit out of step re: Amazon’s usage here. We are balancing that with the expectations of long time Rackspace cloud customers. Any additional thoughts?

    1. Troy:

      Two issues come to mind about logging in as root vs. ubuntu user on ubuntu instance:

      1. I just wasn’t expecting it, because the official Ubuntu cloud images from cloud-images.ubuntu.com use the ubuntu user convention: both on Amazon EC2, and on the ones we use in our internal OpenStack cloud.

      My initial conclusion on trying and failing to ssh was that something that had gone wrong somewhere (e.g., my ssh client wasn’t using my ssh private key, or the ssh server wasn’t up properly yet, ???). I only tried ssh’ing as root as a lark, I expected to see the message “you should log in as ubuntu”. I’m not sure how you would even communicate this effectively to new Rackspace users.

      2. My provisioning scripts (in my case, ansible) all assume access via the “ubuntu” user with sudo privileges. I was hoping to be able to use the same scripts, unmodified, on EC2, our internal cloud, and Rackspace. It’s not that much effort to customize them to support ssh’ing as root (I need to do a similar customization if I want to test on vagrant images, which use “vagrant” instead of “ubuntu”), but it’s not zero.

  2. Hey Lorin,

    Just FYI we actually have a config-drive coming out next week which you can use to inject user data into your instance. You’ll need to install cloud-init though and then image that to use as a sort of ‘golden image’ for the time being.

    -Trey

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s