[Lxc-users] Sharing container rootfs

Serge Hallyn serge.hallyn at ubuntu.com
Mon Jun 10 03:55:04 UTC 2013


Quoting Purcareata Bogdan-B43198 (B43198 at freescale.com):
> Hello,
> 
> I have a question regarding containers and their supporting rootfs. Is there an option for lxc-create that will use a default path (or other backing store) as rootfs?
> 
> I understand that by specifying -B ... it will try to _create_ the rootfs in an alternate place. In my scenario, I plan to configure the rootfs externally - there will be a single host rootfs image which will be bind-mounted --make-slave for several containers. I just want to know if there is an option for lxc-create that will skip creating the rootfs and just use one as is. I didn't see any such option for lxc-clone either.
> 
> Assuming there isn't such an option, my setup has the following steps:
> - create a container with default options
> - delete the ${rootfs}/
> - update the config file to point to the new rootfs path - which I configured with bind-mounts
> 
> Does this look ok for my scenario? Is this the right setup?

I think you're better off creating a new template which skips the steps
for setting up rootfs.  Otherwise that's a huge waste of time and I/O.

Or you can create it entirely in the script, just having your script
create the config file.

-serge




More information about the lxc-users mailing list