Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
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:
Fixed upstream:
commit b60af444ccc7ae2655af6753d62c7ee611a628b8
Author: Peter Krempa <pkrempa>
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
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'
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
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: