incubator-deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michal Fojtik <>
Subject Re: Create images from running or stopped EBS instances (EC2)
Date Mon, 07 Feb 2011 12:28:50 GMT
On 04/02/11 16:40 -0800, David Lutterkort wrote:
>On Thu, 2011-02-03 at 15:17 +0100, Michal Fojtik wrote:
>> On 03/02/11 14:57 +0200, wrote:
>> >Hey Michal,
>> >
>> >here's a copy/paste from the notes I made about snapshots back in
>> >July - might be useful to have this in one place/save some time
>> >looking at the APIs (AWS, Rackspace, Rimu, Gogrid, Terremark):
>> Thanks Marios! This seems to be very usefull and save me a lot of time
>> googling and reading all those docs.
>> After brief look, I have few suggestions for API:
>> >
>> ><PAST> :
>> >
>> >
>> >Q. Which of our currently supported clouds allows 'register custom
>> >Image from cloud storage', or, 'save/snapshot an Instance as a new
>> >Image'
>> >-----------------------------------------------------------------
>> >--i--> Amazon AWS allows you to register an object in S3 as an Image
>> >in EC2 [4] (Rackspace 'coming soon' [5])
>> >
>> >    ** The process of 'save this Instance as an Image in S3' is
>> >termed 'bundling'
>> >    ** PROBLEM: different procedure for Windose vs Linux images [6].
>> >	-- For Windows you use the AWS REST API 'BundleInstance' call where
>> >you specify the S3 bucket to upload to (amongst other things).
>> We need to add a <os>Linux|Windows</os> field to instance XML
>> and then decide which method we will choose when creating image.
>> The bucket thing for Windows could be solved by feature param.
>I agree that we should expose the OS in instance details; but for image
>creation, I think we should only allow creating Linux images via
>POST /api/images
>The creation of Windows images follows a completely different model -
>not only do you have to specify a S3 bucket, but AWS also exposes bundle
>tasks via DescribeBundleTasks and CancelBundleTask. It seems to me that
>that is best expressed by a separate top-level collection 'bundle_tasks'

Yes, you're right. Also BundleInstance needs two additional parameters to
complete: UploadPolicy and UploadPolicySignature, which we doesn't have
in API AFAIK. (Marios: It's possible to obtain those two using storage API?)

The call, according to documentation itself looks like:


Our calls, when using /api/images collection should looks like:

POST /api/images ?instance_id=i-1234

And for Windows:
POST /api/images ?instance_id=i-1234&bucket_id=images-bucket

(hopefully informations like UploadPolicy could be returned from Bucket)

FYI: I added task for exposing instance OS type into Teambox.

>> >	-- For Linux you must install the 'AMI Tools' command-line utilities
>> >[7] on the Instance you wish to bundle and then 'ec2-bundle-image'.
>> >Confusingly the actual upload is done with 'ec2-upload-bundle' which
>> >takes the S3 bucket name as a parameter.
>> For EBS you just need instance_id and name and there is CreateImage call.
>We also have the difficulty that there's currently no way to tell
>whether an instance uses EBS or instance store for its root disk; IOW,
>you can't tell from looking at an instance if 'create image' on it could
>possibly succeed.

In DescribeImages there is: <rootDeviceType>ebs</rootDeviceType> element.
Maybe we can advertise this information in our XML as well, like:

   <os type="linux" root="ebs" />

Unfortunately, according to my quick look to API docs there is no support for
this in GoGrid (like you can't retrieve information about OS from instance here)
which sux. For this case we can expose OS type as 'unknown'.

>> >-iii-> Gogrid allows you to save a 'MyGSI - Gogrid Server Image' from
>> >your own, preconfigured 'sandbox server'
>> As I said, we will need to add new feature for GoGrid (something like
>> 'sandbox') when launching an Instance and some HTTP proper response from
>> POST /api/images when Instance is not in sandbox.
>Since for both GoGrid and EC2, instances need to fulfill specific
>criteria to be snapshottable, wouldn't it be better to make image
>creation for them an action on the instance ? That way, we get to worry
>about under which circumstances you could possibly perform the action.

That could work too but I'm not entirely sure if this is the correct 'REST'
approach here. Like we have 'images' collection and RESTish should be to
create images on top of this collection.

>What I have in mind is that we offer an instance action
>        <actions>
>          <link href="http://localhost:3001/api/instances/i-31f16e5d/create_image"
method="post" rel="create_image"/>
>        </actions>
>In addition, we need to
>      * expose whether an image is ebs/instance store for EC2
>      * allow creation of sandbox instances for GoGrid (can any image be
>        sandboxed or only specific images ?)

Well seems like no, not all images are sandboxable according to this

Currently figuring out if we can query their API to get information if
given image is 'sandboxable' or not (I need to check this with support).

FYI: I added task into Teambox for support sandbox instances.

   -- Michal

Michal Fojtik,
Deltacloud API:

View raw message