Description: [incremental_backup] cannot do FULL backup for a READONLY disk Versions: libvirt-6.0.0-20.module+el8.2.1+6621+ddee07d5.x86_64 How reproducible: 100% Steps: 1. Prepare a vm whose vda with tag <readonly> [root@dell-per740xd-13 ~]# virsh dumpxml vm1 | awk '/<disk/,/<\/disk/' <disk type='file' device='disk'> <driver name='qemu' type='qcow2'/> <source file='/var/lib/libvirt/images/vda.qcow2' index='1'/> <backingStore/> <target dev='vda' bus='virtio'/> <readonly/> <alias name='virtio-disk0'/> <address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/> </disk> 2. Prepare a backup xml [root@dell-per740xd-13 ~]# cat backup.xml <domainbackup> <disks> <disk name='vda' type='file'> <target file='/tmp/vda.backup'/> <driver type='qcow2'/> </disk> </disks> </domainbackup> 3. Start a backup [root@dell-per740xd-13 ~]# virsh backup-begin vm1 backup.xml error: unsupported configuration: backup of readonly disk 'vda' makes no sense Actual result: Backup failed with error ‘backup of readonly disk 'vda' makes no sense’ Expected result: Since this is a full backup, so it’s not that ‘makes no sense’ to a readonly disk. Uplayer/Users may need to do a full data backup for all images, readonly or not.
I'll asses whether it makes sense. Specifically we don't really want to add bitmaps in case when a backup is created together with a checkpoint.
Fixed upstream: commit 981222b682097f017e3fa8280426ccea9a444a48 Author: Peter Krempa <pkrempa> Date: Thu Jun 25 12:49:45 2020 +0200 conf: backup: Don't explicitly forbid backup of read-only disk Users may want to use this to create a full backup or even incremental if the checkpoints are pre-existing. We still will not allow to create a checkpoint on a read-only disk as that makes no sense. https://bugzilla.redhat.com/show_bug.cgi?id=1840053 Signed-off-by: Peter Krempa <pkrempa> Reviewed-by: Eric Blake <eblake>
Tested with: libvirt-6.6.0-2.module+el8.3.0+7567+dc41c0a9.x86_64 Result: PASS Steps: 1. having a vm with 2 disks, we'll use vdb to test [root@dell-per730-67 ~]# virsh dumpxml vm1 | awk '/<disk/,/<\/disk/' <disk type='file' device='disk'> <driver name='qemu' type='qcow2'/> <source file='/var/lib/libvirt/images/jeos-27-x86_64.qcow2' index='2'/> <backingStore/> <target dev='vda' bus='virtio'/> <alias name='virtio-disk0'/> <address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/> </disk> <disk type='file' device='disk'> <driver name='qemu' type='qcow2'/> <source file='/var/lib/libvirt/images/vdb.qcow2' index='1'/> <backingStore/> <target dev='vdb' bus='virtio'/> <alias name='virtio-disk1'/> <address type='pci' domain='0x0000' bus='0x07' slot='0x00' function='0x0'/> </disk> 2. create a checkpoint for vdb [root@dell-per730-67 ~]# virsh checkpoint-create vm1 check_0.xml Domain checkpoint checkpoint_0 created from 'check_0.xml' 3. generate 100M data in vdb [root@dell-per730-67 ~]# virsh console vm1 Connected to domain vm1 [root@localhost ~]# dd if=/dev/urandom of=/dev/vdb bs=1M count=100; sync 100+0 records in 100+0 records out 104857600 bytes (105 MB, 100 MiB) copied, 0.705695 s, 149 MB/s 4. edit vm to set vdb as readonly disk and restart vm [root@dell-per730-67 ~]# virsh dumpxml vm1 | awk '/<disk/,/<\/disk/' ... <disk type='file' device='disk'> <driver name='qemu' type='qcow2'/> <source file='/var/lib/libvirt/images/vdb.qcow2'/> <target dev='vdb' bus='virtio'/> <readonly/> <address type='pci' domain='0x0000' bus='0x07' slot='0x00' function='0x0'/> </disk> [root@dell-per730-67 ~]# virsh start vm1 Domain vm1 started <==== backup job successfully run 5. do a push-mode full backup [root@dell-per730-67 ~]# cat backup_push_0.xml <domainbackup mode="push"><disks><disk backup="no" name="vda" /><disk backup="yes" name="vdb" type="file"><target file="/tmp/target_file_0" /><driver type="qcow2" /></disk></disks></domainbackup> [root@dell-per730-67 ~]# virsh backup-begin vm1 backup_push_0.xml Backup started [root@dell-per730-67 ~]# qemu-img info /tmp/target_file_0 image: /tmp/target_file_0 file format: qcow2 virtual size: 1 GiB (1073741824 bytes) disk size: 101 MiB cluster_size: 65536 Format specific information: compat: 1.1 compression type: zlib lazy refcounts: false refcount bits: 16 corrupt: false 6. do a push-mode incremental backup [root@dell-per730-67 ~]# cat backup_push_1.xml <domainbackup mode="push"><incremental>checkpoint_0</incremental><disks><disk backup="no" name="vda" /><disk backup="yes" name="vdb" type="file"><target file="/tmp/target_file_1" /><driver type="qcow2" /></disk></disks></domainbackup> [root@dell-per730-67 ~]# virsh backup-begin vm1 backup_push_1.xml Backup started [root@dell-per730-67 ~]# qemu-img info /tmp/target_file_1 image: /tmp/target_file_1 file format: qcow2 virtual size: 1 GiB (1073741824 bytes) disk size: 100 MiB cluster_size: 65536 backing file: /var/lib/libvirt/images/vdb.qcow2 backing file format: qcow2 Format specific information: compat: 1.1 compression type: zlib lazy refcounts: false refcount bits: 16 corrupt: false <==== backup job successfully run 7. do a pull-mode full backup [root@dell-per730-67 ~]# cat backup_pull_0.xml <domainbackup mode="pull"><server socket="/tmp/pull_backup.socket" transport="unix" /><disks><disk backup="no" name="vda" /><disk backup="yes" name="vdb" type="file"><scratch file="/tmp/scratch_file_0" /></disk></disks></domainbackup> [root@dell-per730-67 ~]# virsh backup-begin vm1 backup_pull_0.xml Backup started [root@dell-per730-67 ~]# virsh domjobinfo vm1 Job type: Unbounded Operation: Backup Time elapsed: 11792 ms Temporary disk space use: 0.000 B Temporary disk space total: 1.000 GiB <==== backup job successfully run 8. do a pull-mode incremental backup [root@dell-per730-67 ~]# cat backup_pull_1.xml <domainbackup mode="pull"><incremental>checkpoint_0</incremental><server socket="/tmp/pull_backup.socket" transport="unix" /><disks><disk backup="no" name="vda" /><disk backup="yes" name="vdb" type="file"><scratch file="/tmp/scratch_file_1" /></disk></disks></domainbackup> [root@dell-per730-67 ~]# virsh backup-begin vm1 backup_pull_1.xml Backup started [root@dell-per730-67 ~]# virsh domjobinfo vm1 Job type: Unbounded Operation: Backup Time elapsed: 3582 ms Temporary disk space use: 0.000 B Temporary disk space total: 1.000 GiB <==== backup job successfully run 9. try to create a checkpoint on vdb [root@dell-per730-67 ~]# cat check_1.xml <domaincheckpoint><disks><disk checkpoint="no" name="vda" /><disk checkpoint="bitmap" name="vdb" /></disks><name>checkpoint_1</name><description>desc of cp_1</description></domaincheckpoint> [root@dell-per730-67 ~]# virsh checkpoint-create vm1 check_1.xml error: unsupported configuration: disk 'vdb' is empty or readonly <==== cannot create checkpoint on readonly disk, this is expected.
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 (virt:8.3 bug fix and enhancement update), 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:5137