Default-Image-Id

Ian Booth ian.booth at canonical.com
Mon Apr 22 02:59:31 UTC 2013


Hi Anirup

On 22/04/13 09:33, anirup dutta wrote:
> Hello Everyone,
> 
> I am new to Juju and I am trying to learn it. I want to use my own ami
> while launching in ec2. The environments file had a option for using
> default-image-id but it has been deprecated and works only with the legacy
> deployments. It mentions in the documentation that we can use constraints
> to do so but I couldn't find a proper documentation to do that.
> 
> This is the different things that I tried :
> 
> juju bootstrap --constraints "image-id: ami-xxxxxxxx"
> juju bootstrap --constraints "default-image-id: ami-xxxxxxxx"
> juju bootstrap --constraints "ami-image-id: ami-xxxxxxxx"
> 
> I get an error like this
> 
> ERROR Could not interpret 'ami-image-id:' constraint: need more than 1
> value to unpack
> 
> It would be great if someone can help me with this.
> 

Constraints are used not to specify an image id to use, but rather to specify
the type of instance to run based on user specified virtual machine parameters
like amount of RAM, number of CPU cores etc. So you say something like:

juju bootstrap --constraints "mem=4G cpu-cores=4"

in order to run up a machine with 4GB of RAM and 4 cores. juju will look at the
available EC2 instance types (m1.small. m1.medium etc) and pick the best one to
use based on the supplied constraints and your region.

In terms of picking an image to run, for EC2, juju looks at the cloud guest
images availability data on http://cloud-images.ubuntu.com/ (see
https://help.ubuntu.com/community/UEC/Images for some details) to determine the
correct ami image id to use based on your configured Ubuntu series. The
out-of-the-box behaviour is to use a "precise" image matching your chosen arch
but you can also set an environment attribute "default-series" to boostrap a
different image eg "raring". When charms are deployed, I *think* the series is
read from the charm URL (if specified therein), and it falls back to the
bootstrap node's series otherwise (someone will correct me if I am wrong I'm sure).

There is some code landing soon which will allow EC2 and Openstack providers to
fallback to a user specified default-image-id and default-instance-type but the
current behaviour is that this will only happen if juju is unable to find
matching instance type and image as described above.

I hope this helps answer your question.



More information about the Juju mailing list