1

How to Export a Rackspace Linux Machine using the Rackspace Export API

rackspace_logoIn this post, I will share the steps necessary to export a Linux cloud VM from Rackspace into a VHD formatted file. This process isn’t clearly documented in other places on the web, so I decided to capture the steps in a blog post for others out there looking to perform this task.

First, I need to clarify just a few points before this post continues… Rackspace does not permit exporting Windows or Red Hat Linux VMs. All Rackspace machine images are tagged with a property (in Glance) called com.rackspace__1__options. If the value for this property is anything but zero (0), then the export is not permitted and will result in an error if an export is attempted. However, all hope is not lost! If you need to export a Windows or Red Hat system out of Rackspace, you can look at using a third party tool such as RiverMeadow SaaS.

Rackspace explains that this prevention of exports is due to restrictions in licensing that they are bound to by the respective Operating System vendors. For that reason, this post is focused on demonstrating the export process with a CentOS 6.5 machine. Oh and one last thing before we proceed, the export is not a simple “right click and export” process. It requires calling the Rackspace API from a command line with a series of well placed commands and arguments. Now that that is out of the way, let’s proceed!

Export Steps:

  1. In the Rackspace UI, go to “Files” and then select “Create Container”. This will be used to store your cloud images. In my example, the container is called “Images”.
  2. rackspace5
  3. Create an image of the server/s you wish to export. Capture the “Image ID” of these servers.
  4. rackspace2
  5. From a Linux shell, authenticate to the Rackspace Cloud.
  6. Obtain your authentication token by running the following command. The authentication token can be found in the API output in the “ID field” block.
  7. Next, as an optional step, tag your instance with a metadata tag. The OS_IMAGE_URL tag should be updated with the proper region. This example assumes Virginia. Also, populate your image ID from step two here as well. The image tag is suggested if you are moving images across Rackspace regions. This step can be ignored for smaller migrations out of Rackspace probably.
  8. Use the following code to perform the export of the cloud machine. Insert the appropriate values. Also, for the –d argument, replace “Images” with the name of the container you created in step 1.
  9. After the export completes, the cloud machine’s image is saved in the container you created. You can then click the image to download the VHD to your local machine.rackspace3
  10. After the image is downloaded, it should be transferred to a location that your Hypervisor can access. From there, it can be added to a new virtual machine as its primary disk. This new machine is now effectively, the cloud instance that was running in Rackspace.

Calvin

One Comment

Leave a Reply

Your email address will not be published. Required fields are marked *