[libvirt-users] libvirt 5.0.0 - LXC container still in "virsh list" output after shutdown

mxs kolo kolomaxes at gmail.com
Tue Jan 22 18:29:04 UTC 2019


> Centos 7.6 with libvirt build from base "virt" repository:
> libvirt-daemon-driver-lxc-5.0.0-1.el7.x86_64
> libvirt-client-5.0.0-1.el7.x86_64
> libvirt-daemon-5.0.0-1.el7.x86_64
> libvirt-daemon-driver-network-5.0.0-1.el7.x86_64
> libvirt-libs-5.0.0-1.el7.x86_64
> +
> systemd-219-62.el7_6.2.x86_64
>
> Now lxc containers with  type='direct' can be started,  but can't be stopped
Additional info.
When shutdown LZXC container with --mode signal, nothing happened on
virsh console LXC_NAME
If use --mode initctl, container powering off:
...
[  OK  ] Removed slice User and Session Slice.
[  OK  ] Stopped target Remote File Systems.
[  OK  ] Stopped Load/Save Random Seed.
[  OK  ] Stopped Update UTMP about System Boot/Shutdown.
[  OK  ] Stopped Create Volatile Files and Directories.
[  OK  ] Stopped target Local File Systems.
         Unmounting /proc/sys/net/ipv4...
[  OK  ] Stopped target Local File Systems (Pre).
         Unmounting /proc/sys/net/ipv6...
         Unmounting /dev/tty1...
         Unmounting /proc/meminfo...
         Unmounting /dev/ptmx...
[  OK  ] Stopped Configure read-only root support.
[  OK  ] Stopped Remount Root and Kernel File Systems.
[  OK  ] Reached target Shutdown.
[  OK  ] Reached target Final Step.
         Starting Power-Off...
and virsh console disconnected.
But as reported before, virsh list show container in status running.
Interesting, that in test python script for such stucked container we
get error on call domain.info():
(Pdb)  self.state_id, self.maxmem, self.mem, self.cpus, self.cput =
self.domain.info()
*** libvirtError: operation failed: Cannot read cputime for domain

where self.domain is correct domain pointer:
(Pdb) self.domain.__dict__
{'_conn': <libvirt.virConnect object at 0x7ff95f881550>, '_o':
<capsule object "virDomainPtr" at 0x7ff95f8cca80>}

Compare with case just after libvirtd restart and domain stopped:
(Pdb) self.domain.info()
[5, 2097152L, 2097152L, 2, 0L]

Problem reproduced on 2 nodes for lxc. Qemu container on same nodes
shutdown correct.
b.r.
 Maxim Kozin




More information about the libvirt-users mailing list