Bug 1279248 - Restarting libvirtd powers off VMs started outside oVirt
Summary: Restarting libvirtd powers off VMs started outside oVirt
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: vdsm
Classification: oVirt
Component: Core
Version: 4.17.11
Hardware: All
OS: Linux
unspecified
urgent
Target Milestone: ---
: ---
Assignee: Dan Kenigsberg
QA Contact: Aharon Canan
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-11-08 20:50 UTC by Christopher Pereira
Modified: 2015-11-08 21:21 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2015-11-08 21:21:29 UTC
oVirt Team: ---
Embargoed:


Attachments (Terms of Use)

Description Christopher Pereira 2015-11-08 20:50:46 UTC
== 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 21:21:29 UTC
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>
    <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'/>
    </channel>

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.