Export and Download a Saved Image with Pitchfork and Cyberduck

Using Pitchfork and the Free Cyberduck Software to Export and Download a Saved Image

This article takes you through the process of exporting your saved image. The process involves the following steps:

  • Using the Rackspace Pitchfork tool to interface with our API
  • Using the free, easy-to-use Cyberduck® app to download the image

Note: Due to licensing restrictions by Microsoft® and Red Hat®, you cannot export Windows® and Red Hat images.

Prerequisites

You need the following tools to complete the steps in this article.

Cyberduck

Cyberduck is a tool for managing storage solutions like Rackspace Cloud Files through a simple graphical user interface (GUI). You can download Cyberduck from their website here: https://cyberduck.io/

Note: Cyberduck is not affiliated with Rackspace, and we are unable to
provide support for using this application.

API Calls

The below API calls can be used to obtain a token, export an image, and check the export's status. You'll just need to replace the following variables:

${REGION} = The region your image exists in. (dfw, hkg, iad, etc)

${USERNAME} = The user you log into your account with

${APIKEY} = Your user's API Key

${IMAGEID} = The ID of the image you want to export.

${CONTAINER} = The Cloud Files container name you want to export to.

1) Use your user and API key to obtain an auth token. This command will provide a long alpha-numeric string that is the token.

curl -s https://identity.api.rackspacecloud.com/v2.0/tokens \
  -X POST \
  -d '{"auth":{"RAX-KSKEY:apiKeyCredentials":{"username":"$USERNAME
","apiKey":"$APIKEY"}}}' \
  -H "Content-type: application/json" | grep -o '"token":{[^}]*}' | grep -o '"id":"[^"]*' | cut -d'"' -f4

2) Run the export command, replace ${AUTHTOKEN} with your token retrieved on step 1.

curl -X POST "https://${REGION}.images.api.rackspacecloud.com/v2/tasks" \
  -H "X-Auth-Token: ${AUTHTOKEN}" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "export",
    "input": {
      "image_uuid": "'"${IMAGEID}"'",
      "receiving_swift_container": "'"${CONTAINERNAME}"'"
    }
  }' | python3 -m json.tool

3) After your API command to export the image has been run, you'll receive output with information about the export task. Using the 'id' in the output, you can check it's status with the following command by replacing ${EXPORTID} with that id:

curl -H "X-Auth-Token: ${AUTHTOKEN}" \
     "https://${REGION}.images.api.rackspacecloud.com/v2/tasks/${EXPORTID}" | python3 -m json.tool

NOTE: Pitchfork is currently not available. The API commands for exporting the image will have to be run manually. These commands are provided above.

Pitchfork

Pitchfork is a Rackspace-developed tool for interfacing with various products APIs.

~~You can visit the Pitchfork tool here: ~~https://pitchfork.rax.io

Other Prerequisites

You need to have the following information ready to perform the export and download:

  • ~~The username that you use to log in to ~~https://login.rackspace.com

  • Your API Key

  • The universally unique identifier (UUID) of the image that you want to export

  • The name of the Cloud Files container to which you want to export the image

  • The region in which the image and container exist

Export and Download your Image

Use the following steps to export and download your image:

  1. ~~After you have all of the preceding information and the tools ready, go to the ~~https://pitchfork.rax.io~~ and click ~~Log In~~ at the top right. Enter your username and API key to log in.~~

  2. Click the icon for Cloud Images, then select your region from the drop-down list on the left side of the page.

  3. ~~Select ~~Export Task~~ from the list and click ~~POST. A set of blank variables displays.

  4. ~~The variable ~~task_type~~ should be set to ~~Export~~ in the drop-down, the ~~image_id~~ variable should be the UUID of the image that you are exporting, and ~~receiving_container~~ should be the name of the container to which you are exporting the image.~~

  5. ~~Click ~~SEND API CALL~~ to start the export. The ~~Response Headers~~ section displays output that contains an ~~id~~ and a long, alphanumeric value. You can use ~~id~~ and the Get Task Details Pitchfork call to check the status of your export. The response returns the following statuses:~~

    • Pending
    • Processing
    • Successful
    • Failed
  6. In your container in the Cloud Control Panel, files that are 125 MB in size eventually begin to appear. The file names follow the format uuid_of_the_image_you_exported.vhd-0001.

    After the export is complete, there might be many of these files, depending on the size of your image. There should also be a single file without the -0001 numbering at the end of the .vhd file name.

  7. After the export is complete, open Cyberduck and click Open Connection at the top left. From the drop-down list at the top of the window, select Rackspace Cloud Files (US).

  8. Enter your username and API key, leave the default values in the other fields, and click Connect. You are connected to Rackspace and see your list of Cloud Files containers.

  9. In the container to which you exported your image, find the file that ends in .vhd without the additional hyphenated numbering. The size of that file displays as 0 B. This file is the manifest file.

    Right-click the file and download it. Cyberduck actually downloads a file that is much larger than 0 B because the manifest file gathers all of the 125 MB files together back into a workable .vhd file.

  10. Cyberduck notifies you when the download is complete. You can now use the .vhd file that contains the image for your own purposes.

Note: Because Cyberduck sees the manifest file as 0 B in size, it might generate an error after it has finished downloading. However, you can go to your download location to verify that the file is there and that its size matches the total size of the individual parts.



Did this page help you?