Corporate Home Open Source Home
Syndicate content
Eucalyptus

Image Management

In order to use run instances from images that you have created (or downloaded), you need to bundle the images with your cloud credentials, upload them and register them with the cloud. Following examples show how you would perform the necessary steps.

Bundling images

The examples here assume that you have sourced the eucarc config file obtained when you downloaded user credentials.

"euca-bundle-image" can be used to bundle an image for use with Eucalyptus or Amazon. A bundled image consists of a manifest file and several image parts.

For instance, to bundle an image "image.img" for user id "123456789111" in the directory "image-dir"

euca-bundle-image -i image.img -u 12345678111 -d image-dir

OR, if you wish to specify credentials separately ("cert-xyz.pem" and "pk-xyz.pem" are the user certificate and private key PEM files, respectively).

euca-bundle-image -i image.img -u 123456789111 -d image-dir -c cert-xyz.pem -k pk-xyz.pem

To bundle an image for use with Amazon, make sure you locate the Amazon ec2 cert file that is provided as part of the EC2 AMI tools. This file is generally located in $EC2_AMITOOL_HOME/etc/ec2/amitools/cert-ec2.pem

euca-bundle-image -i image.img -u 123456789111 -d image-dir -c cert-abc.pem -k pk-abc.pem --ec2cert $EC2_AMITOOL_HOME/etc/ec2/amitools/cert-ec2.pem

Make sure that the "cert-abc.pem" and "pk-abc.pem" files in the above example are your Amazon credentials (not your Eucalyptus credentials).

For more options, type,

euca-bundle-image --help

or refer to the manpage for "euca-bundle-image."

Uploading an image

To upload an image bundled with "euca-bundle-image" you can use "euca-upload-bundle."

For example, to upload the bundle corresponding to the manifest "image.img.manifest.xml" to the bucket "image-bucket," you would run the following command,

euca-upload-bundle -b image-bucket -m image.img.manifest.xml

For more options, type

euca-upload-bundle --help

or refer to the manpage for "euca-upload-bundle."

Registering an image

Bundle images that have been uploaded to the cloud need to be registered with the cloud prior to running instances.

For instance, to register a bundled image referenced by the manifest file "image.img.manifest.xml" that has been uploaded to the bucket "image-bucket" type the following command,

euca-register image-bucket/image.img.manifest.xml

For more options, refer to the manpage for "euca-register" or type,

euca-register --help

Downloading an image

Bundled images that have been uploaded may also be downloaded or deleted from the cloud.

For instance, to download the image(s) that have been uploaded to the bucket "image-bucket" you may use the following command,

euca-download-bundle -b image-bucket

For more options, type,

euca-download-bundle --help

Deleting a bundled image

To delete a bundled image, use "euca-delete-bundle."

For instance, to delete the images in bucket "image-bucket" you can use the following command,

euca-delete-bundle -b image-bucket

You can specify a manifest using the "-m" or "--manifest" argument if you wish to delete a specific bundle.

To delete the bucket after deleting the bundled image,

euca-delete-bundle -b image-bucket --clear

A bucket can only be deleted when it is empty.

For more options, type,

euca-delete-bundle --help

Unbundling an image

To unbundle a previously bundled image, use "euca-unbundle"

For instance, to unbundle the bundled image referenced by the manifest "image.img.manifest.xml" to the directory image-dir, use the following command,

euca-unbundle -m image.img.manifest.xml -d image-dir

For more options, try,

euca-unbundle --help