Bug 1149667

Summary: libvirt misreport live snapshot capability
Product: Red Hat Enterprise Linux 6 Reporter: Francesco Romani <fromani>
Component: libvirtAssignee: Ján Tomko <jtomko>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 6.6CC: amureini, dyuan, ecohen, fdeutsch, fromani, iheim, jdenemar, jherrman, jkurik, jsuchane, jtomko, knoel, leiwang, lpeer, lsurette, mavital, michal.skrivanek, mjenner, mtessun, mzhan, nobody, nsednev, pablo.iranzo, rbalakri, Rhev-m-bugs, scohen, shyu, s.kieske, tdosek, tnisan, wshi, ycui, yeylon
Target Milestone: rcKeywords: ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: libvirt-0.10.2-47.el6 Doc Type: Bug Fix
Doc Text:
In Red Hat Enterprise Linux 6.6, support was added for libvirt to report whether QEMU is capable of creating snapshots. However, libvirt did not probe for the snapshot capability properly. As a consequence, the snapshot capability of KVM Guest Image in VDSM was reported as unavailable even when it was available, and creating a disk snapshot in some cases failed. With this update, libvirt no longer reports QEMU snapshot capability, and therefore does not cause the described problem.
Story Points: ---
Clone Of: 1149460
: 1150609 (view as bug list) Environment:
Last Closed: 2015-07-22 05:47:44 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 1149460, 1150428, 1150609    

Description Francesco Romani 2014-10-06 12:36:16 UTC
+++ This bug was initially created as a clone of Bug #1149460 +++

Description of problem:
rhel-guest-image-7.0-20140930.0.el7 snapshot fails while running over couple of RHEL6.6.

Version-Release number of selected component (if applicable):
libvirt-client-0.10.2-46.el6.x86_64
libvirt-0.10.2-46.el6.x86_64
libvirt-python-0.10.2-46.el6.x86_64
libvirt-lock-sanlock-0.10.2-46.el6.x86_64
qemu-kvm-rhev-0.12.1.2-2.448.el6.x86_64
vdsm-4.16.5-2.el6ev.x86_64
sanlock-2.8-1.el6.x86_64


How reproducible:
100%

Steps to Reproduce:
1.First of all you have to disable selinux on both your RHEL6.6 hosts with setenforce 0.
2.Now try executing live snapshot from running guest-image VM on some RHEL6.6 host.
3.Snapshhot, fails...

Actual results:
PSA (please see attachments).

Expected results:
Snapshot should pass.

Additional info:
logs attached.

--- Additional comment from Francesco Romani on 2014-10-06 05:31:09 EDT ---


I checked locally on the box (in read only mode, so no harm is possible).

VDSM indeed reports that live snapshot is not supported. This causes the engine to prohibit the operation as shown. This is expected and the wanted behaviour.

# vdsClient -s 0 getVdsCaps | grep -i snapshot
	liveSnapshot = 'false'

However, VDSM is acting as middleman here. Let's check what libvirt reports:

# virsh -r capabilities | grep -i snapshot
      <disksnapshot default='off' toggle='no'/>
      <disksnapshot default='off' toggle='no'/>

And this is the reason why it fails.
Now, that's either libvirt or qemu issue.

--- Additional comment from Francesco Romani on 2014-10-06 05:38:12 EDT ---

Seems libvirt issue.

Still on the affected box:

# telnet localhost 4444
Trying ::1...
Connected to localhost.
Escape character is '^]'.
{"QMP": {"version": {"qemu": {"micro": 1, "minor": 12, "major": 0}, "package": "(qemu-kvm-rhev-0.12.1.2-2.448.el6)"}, "capabilities": []}}
{ "execute": "qmp_capabilities" }
{"return": {}}
{ "execute": "query-commands" }
{"return": [{"name": "quit"}, {"name": "eject"}, {"name": "__com.redhat_drive_del"}, {"name": "change"}, {"name": "screendump"}, {"name": "__com.redhat_qxl_screendump"}, {"name": "stop"}, {"name": "cont"}, {"name": "system_wakeup"}, {"name": "system_reset"}, {"name": "system_powerdown"}, {"name": "device_add"}, {"name": "device_del"}, {"name": "cpu"}, {"name": "memsave"}, {"name": "pmemsave"}, {"name": "inject-nmi"}, {"name": "migrate"}, {"name": "migrate_cancel"}, {"name": "migrate_set_speed"}, {"name": "client_migrate_info"}, {"name": "dump-guest-memory"}, {"name": "query-dump-guest-memory-capability"}, {"name": "migrate_set_downtime"}, {"name": "block_resize"}, {"name": "netdev_add"}, {"name": "netdev_del"}, {"name": "transaction"}, {"name": "blockdev-snapshot-sync"}, {"name": "__com.redhat_drive-mirror"}, {"name": "__com.redhat_drive-reopen"}, {"name": "balloon"}, {"name": "set_link"}, {"name": "getfd"}, {"name": "closefd"}, {"name": "block_passwd"}, {"name": "block_set_io_throttle"}, {"name": "set_password"}, {"name": "expire_password"}, {"name": "__com.redhat_set_password"}, {"name": "__com.redhat_spice_migrate_info"}, {"name": "qmp_capabilities"}, {"name": "human-monitor-command"}, {"name": "__com.redhat_drive_add"}, {"name": "block-stream"}, {"name": "__com.redhat_block-commit"}, {"name": "block-job-set-speed"}, {"name": "block-job-cancel"}, {"name": "chardev-add"}, {"name": "chardev-remove"}, {"name": "query-events"}, {"name": "query-pci"}, {"name": "query-version"}, {"name": "query-commands"}, {"name": "query-chardev"}, {"name": "query-block"}, {"name": "query-blockstats"}, {"name": "query-cpus"}, {"name": "query-kvm"}, {"name": "query-status"}, {"name": "query-mice"}, {"name": "query-vnc"}, {"name": "query-spice"}, {"name": "query-name"}, {"name": "query-uuid"}, {"name": "query-migrate"}, {"name": "query-balloon"}, {"name": "query-block-jobs"}]}

"blockdev-snapshot-sync" command is reported, thus the disk snapshot should be advertised as supported.

Comment 6 Ján Tomko 2014-10-07 14:59:28 UTC
As Peter Krempa found out, this was caused by an incomplete backport for bug 1081032. The disksnapshot capability was only reported if the "blockdev-snapshot-sync" QMP commands was found, however in RHEL-6 we only probe for QMP commands on domain startup.

Comment 8 Ján Tomko 2014-10-07 15:10:54 UTC
With qemu-kvm-rhev, virsh capabilities should report:
<disksnapshot default='on' toggle='no'/>
but not with qemu-kvm:
<disksnapshot default='off' toggle='no'/>

Comment 17 Shanzhi Yu 2014-12-17 08:27:14 UTC
Reproduce this with libvirt-0.10.2-46.el6.x86_64, verify with libvirt-0.10.2-47.el6.x86_64

1. with qemu-kvm-rhev + libvirt-0.10.2-46.el6.x86_64

1.1.# rpm -q libvirt qemu-kvm-rhev
libvirt-0.10.2-46.el6.x86_64
qemu-kvm-rhev-0.12.1.2-2.448.el6.x86_64

1.2
# virsh  -r capabilities |grep -i  snapshot
      <disksnapshot default='off' toggle='no'/>
      <disksnapshot default='off' toggle='no'/>

2. with qemu-kvm + libvirt-0.10.2-46.el6.x86_64

2.1# rpm -q libvirt qemu-kvm
libvirt-0.10.2-46.el6.x86_64
qemu-kvm-0.12.1.2-2.448.el6_6.x86_64
2.2
# virsh  -r capabilities |grep -i  snapshot
      <disksnapshot default='off' toggle='no'/>
      <disksnapshot default='off' toggle='no'/>


3. with qemu-kvm-rhev + libvirt-0.10.2-47.el6.x86_64

3.1# rpm -q libvirt qemu-kvm-rhev
libvirt-0.10.2-47.el6.x86_64
qemu-kvm-rhev-0.12.1.2-2.448.el6.x86_64

3.2
# virsh  -r capabilities |grep -i  snapshot

4. with qemu-kvm + libvirt-0.10.2-47.el6.x86_64

4.1# rpm -q libvirt qemu-kvm-rhev
libvirt-0.10.2-47.el6.x86_64
qemu-kvm-rhev-0.12.1.2-2.448.el6.x86_64


4.2
# virsh  -r capabilities |grep -i  snapshot

Comment 19 errata-xmlrpc 2015-07-22 05:47:44 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-1252.html