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

No VM I/O error occurs during migration when the image size exceeds the disk size

Linking RHIVOS CVEs to...Migration: Automation ...SWIFT: POC ConversionSync from "Extern...XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not a Bug
    • Icon: Undefined Undefined
    • None
    • rhel-10.1
    • libvirt
    • None
    • None
    • None
    • rhel-virt-core-libvirt-1
    • None
    • False
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • Unspecified
    • Unspecified
    • Unspecified
    • None

      What were you trying to do that didn't work?
      No VM I/O error occurs during migration when the image size exceeds the disk size

      Please provide the package NVR for which bug is seen:
      libvirt-11.5.0-4.1.el10_1.x86_64
      qemu-kvm-10.0.0-14.el10_1.x86_64

      How reproducible:
      100%

      Steps to reproduce
      1. Prepare a small local disk on src host. Create nfs server on it and mount the nfs dir on both src and dest host.

      On src host:
      #  truncate -s 30M /var/tmp/test.disk
      #  losetup /dev/loop0 /var/tmp/test.disk
      # losetup -l
      NAME       SIZELIMIT OFFSET AUTOCLEAR RO BACK-FILE          DIO LOG-SEC
      /dev/loop0         0      0         0  0 /var/tmp/test.disk   0     512
      
      # mkfs.ext4 /dev/loop0
      # mount /dev/loop0 /mnt
      
      # exportfs -v
      /var/lib/avocado/data/avocado-vt/images
      <world>(async,wdelay,hide,no_subtree_check,sec=sys,rw,secure,no_root_squash,no_all_squash)
      /mnt          <world>(async,wdelay,hide,no_subtree_check,sec=sys,rw,secure,no_root_squash,no_all_squash)
      
      # mkdir /nfs
      # mount -t nfs 127.0.0.1:/mnt /nfs -o rw,soft,timeo=15,retrans=3
      
      # Create an image(larger than 30M).
      # qemu-img create -f qcow2 /nfs/100M.qcow2 100M
      Formatting '/nfs/100M.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=104857600 lazy_refcounts=off refcount_bits=16
      
      On dest host:
      # mkdir /nfs
      # mount -t nfs <source host ip>:/mnt /nfs -o rw,soft,timeo=15,retrans=3
      

      2. Prepare the VM.

      # virsh dumpxml vm1 --xpath //disk
      <disk type="file" device="disk">
        <driver name="qemu" type="qcow2" cache="none" io="native" discard="unmap"/>
        <source file="/var/lib/libvirt/migrate/vm1.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" cache="none" error_policy="stop"/>
        <source file="/nfs/100M.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>
      

      3. Migrate VM.

      # virsh migrate vm1 --live --p2p --verbose --desturi qemu+tcp://<dest host ip>/system --abort-on-error
      Migration: [100.00 %]
      

      Expected results:
      Migration failed and error message:
      error: operation failed: job 'migration out' failed due to I/O error

      Actual results:
      Migration successfully.

      Additional info:
      1. After migration, Vm running on dest host. Login the VM and check disk.

      # lsblk
      NAME          MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
      vda           252:0    0   10G  0 disk
      ├─vda1        252:1    0  600M  0 part /boot/efi
      ├─vda2        252:2    0    1G  0 part /boot
      └─vda3        252:3    0  8.4G  0 part
        ├─rhel-root 253:0    0  7.4G  0 lvm  /
        └─rhel-swap 253:1    0    1G  0 lvm  [SWAP]
      vdb           252:16   0  100M  0 disk
      

      2. Formatting vdb failed. And the VM status changed to paused.

      # mkfs.ext4 /dev/vdb
      

              virt-maint virt-maint
              rhn-support-lcheng Liping Cheng
              virt-maint virt-maint
              virt-bugs virt-bugs
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: