Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1283085 - Creating external disk snapshot for a guest which has two disks with the same prefix name,the disks become the same name in xml
Creating external disk snapshot for a guest which has two disks with the same...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt (Show other bugs)
7.2
Unspecified Unspecified
medium Severity unspecified
: rc
: ---
Assigned To: Peter Krempa
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-11-18 03:30 EST by lijuan men
Modified: 2016-11-03 14:31 EDT (History)
6 users (show)

See Also:
Fixed In Version: libvirt-1.3.2-1.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-11-03 14:31:50 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2016:2577 normal SHIPPED_LIVE Moderate: libvirt security, bug fix, and enhancement update 2016-11-03 08:07:06 EDT

  None (edit)
Description lijuan men 2015-11-18 03:30:06 EST
Description of problem:
Creating external disk snapshot for a guest which has two disks with the same prefix name,the disks become the same name in xml

Version-Release number of selected component (if applicable):
libvirt-1.2.17-13.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1)prepare a guest having two disk,which have the same prefix name
[root@localhost ~]# virsh domblklist fs
Target     Source
------------------------------------------------
hda        /mnt/fs/f.qcow2
vda        /mnt/fs/f.qcow2-bak


2)create external disk snapshot
[root@localhost ~]# virsh snapshot-create-as fs test --disk-only
Domain snapshot test created

3)look at the xml file
[root@localhost ~]# virsh dumpxml fs | grep disk -A 10
    <suspend-to-disk enabled='no'/>
  </pm>
  <devices>
    <emulator>/usr/libexec/qemu-kvm</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/mnt/fs/f.test'/>
      <backingStore type='file' index='1'>
        <format type='raw'/>
       ***   <source file='/mnt/fs/f.qcow2-bak'/> ***
        <backingStore/>
      </backingStore>
      <target dev='hda' bus='ide'/>
      <alias name='ide0-0-0'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/mnt/fs/f.test'/>
      <backingStore type='file' index='1'>
        <format type='raw'/>
     ***     <source file='/mnt/fs/f.qcow2-bak'/> ***
        <backingStore/>
      </backingStore>
      <target dev='vda' bus='virtio'/>
      <alias name='virtio-disk0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
    </disk>

Actual results:
The names of the two disks become the same in the xml file.


Expected results:


Additional info:
Comment 2 Peter Krempa 2016-02-11 09:41:04 EST
Fixed upstream:

commit b60af444ccc7ae2655af6753d62c7ee611a628b8
Author: Peter Krempa <pkrempa@redhat.com>
Date:   Thu Feb 11 09:57:45 2016 +0100

    conf: snapshot: Avoid autogenerating duplicate snapshot names
    
    The snapshot name generator truncates the original file name after a '.'
    and replaces the suffix with the snapshot name. If two disks source
    images differ only in the suffix portion, the generated name will be
    duplicate.
    
    Since this is a corner case just error out stating that a duplicate name
    was generated. The user can work around this situation by providing
    the file names explicitly.
    
    Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1283085

v1.3.1-217-gb60af44
Comment 4 Han Han 2016-04-21 03:49:14 EDT
I can reproduce it on libvirt-1.3.1-1.el7.x86_64.
Verify it on libvirt-1.3.3-2.el7.x86_64 :
1. Prepare a VM with two disks of the same prefix:
# virsh domblklist dup
Target     Source
------------------------------------------------
vda        /var/lib/libvirt/images/dup.qcow2
vdb        /var/lib/libvirt/images/dup.qcow2-bak

Create external snapshot:
# virsh snapshot-create-as dup s1 --disk-only
error: unsupported configuration: cannot generate external snapshot name for disk 'vdb': collision with disk 'vda'
Comment 6 errata-xmlrpc 2016-11-03 14:31:50 EDT
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/RHSA-2016-2577.html

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