Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Description of problem:
When a VM is migrated to a hypervisor, and later libvirtd is restarted on that hypervisor, the migrated VM will stop approximately 2 minutes later.
Version-Release number of selected component (if applicable):
qemu-kvm-0.12.1.2-2.503.el6_9.3.x86_64
libvirt-0.10.2-62.el6.x86_64
How reproducible:
100%
Steps to Reproduce:
1. Migrate VM to hypervisor
2. Restart libvirtd on hypervisor
3. Wait about 2 minutes
Actual results:
VM is stopped
Expected results:
VM continues running
Additional info:
Comment 12Michal Privoznik
2017-08-31 15:36:53 UTC
This is a very strange bug indeed. However, I suspect that libvirt is innocent here. I think that qemu process is translated into some weird state (maybe it is stuck in a system call?). Anyway, we can take libvirt out of the picture if the following succeeds:
1) service libvirt stop
2) socat unix:/var/lib/libvirt/qemu/domain-$ID-$DOMNAME/monitor.sock stdio
where $ID is the domain ID (a number), and $DOMNAME is the domain name. For instance if the domain in question was "MyDomain" and had id 4 the path would look like this:
/var/lib/libvirt/qemu/domain-4-MyDomain/monitor.sock
And when socat is run, it connects to qemu monitor and qemu should greet us with something like this:
{"QMP": {"version": {"qemu": {"micro": 94, "minor": 9, "major": 2}, "package": " (v2.10.0-rc4)"}, "capabilities": []}}
(the actual number are going to be different, but that doesn't matter now). However, if socat just hangs, just like libvirt does and the greeting message is not printed, then qemu is stuck on something. Can you please check which of the two cases you are hitting?
Comment 13Michal Privoznik
2017-08-31 15:47:39 UTC
Also, from the sosreport it looks like /var/lib/libvirt is on an NFS mount. If something happens to the mount point, a hiccup of some sort, qemu is doomed to hang since it's monitor is there. Regardless of its configuration (I can see that disks for their domains are purely local). I wonder if this is actually the case and nor libvirt nor qemu are buggy here.
regarding the NFS-Storage:
the other domains are also running from the same Filer mount and are not affecting by the restart of libvirtd. only the VMs, that are live migrated onto that host get killed.
ben
Well, having /var/lib/libvirt on a shared filesystem is not going to work with migrations. The libvirtd daemons and qemu-kvm processes on both hosts will be fighting with each other when creating or deleting files in /var/lib/libvirt. This is how migration works:
1. a domain is running on the source host, monitor socket is there and libvirt is connected to it
2. a user initiates migration to another host
3. a new qemu process is started (with virtual CPUs stopped) on the target host and creates its own monitor socket (overwriting the original one) and libvirtd connects to it
4. runtime state and memory pages are transferred from the source qemu process to the destination one (once this step finishes, the virtual CPUs on the source host are not running anymore)
5. virtual CPUs of the domain on the target host are started
6. the qemu process on the source host is killed and its monitor socket is removed (which actually removes the socket created by the destination host)
Once libvirtd on the destination host is restarted, it cannot connect to the monitor sockets of any previously migrated domains because they were all removed. Thus the domains will get killed.
BTW, similar fights may also happen with libvirt's virtual networks, dnsmasq configurations and possibly other stuff which is stored in /var/lib/libvirt. Only specific directories, such as /var/lib/libvirt/images may be shared between hosts.
That said, this is not a bug, but a configuration error. It's possible that our Virtualization Deployment Guide may need to be updated in case it is unclear or misleading.