Bug 1279248 - Restarting libvirtd powers off VMs started outside oVirt
Restarting libvirtd powers off VMs started outside oVirt
Product: vdsm
Classification: oVirt
Component: Core (Show other bugs)
All Linux
unspecified Severity urgent (vote)
: ---
: ---
Assigned To: Dan Kenigsberg
Aharon Canan
Depends On:
  Show dependency treegraph
Reported: 2015-11-08 15:50 EST by Christopher Pereira
Modified: 2015-11-08 16:21 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2015-11-08 16:21:29 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Christopher Pereira 2015-11-08 15:50:46 EST
== Problem Description ==

Restarting vdsmd or libvirtd powers off VMs started outside oVirt.

QEMU logs show:

	qemu: terminating on signal 15 from pid 22346 (libvirtd)
	2015-11-04 16:07:30.121+0000: shutting down

== How reproducible ==

1) Start a VM via virsh
2) Restart vdsmd or libvirtd

== Expected results ==

VMs started outside oVirt shouldn't be powered off

== Additional info ==

VMs started inside oVirt are not powered off.
We had to start some VM outside oVirt (virsh start) because of issue #1240649.
We cannot stop those VMs because they are in production and there is currently no way to live import the VMs back into oVirt.
There are some situations were vdsmd and libvirtd are restarted (e.g. due to sanlock renewal errors) which is ok as long as external VMs are not powered off.

== Question ==

Is there any workaround to prevent oVirt shutting down this unregistered external VMs?
Comment 1 Christopher Pereira 2015-11-08 16:21:29 EST
According to http://wiki.libvirt.org/page/FAQ:

Q: Will restarting the libvirt daemon stop my virtual machines?
A: NO, as of version 0.6.0 (Jan 2009). Versions older than this will kill VMs if the libvirtd daemon is stopped, so beware.

I did some more debugging and found out that the VMs are powered off because of the virtio-serial channel entries that were left off from the original oVirt XML dumps:

    <channel type='unix'>
      <source mode='bind' path='/var/lib/libvirt/qemu/channels/0082f61b-fc41-40fe-a254-4868ad928853.com.redhat.rhevm.vdsm'/>
      <target type='virtio' name='com.redhat.rhevm.vdsm'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    <channel type='unix'>
      <source mode='bind' path='/var/lib/libvirt/qemu/channels/0082f61b-fc41-40fe-a254-4868ad928853.org.qemu.guest_agent.0'/>
      <target type='virtio' name='org.qemu.guest_agent.0'/>
      <address type='virtio-serial' controller='0' bus='0' port='2'/>

After removing this entries, libvirtd is not killing the VMs anymore.

Note You need to log in before you can comment on or make changes to this bug.