[lxc-devel] [PATCH v2] Add Oracle Linux template

Serge Hallyn serge.hallyn at canonical.com
Tue Oct 2 14:16:22 UTC 2012


Quoting Dwight Engen (dwight.engen at oracle.com):
> On Mon, 1 Oct 2012 12:27:16 -0500
> Serge Hallyn <serge.hallyn at canonical.com> wrote:
> 
> > Quoting Dwight Engen (dwight.engen at oracle.com):
> > > 
> > > This is a new template to create containers based on an Oracle Linux
> > > rootfs image. The path to the rootfs must be given to the template,
> > > and if it resides on a btrfs will be snapshoted rather than copied.
> > > 
> > > Signed-off-by: Dwight Engen <dwight.engen at oracle.com>
> > 
> > Hi,
> > 
> > maybe it's in here and I'm missing it, but where is the
> > $template_rootfs to come from?  Is there a repository online where
> > they can be fetched? If so, can auto-wget'ing be added to the
> > template?
> > 
> > -serge
> 
> $template_rootfs is a required template argument, so you have to give
> -- -t /path/to/templaterootfs to lxc-create. The idea is that you have a
> rootfs already created/extracted into a btrfs subvolume that then gets
> snapshoted into the container instance each time you do an lxc-create.
> I think this is similar to the ubuntu-cloud template, but the

The ubuntu-cloud template takes that as an optional argument, and will
automatically wget the tarball if it doesn't exist.  That's what I was
suggesting that you do.

And to be clear I'm not saying inclusion of the template upstream ought
to block on that.

> template doesn't do the fetching and setup of the template rootfs.
> 
> I can look into setting up the template rootfs from rpms, or an image
> if that is required, but I think its useful also for the template
> rootfs to be user specifiable as well.

Agreed, I have no objection to the option.

> How do you handle for example if
> you want one template rootfs to be a webserver, and another one for a
> database? Do you intend for that to be done post lxc-create with some
> configuration management (ala puppet) tool? It seems like this would
> work, but would make bigger differences per container instance to the
> template, so if you plan to instantiate many container instances it
> could add up.

(Not saying you should go this route, but) the way I address this is
to create canonical containers (lvm-based though btrfs-based works too)
and then lxc-clone them.

Thanks for the template.

-serge




More information about the lxc-devel mailing list