2

Is it possible to locally create a single AMI file of say Debian Jessie and use it directly (or with little changes) on any AMI-compatible cloud service providers (eg. AWS, CloudStack, Digital Ocean or Rackspace)?

CDuv
  • 240
  • 1
  • 3
  • 12

2 Answers2

2

AMIs are somewhat unique in that the kernel is separate from the image. It depends on the provider and whether they support the upload of AMI-style images.

The Rackspace Public Cloud supports upload of images in VHD format, while Rackspace Private Clouds support the use of AMIs.

As of October 2013 Digital Ocean did not support image uploads.

CloudStack isn't the same thing as a Rackspace Public Cloud, EC2, or Digital Ocean, which are hosted offerings built on one cloud stack or another. CloudStack is an open source cloud stack, similar to OpenStack. OpenStack and CloudStack both support AMI images.

If you want maximum portability between clouds it's probably worth looking at those you'd like to use and figure out which image format (AMI, VHD, QCOW2, etc) is best supported among them.

phoebus
  • 8,370
  • 1
  • 31
  • 29
  • Let's say all the providers I aim to use supports AMI: can a _base_ AMI file can be created once and kernel-related adaptations be done afterward? Every tutorial I've found about manual AMI creation uses cloud provider API at some point. As if _offline creation_ wasn't possible. – CDuv Jun 22 '14 at 21:50
  • You can use the hypervisor system of your choice to create a base image of a running VM, or use a bare metal system, then use the `ec2-bundle-image` and `ec2-bundle-vol` utils for AMI creation (you may need to do an intermediate conversion step, e.g. VMDK to RAW format, if using another image format). http://www.idevelopment.info/data/AWS/AWS_Tips/AWS_Management/AWS_10.shtml – phoebus Jun 22 '14 at 23:19
  • I'm guessing ec2-bundle-image and ec2-bundle-vol works on AWS only but there are equivalent for other providers? – CDuv Jun 26 '14 at 00:04
  • Actually the EC2 AMI tools can be downloaded and run locally as described in my last link; here's more info: https://aws.amazon.com/developertools/Amazon-EC2/368. You can use those tools to create an AMI regardless of where you plan on putting it. Or were you asking if other providers have tools for other image formats? – phoebus Jun 26 '14 at 03:40
  • No, I was looking for a tool that can run locally and create an AMI file that can afterwards be put where I want: which the EC2 AMI tools seems to do: thanks :) (The only -minimal- downside is that I need a AWS account). – CDuv Jun 26 '14 at 08:43
2

Phoebus' answer covers the question as such (+1). Another option would be to slightly alter your approach and use Packer instead, which is a tool for creating identical machine images for multiple platforms from a single source configuration:

Packer is easy to use and automates the creation of any type of machine image. It embraces modern configuration management by encouraging you to use automated scripts to install and configure the software within your Packer-made images. [...]

It currently supports Builders for all your specified targets except CloudStack. Initial support for a Cloudstack builder is already available, but not yet merged for organizational reasons apparently. If you do not want to wait for this to happen, you can integrate it via Custom Builders yourself in the meantime.

Steffen Opel
  • 5,560
  • 35
  • 55
  • +1 for an interesting link! – phoebus Jun 24 '14 at 03:19
  • Actually I am presently testing Packer: this is why I'm having theses (newbie) questions :) There is a cloud provider I'm looking at which is not supported by Packer (even if it's supported by the Apache Libcloud). BTW, Packer is not really creating identical machines images since each Builders has it's own different start base (an AMI for AWS, a template for Docker, a .vbox for VirtualBox, etc.) but the rest of the process (provision) is greatly done on each provided image. – CDuv Jun 26 '14 at 00:01