Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-82906

--migrate-disks-detect-zeroes doesn't take effect for disk migration [rhel-9.7]

Linking RHIVOS CVEs to...Migration: Automation ...Sync from "Extern...XMLWordPrintable

    • qemu-kvm-9.1.0-24.el9
    • Yes
    • Critical
    • 2
    • rhel-virt-storage
    • ssg_virtualization
    • 14
    • 14
    • 5
    • False
    • False
    • Hide

      None

      Show
      None
    • Yes
    • virt-storage Sprint 4, virt-storage Sprint 6
    • Known Issue
    • Hide
      .The `--migrate-disks-detect-zeroes` option might not work for VM migration

      Currently, when migrating virtual machines (VMs) on RHEL 9, the `--migrate-disks-detect-zeroes` option might not work and the migration might proceed without zeroed block detection on the specified disk. This problem is caused by a bug in QEMU where mirroring jobs had been relying on punching holes, which results in a sparse destination file.
      Show
      .The `--migrate-disks-detect-zeroes` option might not work for VM migration Currently, when migrating virtual machines (VMs) on RHEL 9, the `--migrate-disks-detect-zeroes` option might not work and the migration might proceed without zeroed block detection on the specified disk. This problem is caused by a bug in QEMU where mirroring jobs had been relying on punching holes, which results in a sparse destination file.
    • Done
    • Unspecified
    • Unspecified
    • Unspecified
    • x86_64
    • None

      What were you trying to do that didn't work?
      --migrate-disks-detect-zeroes doesn't take effect for disk migration

      Please provide the package NVR for which the bug is seen:
      libvirt-10.10.0-7.el9.x86_64
      qemu-kvm-9.1.0-15.el9.x86_64
      kernel-5.14.0-569.el9.x86_64

      How reproducible is this bug?:
      100%

      Steps to reproduce:

      1. Set up migration env and start vm on src host with a disk.
      
      # qemu-img create -f raw /var/lib/libvirt/images/raw.img 1G
      Formatting '/var/lib/libvirt/images/raw.img', fmt=raw size=1073741824
      
      # virsh edit vm1
          <disk type='file' device='disk'>
            <driver name='qemu' type='raw' />
            <source file='/var/lib/libvirt/images/raw.img'>
            </source>
            <target dev='sda' bus='scsi'/>
          </disk>
      
      # virsh start vm1
      
      2. Mount sda and create a file in guest.
      # mkfs.xfs /dev/sda
      # dd if=/dev/random of=/dev/sda bs=1048576 count=100   
      100+0 records in
      100+0 records out
      104857600 bytes (105 MB, 100 MiB) copied, 0.471111 s, 223 MB/s
      
      3. Check the current disk usage on src host.
      # qemu-img info /var/lib/libvirt/images/raw.img -U
      image: /var/lib/libvirt/images/raw.img
      file format: raw
      virtual size: 1 GiB (1073741824 bytes)
      disk size: 168 MiB
      ...
      
      4. Create a disk on the target host.
      # qemu-img create -f raw /var/lib/libvirt/images/raw.img 1G
      # qemu-img info /var/lib/libvirt/images/raw.img -U
      image: /var/lib/libvirt/images/raw.img
      file format: raw
      virtual size: 1 GiB (1073741824 bytes)
      disk size: 1 MiB
      ...
      
      5. Create migratable xml.
      # virsh dumpxml vm1 --migratable > mig.xml
      # vim mig.xml
      ...
          <disk type='file' device='disk'>
            <driver name='qemu' type='raw' />
            <source file='/var/lib/libvirt/images/raw.img'>
            </source>
            <target dev='sda' bus='scsi'/>
          </disk>
      ...
      
      
      6. Migrate vm with --migrate-disks-detect-zeroes option.
      # virsh migrate vm1 qemu+tcp://targethost/system --verbose --live --p2p --copy-storage-all --xml mig.xml --migrate-disks-detect-zeroes sda
      Migration: [100.00 %]
      
      7. Check disk usage on target host.
      # qemu-img info /var/lib/libvirt/images/raw.img -U
      image: /var/lib/libvirt/images/raw.img
      file format: raw
      virtual size: 1 GiB (1073741824 bytes)
      disk size: 1 GiB
      ...
      
      
      

      Expected results:
      Can retain sparsity with option --migrate-disks-detect-zeroes.

      Actual results:
      --migrate-disks-detect-zeroes doesn't take effect.

      Additional info:

      Tested the following combinations:

          disk format on src host         disk format on target host    test result
               rbd/raw/qcow2          +             rbd                     FAIL
               rbd/raw/qcow2          +             raw                     FAIL
               rbd/raw/qcow2          +             qcow2                   PASS
      
      

        1. virtqemud.log-source-9.5
          2.26 MB
          Liping Cheng
        2. virtqemud.log-source-9.6
          3.74 MB
          Liping Cheng
        3. virtqemud.log-target-9.5
          3.11 MB
          Liping Cheng
        4. virtqemud.log-target-9.6
          2.39 MB
          Liping Cheng

              eblake_redhat Eric Blake
              rhn-support-lcheng Liping Cheng
              virt-maint virt-maint
              Aihua Liang Aihua Liang
              Daniel Vozenilek Daniel Vozenilek
              Votes:
              0 Vote for this issue
              Watchers:
              16 Start watching this issue

                Created:
                Updated: