libvirt lxc can't stop all process when destroy vm.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
libvirt (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Xenial |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Environments:
System: zesty
libvirt version: 2.5.0-3ubuntu5
vm rootfs release: ubuntu:16.04
Reproduce:
1. Run command "virsh -c lxc:// start vm" and the release of vm is xenial
2. Run command "pa aux|grep init" ,you would find the pid of init launch by vm.
3. Run command "virsh -c lxc:// destroy vm".
4. Run command "virsh -c lxc:// list --all" and "ps aux|grep init" ,you could find that vm is shutoff, but the init process launch by vm is still running.
Infact I have found the case of this bug, there is a patch after 1.3.1 that import this bug.
-------
Commit: dc576025c360a1d
Parents: 511e7c5bba
Author: Daniel P. Berrange <email address hidden>
Date: 2016年1月23日 GMT+8 上午12:07:18
Commit Date: 2016年1月27日 GMT+8 上午12:11:32
lxc: don't try to hide parent cgroups inside container
-------
Cgroups inside container does't hide parent, so the process of container can change it own cgroup to another cgroup.
lxc destroy process by read cgroup tasks file,if process change it own cgroup,it can't destroy container process normally.
Changed in libvirt (Ubuntu): | |
status: | New → Confirmed |
description: | updated |
Hi yuanzhicao,
thank you for your report and your analysis to a suggested fix.
The fix you refer to was released in 1.3.2, setting later releases to fix-released.
In general Libvirt's lxc support is not of focus, I'd highly recommend using lxd for system containers which is far more stable in my experience (Setting prio low to reflect that).
I'll try to quickly come up with a ppa to test for you and get back here.