1

I wonder if someone know how could I download the saved server image in a Rackspace cloud server. I have been searching and nothing found even in the Rackspace knowledge base. I know it is stored in the file system, but where exactly is it?

If I download my images from the server, I can save disk space, and if one day (I hope never) I really need to restore from the image, I can easily upload the image back. But this information in Rackspace is so obscure. I just do not want to open an ticket/support to ask only this question, and I hope someone else has had the same problem and help me out.

I'm using centOS 6.4, any help I will be very thankful. I mean if you guys know where in the file system the image is stored, it's all I need to know.

Cheers! ;)

devasia2112
  • 163
  • 2
  • 11
  • Given that there is a way to download images from Rackspace perhaps you could change your accepted answer? – ostergaard Dec 25 '18 at 17:01
  • @ajostergaard The time I asked this question, there were no means to do that, I even asked rackspace. Nice to know that today it's possible. For me this question is closed long ago. – devasia2112 Dec 26 '18 at 00:43
  • 1
    I understand that but couldn't you tick the other answer to help out anybody looking for this answer today? Please. – ostergaard Dec 26 '18 at 07:05

6 Answers6

5

There isn't a way to download the server images currently.

What you can do right now is create an image of your server (which gets stored in the Saved Images section), then restore the image from there. This isn't what you're asking for, but that's the limit right now.

The image storing is part of OpenStack projects called Glance and OpenStack Swift (effectively they're stored to CloudFiles). While this feature exists, it's not currently exposed/implemented by Rackspace.

Kyle Kelley
  • 236
  • 2
  • 6
  • Yes I mean server images, and you were direct to the point .. "there isn't a way to download them currently." I have created the image already and I was trying to download this image, but now I know it is not possible. Thanks for clarify the idea. – devasia2112 Dec 21 '13 at 04:33
2

Step 1, make a container named "export" under Storage > Files inside the rackspace cloud control panel.

Step 2, customize this script and run it on any unix machine OR read the docs below it to see other methods.

#!/bin/bash
sudo apt-get install python-dev gcc python-pip
sudo pip install swiftly eventlet


SWIFTLY_AUTH_URL=https://identity.api.rackspacecloud.com/v2.0

# your Rackspace cloud username
# Username used to login to control panel
SWIFTLY_AUTH_USER=myuser      
CUSTOMERID=123456798

# your Rackspace cloud API key
# Find the APIKey in the 'account settings' part of the menu of the control panel
APIKEY='fake0u23jiofds9032ijofds09823rijpo'
SWIFTLY_AUTH_KEY=$APIKEY       
# 3 char region code for where your exported image is located (e.g., ORD)
SWIFTLY_REGION=DFW        
REGION_EXPORTING_FROM=dfw
# what you want the downloaded image file to be named
LOCALFILENAME=MyDownloadedServer    
 # the container in Cloud Files containing your exported image
CONTAINER=export

# Find the image ID you'd like to make available on cloud files
# set the image id below of the image you want to copy to cloud files, see in control panel
IMAGEID=fake581e-c14561-3c46-45687-e045646675
IMAGEFILENAME=$IMAGEID    # the name of your exported image in Cloud Files

# This section simply retrieves the TOKEN
TOKEN=$(curl -s https://identity.api.rackspacecloud.com/v2.0/tokens -X POST -d '{"auth":{"RAX-KSKEY:apiKeyCredentials":{"username":"'${SWIFTLY_AUTH_USER}'","apiKey":"'${APIKEY}'"}}}' -H "Content-type: application/json" | python -c 'import json, sys; data = json.loads(sys.stdin.read()); print data["access"]["token"]["id"]')

# IMPORTANT: change receiving_swift_container to whatever $CONTAINER is
# This section requests the Glance API to copy the cloud server image uuid to a cloud files container called export
curl "https://$REGION_EXPORTING_FROM.images.api.rackspacecloud.com/v2/$CUSTOMERID/tasks" -X POST -H "X-Auth-Token: $TOKEN" -H "Content-Type: application/json" -d '{"type": "export", "input": {"image_uuid": "'"$IMAGEID"'", "receiving_swift_container": "export"}}'

# The above command simply set a pending command. Go play a game while it finishes.
sleep 4h;

swiftly   --auth-url=$SWIFTLY_AUTH_URL  --auth-user=$SWIFTLY_AUTH_USER   --auth-key=$SWIFTLY_AUTH_KEY   --region=$SWIFTLY_REGION   --verbose   get    --output=${LOCALFILENAME}  ${CONTAINER}/${IMAGEFILENAME}

For more info;

1) Exporting the image to Cloud Files

You can export the image from Rackspace to your Cloud Files containers using the API. The article below can guide you through that process.

Exporting Cloud Server Images from the Rackspace Cloud

https://community.rackspace.com/products/f/25/t/7089?_ga=1.161905660.1332227198.1487618904


There is also a tool you can use called ‘Pitchfork’. Once you log into Pitchfork using your username and API key, you would navigate to the ‘Images’ section and choose ‘Export’. Once you run that API call, some time will pass before you see the image in one or multiple Cloud Files containers.

Pitchfork: https://pitchfork.rax.io/

https://community.rackspace.com/products/f/25/t/6432?_ga=1.161936636.1332227198.1487618904

2) Downloading image from Cloud Files

You can use Swiftly to download the image from Cloud Files. An object in Cloud files cannot be greater than 5GB. If your image is greater than this, it will be divided into multiple Cloud files objects, which can be downloaded and reassembled locally using Swiftly.

https://support.rackspace.com/how-to/use-swiftly-to-download-an-exported-image/

ostergaard
  • 137
  • 2
  • 8
Jonathan
  • 252
  • 1
  • 13
1

Rackspace currently doesn't expose a feature to download your server images, but that doesn't mean you can never get one.

This is completely undocumented by Rackspace, but they have done it on request for other customers in the past:

If your server is unresponsive and you enter in a support ticket, Rackspace can usually take an emergency snapshot of your server and provide you with download links for it. For Linux instances, Rackspace will provide a gzipped raw image of your disk/partition; for Windows instances you will receive a VHD.

Michael Hampton
  • 237,123
  • 42
  • 477
  • 940
  • I try search for anything that contains -> emergency*.tar.gz.* but in my cloud server there are nothing related to this name, not even a file. I understood that these backups are stored within Cloud Files but are not kept visible to prevent any possible harm from coming to the image. Then it is not in my cloud server, it is in the hackspace environvemnt, separated from my instance, a place that nobody has access expect hackspace itself. Anyway thanks. – devasia2112 Dec 21 '13 at 14:15
0

https://support.rackspace.com/how-to/use-swiftly-to-download-an-exported-image/

Rackspace now offers this solution to download an exported image.

Tolana
  • 19
  • 1
  • 1
    While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. – Michael Hampton Dec 20 '16 at 19:37
  • This is a great link, but crucially this misses a step, which is first you must export the saved image – Jonathan Dec 16 '17 at 02:56
0

Once you've exported your image to Cloud Files (I used Pitchfork as described in another answer) it's now trivial to download it:

enter image description here

ostergaard
  • 137
  • 2
  • 8
0

Another combination is to use Pitchfork (as described in other answers) and the Cyberduck app for macOS or Windows.

Full instructions are available here: https://community.rackspace.com/general/f/general-discussion-forum/8854/how-to-export-and-download-a-saved-image-with-pitchfork-cyberduck

In summary:

1) Use Rackspace's Pitchfork tool with your username and API key to run an Export Task to move your Saved Image to a Cloud Files Container.

2) This will create a number of VHD files in your chosen Container:

  • {image_id}.vhd
  • {image_id}.vhd-00001
  • {image_id}.vhd-00002
  • ...
  • {image_id}.vhd-00121

(You can also use the Get Task Details API call to check whether the task has completed)

3) Using Cyberduck, select 'Rackspace Cloud Files (US)' (don't worry if you're not in the US region, this will still work) and authenticate with your username and API key.

4) Navigate to the container, select the {image_id}.vhd file without a numbered extension (it will show as 0B in size), and choose to Download. Cyberduck will download all the parts and build them together into a single file.

NB: Because the original file is 0B, you may receive an error when download has finished that the download is incomplete. This can be ignored.

jt_uk
  • 101
  • 1