Bug 1121932 - Improve handling of external snapshots where live-merge is not supported
Summary: Improve handling of external snapshots where live-merge is not supported
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.5
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: rc
: ---
Assignee: Eric Blake
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-07-22 07:36 UTC by Xu Jin Long
Modified: 2018-12-09 18:12 UTC (History)
18 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-03-04 16:05:12 UTC


Attachments (Terms of Use)

Description Xu Jin Long 2014-07-22 07:36:43 UTC
Description of problem:

The user creates an external snapshot and can't emerge the snapshots.

Version-Release number of selected component (if applicable):
qemu-kvm-0.12.1.2-2.415.el6.x86_64

How reproducible:
100%

Steps to Reproduce:


1. The user creates a external snapshot.

# virsh snapshot-create-as --domain test test-snap1 --disk-only --diskspec vda,snapshot=external,file=/var/lib/libvirt/images/test-snap1 --atomic


2. Then the user emerges the external snapshots.

# virsh blockcommit --domain test vda --base ./test --top ./test-snap1 --wait --verbose


Actual results:


When the target VM is running, the command's output is as follow:

error: unsupported configuration: online commit not supported with this QEMU binary

When the target VM is shut off, the command's output is as follow:

error: Requested operation is not valid: domain is not running

Expected results:

The external snapshots were emerged successfully.  

Additional info:

Comment 3 Ademar Reis 2014-07-23 14:02:10 UTC
The behavior is expected: live-snapshot merge is a RHEV-only feature, so the error "unsupported configuration: online commit not supported with this QEMU binary" is correct.

The other error, about the VM not being online, is also correct if you consider this is a live-merge.

I see potential for improvement in the second case because virsh could recommend or even fallback to qemu-img commit when in offline mode, but I'm not familiar with the libvirt/virsh commands, so I'll leave this up to libvirt guys to respond.

Comment 4 Peter Krempa 2014-07-23 14:34:32 UTC
(In reply to Ademar Reis from comment #3)

> I see potential for improvement in the second case because virsh could
> recommend or even fallback to qemu-img commit when in offline mode, but I'm
> not familiar with the libvirt/virsh commands, so I'll leave this up to
> libvirt guys to respond.

That would be more of a feature request as that stuff currently isn't implemented upstream. It is possible to implement the feature for offline VM's with qemu-img as you pointed out, but we'd need to do that upstream first.

Regarding the original report, the messages are correct, so there's no bug in that regard, more just a feature request for implementing support for inactive domain block commit.

Comment 5 Jiri Denemark 2014-07-24 20:32:32 UTC
As explained in comments 3 and 4, the error messages are expected. Should we take this BZ as a feature request for implementing for offline merging of external snapshots?

Comment 7 Hao.Xiaolong 2014-08-18 09:20:45 UTC
jinxu@redhat.com already left redhat, I will continue monitor this bug, and take this BZ as a new feature request is good idea. If we could do like this, please go ahead and remove the need info flag for jinxu@redhat.com

Comment 11 Eric Blake 2015-01-20 15:42:18 UTC
There is a workaround of manually using 'qemu-img commit' and then 'virsh edit' to update libvirt's understanding of the domain to use the merged image file.  But properly supporting offline merge is not implemented upstream yet, and may not be a trivial feature to add into libvirt.  In fact, for upstream, libvirt would probably rather use 'qemu -M none' and use qemu's monitor to do a live merge than figure out how to wrap 'qemu-img commit', because with qemu, libvirt can reconnect to the process if libvirtd is restarted in the middle, while qemu-img cannot be reconnected.  But if that is what upstream implements, it won't help the situation when qemu refuses to do live merge.


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