On Tue, Nov 6, 2012 at 5:28 AM, fpemud <fpe...@gmail.com> wrote:
> sorry I don't know if it is already been asked. (where to seach?)
>
> "lxc-create -n" creates new lxc in /etc/lxc, it's ok.
>
> but "lxc-start -n" also needs the lxc in /etc/lxc, it's too restrictive.
> I want to freely put my lxc in any directory of course.
>
> is there any technical reason? or is it a missing feature?
> is there any workaround?
>
>
There is no technical reason why the LXC containers must be in the same
directory; I'm guessing it was done for simplicity. To use an LXC container
that is scattered across the filesystem, just manually specify the location
of the config file:
$ lxc-start -n c-1 -f /mnt/containers/c-1-HkwdC/config -l DEBUG -o /mnt
/containers/c-1-HkwdC/container_log
Replace my paths (/mnt/containers/c-1-HkwdC) with yours. You'll need to
make sure that your config file also has the appropriate paths for the "lxc.
rootfs" and "lxc.mount" config variables.
Since we have a large LXC deployment, we actually resorted to specifying
the entirety of a container's configuration in the command line as follows
(truncated for brevity):
/usr/bin/lxc-start -n c-1 -f /dev/null -l DEBUG -o
/mnt/containers/c-1-HkwdC/container_log
-s lxc.rootfs=/mnt/containers/c-1-HkwdC/rootfs -s lxc.network.type=veth -s
lxc.network.link=lxcbr0 -s lxc.network.flags=up -s "lxc.mount.entry=proc
proc proc nodev,noexec,nosuid 0 0" -s "lxc.mount.entry=sysfs sys
sysfsdefaults 0 0" -s
lxc.arch=amd64 ...
Best,
Ken
------------------------------------------------------------------------------
LogMeIn Central: Instant, anywhere, Remote PC access and management.
Stay in control, update software, and manage PCs from one command center
Diagnose problems and improve visibility into emerging IT issues
Automate, monitor and manage. Do more in less time with Central
http://p.sf.net/sfu/logmein12331_d2d
_______________________________________________
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users