New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lxc-destroy destroys a wrong container (bug in lxc-clone) #694
Comments
For completeness sake:
and checking
it should still contain
in contrast to when the copy of the rootfs of the original container succeeds.
|
At one point this was handled right. It regressed when the unexpanded_config was introduced, because the rootfs was cleared (temporarily) in the old container's lxc_conf, not in its unexpanded config. |
Closes lxc#694 When we start cloning container c1 to c2, we first save c1's configuration in c2's as a starting point. We long ago cleared out the lxc.rootfs entry before saving it, so that if we are killed before we update the rootfs, c2's rootfs doesn't point to c1's. Because then lxc-destroy -n c2 would delete c1's rootfs. But when we introduced the unexpanded_config, we didn't update this code to clear the rootfs out of the unexpanded_config, which is what now actually gets saved in write_config(). Do so. Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com> Acked-by: Stéphane Graber <stgraber@ubuntu.com>
Closes lxc#694 When we start cloning container c1 to c2, we first save c1's configuration in c2's as a starting point. We long ago cleared out the lxc.rootfs entry before saving it, so that if we are killed before we update the rootfs, c2's rootfs doesn't point to c1's. Because then lxc-destroy -n c2 would delete c1's rootfs. But when we introduced the unexpanded_config, we didn't update this code to clear the rootfs out of the unexpanded_config, which is what now actually gets saved in write_config(). Do so. Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com> Acked-by: Stéphane Graber <stgraber@ubuntu.com>
lxc-destroy will destroy a wrong container if lxc-clone -B dir was interrupted (ctrl+c).
Mailing list report with a way to reproduce: https://lists.linuxcontainers.org/pipermail/lxc-users/2015-November/010419.html
The text was updated successfully, but these errors were encountered: