Support use of cloud-images mirror for container images

Bug #1357045 reported by David Britton
40
This bug affects 5 people
Affects Status Importance Assigned to Milestone
juju-core
Fix Released
Medium
Tim Penhey
1.25
Fix Released
Medium
Tim Penhey

Bug Description

Add an option to Juju that ends up setting $UBUNTU_CLOUDIMG_QUERY_BASEURL such that LXC container images are queried and retrieved from the mirror specified instead of cloud-images.ubuntu.com. This will allow the use of a local mirror to speed up demos and facilitate private/controlled clouds.

See the comments on this ticket for more details and background.

Revision history for this message
Curtis Hovey (sinzui) wrote :

Can maas serve the images from a url? image-metadata-url can be set to pull the images from anywhere. I guess the issue is that maas doesn't have stream data, so the images are not usable.I don't think simple streams data can point to images on a different server.

Changed in juju-core:
status: New → Incomplete
Revision history for this message
Blake Rouse (blake-rouse) wrote :

If this is the same image that MAAS uses for the root-image, it is exposed over HTTP on the cluster.

Note: this is on the cluster not on the region, so you would need to identify the cluster address.

http://cluster-name/MAAS/static/images/ubuntu/amd64/generic/trusty/release/root-image

Revision history for this message
Kapil Thangavelu (hazmat) wrote :

its a separate use case then standard image stream, lxc containers (non local) don't pull from image streams, we want to set an env var so that they do pull from the maas server.

Changed in juju-core:
status: Incomplete → Confirmed
Curtis Hovey (sinzui)
Changed in juju-core:
status: Confirmed → Triaged
importance: Undecided → Medium
tags: added: maas-provider
Revision history for this message
Nicolas Thomas (thomnico) wrote :

Did some digging into this..

juju use ubuntu-cloudimg-query

A simple "export UBUNTU_CLOUDIMG_QUERY_BASEURL" of the image-metadata config parameter will solve the issue and more imprtantly allow a consistent deployment of the same images if containers or not..

Cheers,

Revision history for this message
Nicolas Thomas (thomnico) wrote :

A workaround is available here :

 https://github.com/juju/juju/pull/2645

Changed in juju-core:
milestone: none → 1.25-beta2
Changed in juju-core:
status: Triaged → Won't Fix
status: Won't Fix → In Progress
assignee: nobody → Menno Smits (menno.smits)
Revision history for this message
Menno Finlay-Smits (menno.smits) wrote :

I've been looking at this today and there are some significant challenges. The solution proposed can't work without changes to MAAS. Here's the biggest problems:

1. The images that are served by a MAAS cluster (e.g.
http://cluster-name/MAAS/static/images/ubuntu/amd64/generic/trusty/release/root-tgz) are in a different format to what is served by cloud-images.ubuntu.com). The MAAS images are a root filesystem tarball whereas the cloud-images files are tarballs containing the kernel files and a loopback root filesystem.

2. ubuntu-cloudimg-query expects to find a metadata file (e.g. https://cloud-images.ubuntu.com/query/released.latest.txt) which it parses in order to locate the available images. If UBUNTU_CLOUDIMG_QUERY_BASEURL is set, it must refer to a location that contains a suitable metadata file. As far as I can see MAAS doesn't serve up such a file.

I'm going to email some key MAAS and Juju people to see if we can come up with a workable solution.

I don't see this being practically solved in time for 1.25 so I'm going to move it to the 1.26 milestone.

Changed in juju-core:
milestone: 1.25-beta2 → 1.26.0
Revision history for this message
Menno Finlay-Smits (menno.smits) wrote :

I've been talking to various MAAS folks and Ben Howard about this. Using the images cached by MAAS is a non-starter. The images are in the wrong format and have been customised to suit bare metal deployments. They are not suitable for use with containers.

It is my understanding that you'd like this feature to help speed up product demos (and perhaps also to make private clouds easier?). If this is the case, then I propose the following:

1. We change Juju to accept a new configuration option which ultimately ends up setting UBUNTU_CLOUDIMG_QUERY_BASEURL. This will make a Juju environment look at a mirror of cloud-images.ubuntu.com instead of the real one. This is possibly something which can be achieved for the final 1.25 release.

2. Create a tool which produces a local mirror of cloud-images.ubuntu.com which Juju can be pointed at. Ideally this would create a selective mirror, including just the releases and architectures relevant to the environment. Such a tool might already exist.

Does that sound reasonable?

Revision history for this message
Nicolas Thomas (thomnico) wrote :

Hello Menno,

IMHO it is reasonable and sensible.

Short term:
 (point release of 1.24 ?? ) being able to point to a managed mirror of images should be straight forward and the pull request in this thread proves it work and worth it :). The download is performed by the state server AFAIK and environment parameters are not propagated ... that hackery help me in the context of orangebox but this is not the real issue.

The request is to be able to USE a managed/control mirror not to manage it (that is landscape or other tool job). Out of the demo context ALL large corp will mandate to use only bits from sources they control .. some of them provide internet (hence can no count on it if something goes south)..

Longer term / real fix:
 From what I understand users can configure juju to use their own sstream for all images except LXC. Ideally we should build the lxc template from the same sstream juju use for metal/kvm etc... for consistency. The "issue" is not specific to MAAS IMHO. Should talk to LXC/LXD folks to have their view..

hope this helps,

Changed in juju-core:
status: In Progress → Triaged
summary: - juju-core/maas/lxc: pull cloud-image from maas server
+ Support use of cloud-images mirror for LXC images
description: updated
summary: - Support use of cloud-images mirror for LXC images
+ Support use of cloud-images mirror for container images
Revision history for this message
David Britton (dpb) wrote :

@thomnico -- thanks and agreed with the proposed solution, couldn't have said it any better.

Tim Penhey (thumper)
Changed in juju-core:
assignee: Menno Smits (menno.smits) → Tim Penhey (thumper)
Tim Penhey (thumper)
Changed in juju-core:
status: Triaged → In Progress
Tim Penhey (thumper)
Changed in juju-core:
status: In Progress → Fix Committed
milestone: 1.26.0 → 1.26-alpha1
Curtis Hovey (sinzui)
Changed in juju-core:
status: Fix Committed → Fix Released
Revision history for this message
mahmoh (mahmoh) wrote :

@Mennu: could you please confirm the new configuration option name and format, and also confirm that this has been tested and works in 1.25 with LXC? Thank you.

Revision history for this message
mahmoh (mahmoh) wrote :

@Menno rather.

Revision history for this message
Nicolas Thomas (thomnico) wrote :

Tim we tried setting :
export JUJU_LXC_IMAGES_URL=http://myserver/

Then juju bootstrap..

Even if parameter set to obvious non working url we can still deploy lxc coming from https://cloud-images.ubuntu.com/

Thoughts ?

Revision history for this message
Cheryl Jennings (cherylj) wrote :

thomnico - you can specify the base URL for ubuntu-cloudimg-query by using the config value "cloudimg-base-url" in your environments.yaml (or set it through set-env)

Looks like this was never documented. I'll create a docs bug for this.

Revision history for this message
Cheryl Jennings (cherylj) wrote :
Revision history for this message
mahmoh (mahmoh) wrote :

^Awesome, that's what I was looking for, will verify if Nicolas doesn't beat me to it, and report back.

Revision history for this message
Nicolas Thomas (thomnico) wrote : Re: [Bug 1357045] Re: Support use of cloud-images mirror for container images

Thanks a lot !!

I missed that config part in the pull req I was reading .. it WORKS !!!

This is making a HUGE difference thanks Tim and Cheryl ..

On Tue, Dec 8, 2015 at 7:58 PM, M.Morana <email address hidden> wrote:
> ^Awesome, that's what I was looking for, will verify if Nicolas doesn't
> beat me to it, and report back.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1357045
>
> Title:
> Support use of cloud-images mirror for container images
>
> Status in juju-core:
> Fix Released
> Status in juju-core 1.25 series:
> Fix Released
>
> Bug description:
> Add an option to Juju that ends up setting
> $UBUNTU_CLOUDIMG_QUERY_BASEURL such that LXC container images are
> queried and retrieved from the mirror specified instead of cloud-
> images.ubuntu.com. This will allow the use of a local mirror to speed
> up demos and facilitate private/controlled clouds.
>
> See the comments on this ticket for more details and background.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/juju-core/+bug/1357045/+subscriptions

--
Best Regards,
       Nicolas Thomas
http://insights.ubuntu.com/?p=889
EMEA Solution Architect Canonical
GPG FPR: D592 4185 F099 9031 6590 6292 492F C740 F03A 7EB9

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.