Description of problem:
The user creates an external snapshot and can't emerge the snapshots.
Version-Release number of selected component (if applicable):
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
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
The external snapshots were emerged successfully.
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.
(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.
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?
firstname.lastname@example.org 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 email@example.com
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.