Using Dropbox for ExoGENI Images

This post describes how to create and use custom ExoGENI images stored in Dropbox.   For information about creating custom images refer to previous posts about taking snapshots of existing VMs or creating images from VirtualBox VMs.

Background:

These instructions assume you have created a working Dropbox account.

Images:

These instructions are intended to help you host your own custom ExoGENI images in your own Dropbox account.   However, for the tutorial you may find it useful to use the following image, kernel, and ramdisk that are known to work on ExoGENI.

Pushing the Images to Dropbox:

Copy the image, kernel, and ramdisk files to the public folder of your Dropbox account.   For each of the files right-click the file and choose “Copy public link…“.   Record these links for later.  These are the public html links to your files.

The links will look something like the following.  Note: 12345678 will a unique number associated with your Dropbox account.

  • Image: https://dl.dropboxusercontent.com/u/12345678/centos6.3-v1.0.11.tgz
  • Kernel: https://dl.dropboxusercontent.com/u/12345678/vmlinuz-2.6.32-431.17.1.el6.x86_64
  • Ramdisk: https://dl.dropboxusercontent.com/u/12345678/initramfs-2.6.32-431.17.1.el6.x86_64.img

If your urls do not match the previous pattern, you will likely need to move your files to the public folder.

Creating the Metadata file by hand:

Next you need to create the xml metadata file that describes the three files.   The metadata file contains the public url for each file as well and the sha1 hash for each file.

The sha1 hash can be found by typing the following on most *nix machines.

> sha1sum centos6.3-v1.0.11.tgz initramfs-2.6.32-431.17.1.el6.x86_64.img vmlinuz-2.6.32-431.17.1.el6.x86_64 
cb899c42394eecc008ada7c9b75456c7d7e1149b  centos6.3-v1.0.11.tgz
fc927a776e819b0951b5e8daf81f6991128e9abf  initramfs-2.6.32-431.17.1.el6.x86_64.img
726abdfd57dbe0ca079f3b38f8cce8b9f2323efa  vmlinuz-2.6.32-431.17.1.el6.x86_64

At this point you can create the xml metadata file to look like the following. Note: For the purposes of the tutorial we will name our metadata file centos6.3-v1.0.11.xml.

<images>
   <image>
      <type>ZFILESYSTEM</type>
      <signature>cb899c42394eecc008ada7c9b75456c7d7e1149b</signature>
      <url>https://dl.dropboxusercontent.com/u/12345678/centos6.3-v1.0.11.tgz</url>
   </image>
   <image>
      <type>KERNEL</type>
      <signature>fc927a776e819b0951b5e8daf81f6991128e9abf</signature>
      <url>https://dl.dropboxusercontent.com/u/12345678/initramfs-2.6.32-431.17.1.el6.x86_64.img</url>
   </image>
   <image>
      <type>RAMDISK</type>
      <signature>fc927a776e819b0951b5e8daf81f6991128e9abf</signature>
      <url>https://dl.dropboxusercontent.com/u/12345678/initramfs-2.6.32-431.17.1.el6.x86_64.img</url>
   </image>
</images>

Creating the Metadata file Automatically 

If you want to create the metadata file automatically you can use this script.

The script takes as parameters the three public urls to the image files.   It will then download each file, find the sha1sum, and create the metadata file.   Note: that this may take some time because the file must download the image file which could be very large.

> ./create-image-metadata.sh -z https://dl.dropboxusercontent.com/u/12345678/centos6.3-v1.0.11.tgz -r https://dl.dropboxusercontent.com/u/12345678/initramfs-2.6.32-431.17.1.el6.x86_64.img -k https://dl.dropboxusercontent.com/u/12345678/vmlinuz-2.6.32-431.17.1.el6.x86_64 -n centos6.3-v1.0.11.xml
getting https://dl.dropboxusercontent.com/u/12345678/centos6.3-v1.0.11.tgz
 % Total % Received % Xferd Average Speed Time Time Time Current
 Dload Upload Total Spent Left Speed
100 345M 100 345M 0 0 23.9M 0 0:00:14 0:00:14 --:--:-- 29.8M
getting https://dl.dropboxusercontent.com/u/12345678/vmlinuz-2.6.32-431.17.1.el6.x86_64
 % Total % Received % Xferd Average Speed Time Time Time Current
 Dload Upload Total Spent Left Speed
100 4033k 100 4033k 0 0 2628k 0 0:00:01 0:00:01 --:--:-- 3168k
getting https://dl.dropboxusercontent.com/u/12345678/initramfs-2.6.32-431.17.1.el6.x86_64.img
 % Total % Received % Xferd Average Speed Time Time Time Current
 Dload Upload Total Spent Left Speed
100 12.0M 100 12.0M 0 0 4470k 0 0:00:02 0:00:02 --:--:-- 4946k
Creating XML image descriptor file centos6.3-v1.0.11.xml
Metadata:
<images> 
 <image>
 <type>ZFILESYSTEM</type>
 <signature>cb899c42394eecc008ada7c9b75456c7d7e1149b</signature>
 <url>https://dl.dropboxusercontent.com/u/12345678/centos6.3-v1.0.11.tgz</url>
 </image>
 <image>
 <type>KERNEL</type> 
 <signature>726abdfd57dbe0ca079f3b38f8cce8b9f2323efa</signature>
 <url>https://dl.dropboxusercontent.com/u/12345678/vmlinuz-2.6.32-431.17.1.el6.x86_64</url>
 </image>
 <image>
 <type>RAMDISK</type>
 <signature>fc927a776e819b0951b5e8daf81f6991128e9abf</signature>
 <url>https://dl.dropboxusercontent.com/u/12345678/initramfs-2.6.32-431.17.1.el6.x86_64.img</url>
 </image>
</images>
XML image descriptor file SHA1 hash is: d964e8f63c8e48c419a9eb1db50fb657eb19b468
XML image descriptor file is: centos6.3-v1.0.11.xml

Push the Metadata File to Dropbox

Find the sha1 hash of the metadata file (or look at the stdout from the create-image-metadata.sh script):

> sha1sum centos6.3-v1.0.11.xml 
d964e8f63c8e48c419a9eb1db50fb657eb19b468  centos6.3-v1.0.11.xml

Copy the metadata file to the public folder of your Dropbox account.   Right-click the file to get its public Dropbox url.

Using the image

You can now use the url and hash of the metadata file in your ExoGENI requests.

Comments are closed.