[lxc-users] [BUG] lxc-destroy destroying wrong containers

Christian Brauner christian.brauner at mailbox.org
Tue Nov 10 11:29:12 UTC 2015


On Tue, 10 Nov 2015 14:19:41 +0900, Tomasz Chmielewski <mangoo at wpkg.org>:
> lxc-destroy may be destroying wrong containers!
> 
> To reproduce:
> 
> 1) have a container you want to clone - here, testvm012d:
> 
> # lxc-ls -f
> NAME                                        STATE    IPV4
> IPV6  GROUPS  AUTOSTART
> ---------------------------------------------------------------------------------------------------
> testvm012d                                  STOPPED  -
> -     -       NO
> 
> 
> 2) clone it - but before the command returns, press ctrl+c (say, you
> realized you used a wrong name and want to interrupt):
> 
> # lxc-clone -B dir testvm012d testvm13d
> [ctrl+c]
> 
> 
> 3) lxc-ls will now show two containers:
> 
> # lxc-ls -f
> NAME                                        STATE    IPV4
> IPV6  GROUPS  AUTOSTART
> ---------------------------------------------------------------------------------------------------
> testvm012d                                  STOPPED  -
> -     -       NO
> testvm13d                                   STOPPED  -
> -     -       NO
> 
> 
> 4) we can see that the "interrupted" container was not fully copied - let's
> remove it then with lxc-destroy:
> 
> # du -sh testvm012d testvm13d
> 462M    testvm012d
> 11M     testvm13d
> 
> # lxc-destroy -n testvm13d
> 
> # echo $?
> 0
> 
> 
> 5) as expected, lxc-ls only lists the original container now:
> 
> # lxc-ls -f
> NAME                                        STATE    IPV4
> IPV6  GROUPS  AUTOSTART
> ---------------------------------------------------------------------------------------------------
> testvm012d                                  STOPPED  -
> -     -       NO
> 
> 
> 6) unfortunately rootfs for the original container is gone:
> 
> # du -sh testvm012d
> 4.0K    testvm012d
> 
> # ls testvm012d/
> config
This may not have something to do with lxc-destroy but with how clones work. Can
you only proceed up to step 2) you listed:

        > 2) clone it - but before the command returns, press ctrl+c (say, you
        > realized you used a wrong name and want to interrupt):
        > 
        > # lxc-clone -B dir testvm012d testvm13d
        > [ctrl+c]

and immediately afterwards check whether the rootfs of the original container
testvm012d is still present?

Christian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20151110/311da756/attachment.sig>


More information about the lxc-users mailing list