Comment 3 for bug 1483987

Revision history for this message
Ian Booth (wallyworld) wrote : Re: [LXC caching] deletion of images does not work

The feature was added for MAAS deployments where different machines are involved.
Consider the case where machine 1 starts and then a container is added. The image is downloaded from cloud-images. Then machine 2 is added. Again for a second time, the image has to be downloaded all over again from cloud-images. This was causing MAAS demos at ODS and elsewhere to take 10s of minutes to start up. By having each machine go via the Juju state server, and the state server caching the image, it means that for a given MAAS environment, the hit in going to the internet to get the image only occurs once, not for every new MAAS node added to the environment.

The environment cache set up by Juju is a blobstore in the mongo instance used by the state server.

Juju actually does use the host cache. Well, not Juju directly but the lxc scripts. The lxc scripts will first look at the host cache and if there's an image there, use that. Otherwise the lxc scripts will pull the image from a URL using wget. In this case, the default URL is overridden by Juju to point to the state server to allow a transparent cache to be used.

Juju's use of a state server cache ensures that an image is only downloaded once. Without this feature, every single new node that is acquired would result in a new internet download.

It works as expected in HA. The mongo database is replicated.

There's a little extra detail in the 1.22 release notes https://launchpad.net/juju-core/+milestone/1.22.0

This feature is a stop gap measure until LXD comes along with effectively baked in images out of the box.