Red Hat Bugzilla – 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
Last modified: 2016-11-03 14:31:50 EDT
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@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
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