Bug 1451394

Summary: Can't use device name as 'top' device while merging active layer
Product: Red Hat Enterprise Linux 7 Reporter: Denis Chaplygin <dchaplyg>
Component: libvirtAssignee: Peter Krempa <pkrempa>
Status: CLOSED ERRATA QA Contact: Han Han <hhan>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.3CC: dyuan, lmen, pkrempa, rbalakri, xuzhang
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libvirt-3.2.0-6.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-02 00:08:25 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:
Embargoed:

Description Denis Chaplygin 2017-05-16 14:45:01 UTC
I have VM with storage, that contains several snapshots and i would like to merge active layer with first snapshot, using blockcommit function and refering to the layers using indices. Unfortunately i can't refer to the active layer as 'vda' (diskname) and have to pass empty value, so active layer is choosen by default




Version-Release number of selected component (if applicable):
Name        : libvirt
Arch        : x86_64
Version     : 2.0.0
Release     : 10.el7


How reproducible:
Always

Steps to Reproduce:
1. Create a VM and make several snapshots of it's storage.
2. virsh blockcommit vm sda --top sda --base "sda[1]" --active

Actual results:
invalid argument: could not find image 'sda'

Expected results:
Layers should be merged.

Comment 2 Peter Krempa 2017-05-17 15:43:10 UTC
Fixed upstream:

commit ed61e0b368859b25beb5259f84edd4910cd5218f
Author: Peter Krempa <pkrempa>
Date:   Wed May 17 17:16:15 2017 +0200

    qemu: driver: Allow passing disk target as top image with block commit
    
    Since we allow active layer block commit the users are allowed to commit
    the top of the chain (e.g. vda) into the backing image. The API would
    not accept that parameter, as it tried to look up the image in the
    backing chain.
    
    Add the ability to use the top level image target name explicitly as the
    top image of the block commit operation.

Comment 5 Han Han 2017-06-13 01:25:30 UTC
Verify it on libvirt-3.2.0-9.el7.x86_64:
1. Prepare a running VM:
# virsh list
 Id    Name                           State
----------------------------------------------------
 3     test                           running

2. Create external snapshots:
# virsh snapshot-create test --no-metadata --disk-only                                   
Domain snapshot 1497317009 created
# virsh snapshot-create test --no-metadata --disk-only
Domain snapshot 1497317011 created
# virsh snapshot-create test --no-metadata --disk-only
Domain snapshot 1497317013 created

3. Blockcommit with vda as top layer:
# virsh blockcommit test vda --top vda --base  "vda[2]" --active --verbose --wait --pivot
Block commit: [100 %]
Successfully pivoted

# virsh blockcommit test vda 100M "vda[1]" vda --verbose --wait --pivot                  
Block commit: [100 %]
Successfully pivoted

All works as expected.

Comment 6 errata-xmlrpc 2017-08-02 00:08:25 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://access.redhat.com/errata/RHEA-2017:1846

Comment 7 errata-xmlrpc 2017-08-02 01:32:35 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://access.redhat.com/errata/RHEA-2017:1846