[Lxc-users] lxcpath

Serge Hallyn serge.hallyn at ubuntu.com
Mon Feb 25 13:56:41 UTC 2013


Quoting Papp Tamas (tompos at martos.bme.hu):
> hi Serge and Others,
> 
> lxc version: 0.9.0.alpha3
> 
> lxcpath=/data/lxc
> 
> tank/lxc/ltest on /tank/lxc/ltest type zfs (rw,noatime)
> 
> 
> # sh -x /usr/bin/lxc-create -n ltest -t ubuntu
> + . /usr/share/lxc/lxc.functions
> + globalconf=/etc/lxc/lxc.conf
> + bindir=/usr/bin
> + templatedir=/usr/share/lxc/templates
> + lxcinitdir=/usr/lib/x86_64-linux-gnu
> + get_default_lxcpath
> + grep -v ^# /etc/lxc/lxc.conf
> + grep [ \t]*lxcpath[ \t]*=
> + awk -F= { print $2 }
> + lxc_path=/data/lxc
> + backingstore=_unset
> + fstype=ext4
> + fssize=500M
> + vgname=lxc
> + custom_rootfs=
> + [ 4 -gt 0 ]
> + opt=-n
> + shift
> + optarg_check -n ltest
> + [ -z ltest ]
> + lxc_name=ltest
> + shift
> + [ 2 -gt 0 ]
> + opt=-t
> + shift
> + optarg_check -t ubuntu
> + [ -z ubuntu ]
> + lxc_template=ubuntu
> + shift
> + [ 0 -gt 0 ]
> + wantedhelp=0
> + [ -z /data/lxc ]
> + [ ! -r /data/lxc ]
> + [ -z ltest ]
> + [ -z  ]
> + lvname=ltest
> + id -u
> + [ 0 != 0 ]
> + [ -n  ]
> + :
> + [ -d /data/lxc/ltest ]
> + basename /usr/bin/lxc-create
> + echo lxc-create: 'ltest' already exists
> lxc-create: 'ltest' already exists
> + exit 1
> 
> 
> 
> So a new container cannot be created, because the directory already exists, as it's on an own
> filesystem.

Yes lxcpath does not address the case of wanting to import an existing
rootfs.  Only the case of wanting to keep the rootfs on a different
partition.  But you can now keep the container config in
/data/lxc/ltest/config instead of under /var/lib/lxc/ltest, which
might keep things (like where the fstab should be) less confused.

-serge




More information about the lxc-users mailing list