Publishing and snapshoting Virtual Machine Images

57 views
Skip to first unread message

Kenneth Nagin

unread,
Jun 22, 2011, 3:29:07 AM6/22/11
to jclouds
I want to publish a new Virtual Machine Image (VMI) that I created
locally using jcloud. I then want to reference the image to
instantiate new nodes.

I also want to install new application packages on a running node and
then create a snapshot of the image from which I can create other
running nodes.

The jcloud examples that I found use existing images to instantiate
running nodes so what I want to do is slightly different..

Could someone provide some sample code to do these two task?

Best Regards,

Kenneth Nagin

Andrew Phillips

unread,
Jun 22, 2011, 10:27:24 AM6/22/11
to jcl...@googlegroups.com
Hi Kenneth

> I want to publish a new Virtual Machine Image (VMI) that I created
> locally using jcloud. I then want to reference the image to
> instantiate new nodes.
>
> I also want to install new application packages on a running node and
> then create a snapshot of the image from which I can create other
> running nodes.

I may be missing something obvious here, but...which provider are you
using? ;-)

Thanks!

ap

Kenneth Nagin

unread,
Jun 23, 2011, 12:55:45 AM6/23/11
to jclouds
I am using Amazon.

Andrew Phillips

unread,
Jun 23, 2011, 7:00:12 PM6/23/11
to jcl...@googlegroups.com
> I am using Amazon.

Ah, thanks. When you talk about "snapshots" I assume you mean
snapshots of an EBS volume [1], rather than the image itself? You
should be able to do that using the services provided by the
ElasticBlockStoreAsyncClient [2], from where you can also attach the
volume to a specific instance.

The EC2TemplateOptions [3] also allow you to map EBS snapshots to
devices, amongst others. A usage sample would look like [4]

template.getOptions().as(EC2TemplateOptions.class).mapEBSSnapshotToDeviceName(deviceName, snapshotId, sizeInGib,
deleteOnTermination)

Hope this helps!

ap

[1]
http://docs.amazonwebservices.com/AWSEC2/latest/CommandLineReference/ApiReference-cmd-CreateSnapshot.html
[2]
https://github.com/jclouds/jclouds/blob/master/apis/ec2/src/main/java/org/jclouds/ec2/services/ElasticBlockStoreAsyncClient.java
[3]
https://github.com/jclouds/jclouds/blob/master/apis/ec2/src/main/java/org/jclouds/ec2/compute/options/EC2TemplateOptions.java
[4] http://code.google.com/p/jclouds/wiki/EC2#Default_image

> --
> You received this message because you are subscribed to the Google
> Groups "jclouds" group.
> To post to this group, send email to jcl...@googlegroups.com.
> To unsubscribe from this group, send email to
> jclouds+u...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/jclouds?hl=en.
>
>

--
Andrew Phillips
qrmedia

Unless expressly stated otherwise, this message is confidential.
Access to this e-mail by anyone else is unauthorised. If you are
not an addressee, any disclosure or copying of the contents of
this e-mail or any action taken (or not taken) in reliance on it
is unauthorised and may be unlawful. If you are not an addressee,
please inform the sender immediately.

This message is confidential and may not be redistributed or
broadcast in whole or part in any form, including but not limited
to any form of internet transmission including email, usenet,
newsgroups, www, irc, icq, etc.
All liability for errors and viruses is disclaimed.

Kenneth Nagin

unread,
Jun 26, 2011, 3:23:19 AM6/26/11
to jclouds
Thanks for your response, but I still have more questions.

I think I am not explaining myself properly. My objective is to be
able to publish virtual machine images.
Publishing a virtual machine image means uploading the image to the
cloud provider and registering it
so that other users can create nodes from the image.
I want to be able to create the virtual machine images from scratch
using tools like vmbuilder or
customize running instances, i.e. nodes, and then publish them.

I think I am looking for the jcloud equivalent to EC2's
ec2-bundle-image
ec2-bundle-vol
ec2-upload-bundle
ec2-register

But since the primary reason that I want use jcloud is for portability
I would like a generic interface that would allow me to do the above,
but be able to publish virtual machine images to other cloud
providers, e.g. rackspace.

thanks in advance

Kenneth Nagin



On Jun 24, 2:00 am, Andrew Phillips <aphill...@qrmedia.com> wrote:
> > I am using Amazon.
>
> Ah, thanks. When you talk about "snapshots" I assume you mean  
> snapshots of an EBS volume [1], rather than the image itself? You  
> should be able to do that using the services provided by the  
> ElasticBlockStoreAsyncClient [2], from where you can also attach the  
> volume to a specific instance.
>
> The EC2TemplateOptions [3] also allow you to map EBS snapshots to  
> devices, amongst others. A usage sample would look like [4]
>
> template.getOptions().as(EC2TemplateOptions.class).mapEBSSnapshotToDeviceName(deviceName, snapshotId, sizeInGib,  
> deleteOnTermination)
>
> Hope this helps!
>
> ap
>
> [1]  http://docs.amazonwebservices.com/AWSEC2/latest/CommandLineReference/...
> [2]  https://github.com/jclouds/jclouds/blob/master/apis/ec2/src/main/java...
> [3]  https://github.com/jclouds/jclouds/blob/master/apis/ec2/src/main/java...

Eugen Paraschiv

unread,
Jun 26, 2011, 4:15:53 AM6/26/11
to jcl...@googlegroups.com
I would also be interested in this exact functionality, as for now I had to do the upload of the VM image by hand.
Thanks.
Eugen.

Adrian Cole

unread,
Jun 28, 2011, 4:17:58 AM6/28/11
to jclouds, jclou...@googlegroups.com
Hi, guys.

This is a pretty common request, and we have an old issue on this.
Please add comments relating to which providers and overview
functionality you'd like to see, even better if some context for what
you're interested in the feature for.

http://code.google.com/p/jclouds/issues/detail?id=155

Regardless, it will probably be a good idea to move this thread to
jclouds-dev, as this isn't a current feature. If you are interested
in collaborating, let's pick-up there!

-Adrian

Naveen Doraiswamy

unread,
Oct 11, 2012, 2:34:00 PM10/11/12
to jclou...@googlegroups.com, jclouds
Hi,
 
Is there any plan for releasing jcloud APIs for the following EC2 functionality:
 
> > ec2-bundle-image
> > ec2-bundle-vol
> > ec2-upload-bundle
> > ec2-register
 
In addition, to the above, how about an API for ec2-import-instance?
 
Thanks,
-Naveen
Reply all
Reply to author
Forward
0 new messages