Bug 1718727
| Summary: | Committing changes to the backing file over NBD fails with reopening files not supported | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux Advanced Virtualization | Reporter: | Tingting Mao <timao> |
| Component: | qemu-kvm | Assignee: | Maxim Levitsky <mlevitsk> |
| Status: | CLOSED ERRATA | QA Contact: | Tingting Mao <timao> |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | 8.0 | CC: | aliang, coli, jinzhao, juzhang, ngu, qzhang, timao, virt-maint, zhenyzha |
| Target Milestone: | rc | Flags: | pm-rhel:
mirror+
|
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | qemu-kvm-4.1.0-18.module+el8.1.1+5150+45ce6c40 | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2020-02-04 18:28:48 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: | |||
Patch posted upstream https://lists.gnu.org/archive/html/qemu-block/2019-09/msg01448.html Also note that bugs 1465320 and 1713647, and maybe more are duplicate of this. Verified this bug as below.
Tested with:
qemu-kvm-4.1.0-18.module+el8.1.1+5150+45ce6c40
kernel-4.18.0-147.0.3.el8_1
Steps:
1. Export a image with OS already via qemu-nbd.
# qemu-nbd -f raw base.img -p 9000 -t
2.Create snapshot based on the image.
# qemu-img create -f qcow2 -b nbd:localhost:9000 sn.qcow2
3. Check snapshot info.
# qemu-img info sn.qcow2
image: sn.qcow2
file format: qcow2
virtual size: 20 GiB (21474836480 bytes)
disk size: 196 KiB
cluster_size: 65536
backing file: nbd:localhost:9000
Format specific information:
compat: 1.1
lazy refcounts: false
refcount bits: 16
corrupt: false
4. Boot guest from the snapshot file.
# /usr/libexec/qemu-kvm \
-name 'guest-rhel7.7' \
-machine q35 \
-nodefaults \
-vga qxl \
-object secret,id=sec0,data=base \
-device pcie-root-port,port=0x10,chassis=1,id=pci.1,bus=pcie.0,multifunction=on,addr=0x2 \
-device pcie-root-port,port=0x11,chassis=2,id=pci.2,bus=pcie.0,addr=0x2.0x1 \
-device pcie-root-port,port=0x12,chassis=3,id=pcx.3,bus=pcie.0,addr=0x2.0x2 \
-device pcie-root-port,port=0x13,chassis=4,id=pci.4,bus=pcie.0,addr=0x2.0x3 \
-device pcie-root-port,port=0x14,chassis=5,id=pci.5,bus=pcie.0,addr=0x2.0x4 \
-device pcie-root-port,port=0x15,chassis=6,id=pci.6,bus=pcie.0,addr=0x2.0x5 \
-device pcie-root-port,port=0x16,chassis=7,id=pci.7,bus=pcie.0,addr=0x2.0x6 \
-device pcie-root-port,port=0x17,chassis=8,id=pci.8,bus=pcie.0,addr=0x2.0x7 \
-blockdev driver=file,cache.direct=off,cache.no-flush=off,node-name=my_file1,filename=sn.qcow2\
-blockdev driver=qcow2,file=my_file1,node-name=my \
-device virtio-blk-pci,id=virtio_blk_pci1,drive=my,bus=pcx.3,addr=0x0 \
-vnc :1 \
-m 8192 \
-smp 4 \
-netdev tap,id=hostnet0,vhost=on \
-device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:56:00:00:00:07,bus=pci.5,addr=0x0 \
-chardev socket,id=qmp_id_qmpmonitor1,path=/home/qmp-sock2,server,nowait \
-mon chardev=qmp_id_qmpmonitor1,mode=control \
-boot order=cdn,once=c,menu=off,strict=off \
-enable-kvm \
-monitor stdio
5. Write a tmp file in the guest.
(guest)# dd if=/dev/urandom of=fsn bs=1M count=1024.
6. Shutdown the guest, and commit the snapshot file.
# qemu-img commit -f qcow2 sn.qcow2 -p
(100.00/100%)
Image committed.
7. Boot from the base image over nbd.
# /usr/libexec/qemu-kvm \
-name 'guest-rhel7.7' \
-machine q35 \
-nodefaults \
-vga qxl \
-object secret,id=sec0,data=base \
-device pcie-root-port,port=0x10,chassis=1,id=pci.1,bus=pcie.0,multifunction=on,addr=0x2 \
-device pcie-root-port,port=0x11,chassis=2,id=pci.2,bus=pcie.0,addr=0x2.0x1 \
-device pcie-root-port,port=0x12,chassis=3,id=pcx.3,bus=pcie.0,addr=0x2.0x2 \
-device pcie-root-port,port=0x13,chassis=4,id=pci.4,bus=pcie.0,addr=0x2.0x3 \
-device pcie-root-port,port=0x14,chassis=5,id=pci.5,bus=pcie.0,addr=0x2.0x4 \
-device pcie-root-port,port=0x15,chassis=6,id=pci.6,bus=pcie.0,addr=0x2.0x5 \
-device pcie-root-port,port=0x16,chassis=7,id=pci.7,bus=pcie.0,addr=0x2.0x6 \
-device pcie-root-port,port=0x17,chassis=8,id=pci.8,bus=pcie.0,addr=0x2.0x7 \
-blockdev driver=nbd,cache.direct=off,cache.no-flush=off,node-name=my_file1,server.host=localhost,server.port=9000,server.type=inet \
-blockdev driver=raw,file=my_file1,node-name=my \
-device virtio-blk-pci,id=virtio_blk_pci1,drive=my,bus=pcx.3,addr=0x0 \
-vnc :1 \
-m 8192 \
-smp 4 \
-netdev tap,id=hostnet0,vhost=on \
-device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:56:00:00:00:07,bus=pci.5,addr=0x0 \
-chardev socket,id=qmp_id_qmpmonitor1,path=/home/qmp-sock2,server,nowait \
-mon chardev=qmp_id_qmpmonitor1,mode=control \
-boot order=cdn,once=c,menu=off,strict=off \
-enable-kvm \
-monitor stdio
Result:
As above. After step6, commit successfully. And after step7, there is the tmp file created in step5.
Plus, tried to commit changes in the snapshot file to a specific image in the backing-chain, it works well, too.
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/RHBA-2020:0404 |
Description of problem: Committing changes to the backing file over NBD fails with reopening files not supported. Version-Release number of selected component (if applicable): qemu-kvm-4.0.0-3.module+el8.1.0+3265+26c4ed71 kernel-4.18.0-95.el8 How reproducible: 100% Steps to Reproduce: 1. Create base image and export it by NBD # qemu-img create -f raw test.img 2G # qemu-nbd -f raw -p 9000 -t test.img --shared=2 2. Create snapshot file based on it # qemu-img create -f qcow2 -b nbd:localhost:9000 sn.qcow2 # qemu-img info sn.qcow2 image: sn.qcow2 file format: qcow2 virtual size: 2.0G (2147483648 bytes) disk size: 196K cluster_size: 65536 backing file: nbd:localhost:9000 Format specific information: compat: 1.1 lazy refcounts: false refcount bits: 16 corrupt: false 3. Write new data to the snapshot file # qemu-io -c 'write -P 1 0 1G' sn.qcow2 wrote 1073741824/1073741824 bytes at offset 0 1 GiB, 1 ops; 0:00:06.33 (161.573 MiB/sec and 0.1578 ops/sec) 4. Commit the changes # qemu-img commit -f qcow2 sn.qcow2 -p (0.00/100%) qemu-img: Block format 'nbd' used by node '#block238' does not support reopening files Actual results: Commit failed with above error. Expected results: Commit successfully. Additional info: