Bug 1490826
Summary: | Cannot shallow blockcopy a vm disk backing chain to a block device (whose format=raw) | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | yisun |
Component: | libvirt | Assignee: | Peter Krempa <pkrempa> |
Status: | CLOSED ERRATA | QA Contact: | Han Han <hhan> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 7.5 | CC: | chhu, hhan, lmen, meili, pkrempa, rbalakri, xuzhang, yisun |
Target Milestone: | rc | Keywords: | Automation, Regression |
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | libvirt-3.8.0-1.el7 | Doc Type: | If docs needed, set a value |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2018-04-10 10:57:19 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
yisun
2017-09-12 10:31:47 UTC
Fixed upstream: commit 4fc305125833255de16d32289ae24902d670d166 Author: Peter Krempa <pkrempa> Date: Tue Sep 12 14:53:59 2017 +0200 qemu: blockcopy: Probe image format only with VIR_DOMAIN_BLOCK_COPY_REUSE_EXT Commit 703abf1d7 changed the logic so that we don't attempt to re-create the image if it's a block device. This was done by modifying the 'reuse' variable. Unfortunately after modifying it one of the uses was to infer whether we should probe the disk format. After changes in the commit mentioned above we would attempt the probe if the target of the copy is a block device and the format was not provided explicitly rather than using the format of the disk. Fix it by explicitly checking whether the user requested a reuse of the disk rather than the modified boolean flag. Verified on libvirt-3.9.0-1.el7.x86_64 qemu-kvm-rhev-2.10.0-4.el7.x86_64: 1. Prepare a transient VM: # virt-install --import --transient -n V-raw --disk path=/var/lib/libvirt/images/V-raw.raw,bus=virtio -r 1024 2. Create a external snapshot: # virsh snapshot-create-as V-raw s1 --no-metadata --disk-only Domain snapshot s1 created 3. Shallow blockcopy to a raw format block device: # qemu-img info /dev/rhel/raw image: /dev/rhel/raw file format: raw virtual size: 4.0G (4294967296 bytes) disk size: 0 # virsh blockcopy V-raw vda /dev/rhel/raw --blockdev --shallow --pivot Successfully pivoted 4. Check disk xml of VM # virsh dumpxml V-raw|awk '/<disk/,/<\/disk/' <disk type='block' device='disk'> <driver name='qemu' type='qcow2'/> <source dev='/dev/rhel/raw'/> <backingStore type='file' index='1'> <format type='raw'/> <source file='/var/lib/libvirt/images/V-raw.raw'/> <backingStore/> </backingStore> <target dev='vda' bus='virtio'/> <alias name='virtio-disk0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/> </disk> 5. Check block device format # qemu-img info /dev/rhel/raw image: /dev/rhel/raw file format: qcow2 virtual size: 4.0G (4294967296 bytes) disk size: 0 cluster_size: 65536 backing file: /var/lib/libvirt/images/V-raw.raw backing file format: raw Format specific information: compat: 1.1 lazy refcounts: false refcount bits: 16 corrupt: false It works as expected. Covered by tp-libvirt case: virsh.blockcopy.positive_test.non_acl.local_disk.blockdev.shallow.no_option 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-2018:0704 |