Allow creation of container root filesystem in a user defined location
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lxc (Ubuntu) |
Fix Released
|
Low
|
Unassigned |
Bug Description
With the backing store 'none' the container root filesystem will be a directory under /var/lib/
It'd be nice to be able to store the root filesystem in a user defined location and per container. Setting rootfs in lxc.conf doesn't work with lxc-create.
The use case is systems with multiple drives dedicated to specific activities (fast storage, high capacity, ...)
ProblemType: Bug
DistroRelease: Ubuntu 12.10
Package: lxc 0.8.0~rc1-4ubuntu17
ProcVersionSign
Uname: Linux 3.5.0-2-generic x86_64
ApportVersion: 2.2.5-0ubuntu1
Architecture: amd64
Date: Fri Jun 29 21:51:51 2012
ProcEnviron:
TERM=xterm
PATH=(custom, user)
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: lxc
UpgradeStatus: Upgraded to quantal on 2012-01-31 (149 days ago)
Thanks for the feature suggestion. That would indeed be useful. If I understand you correctly, the configuration file would still be under /var/lib/ lxc/<container> , but only the rootfs would be moved?
Note that you can currently achieve this in a few ways.
You can use lvm backing stores with volume groups on several different drives.
You can also create the container as usual,
lxc-create -t ubuntu -n p1
move the rootfs
mv /var/lib/ lxc/p1/ rootfs /mnt/
and then edit /var/lib/ lxc/p1/ config to set
lxc.rootfs = /mnt/rootfs
However, adding support for something like '-B dir --dir /mnt/rootfs' to lxc-create would be doable and avoid the need for hand-editing the container.