[lxc-users] lxc-destroy fails somehow

Nels Nelson nels.n.nelson at gmail.com
Thu Mar 13 19:47:54 UTC 2014


On Wed, Mar 12, 2014 at 5:16 PM, Serge Hallyn <serge.hallyn at ubuntu.com>wrote:
>
> You gave lxc-start '-P /var/lib/lxc/test'.  For lxc-create, you did
> not give that option, but you gave a custom config file.


Greetings, Serge,-

My understanding is that lxc-create will initially create the container
configuration in /var/lib/lxc/test by default.  Is this not correct?  If it
is correct, then why couldn't I specify that path for the previously
created container instance when I start it using the following?

    # lxc-start -P /var/lib/lxc/test

I do re-specify the config file when using lxc-start in the original
example gist.

Perhaps I am going about this the wrong way.  Let me pose my
question in different terms.

I would like to create a lxc instance which is backed by a LVM
managed disk image no larger than 10MB.  I can do this
sort of successfully with this series of commands:

    # lxc-create -t sshd -n test -B lvm --fssize 8M -l DEBUG -o /tmp/lxc.log
    # lxc-start -n test -l DEBUG -o /tmp/lxc.log

However, this then seems to hang, and I have to terminate
the shell session, re-login, and run

    # lxc-stop -n test -k

To get rid of the test container. Furthermore, if I try to
attach to the container (prior to killing it, of course), it fails:

    # lxc-attach -n test -- echo 'hello world'
    lxc_container: failed to clone(0x8000): Invalid argument
    lxc_container: Invalid argument - failed to create subprocess
Furthermore, if I attempt to modify lxc-sshd for general use
with a meaningless daemon, the sbin/init process fails
completely:

      lxc-start 1391714723.482 NOTICE lxc_start - exec'ing '/sbin/init'
      lxc-start 1391714723.484 NOTICE lxc_start - '/sbin/init' started with
pid '15143'
      lxc-start 1391714723.484 WARN lxc_start - invalid pid for SIGCHLD
      lxc-start 1391714723.497 DEBUG lxc_start - container init process
exited
      lxc-start 1391714723.497 INFO lxc_conf - running to reset 0 nic names

Any recommendations on how to successfully start a lxc
container whose rootfs will fit onto a 10MB lvm disk image
which does nothing but run in the background and wait for
lxc-attach to invoke commands on it?

I would just use lxc-execute, but of course it doesn't support
the fssize or bdev parameters.  Nor does the container
created by

    # lxc-create -t ubuntu -n test

have a small enough footprint for my purposes.  In fact, the
only template which does seem small enough is lxc-sshd,
but it doesn't seem to work quite right.

Thanks again in advance.

-Nels
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20140313/9b746012/attachment.html>


More information about the lxc-users mailing list