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

Can not migrate guest with virtiofs(unprivileged) device when shared directory get different data

    • Icon: Bug Bug
    • Resolution: Not a Bug
    • Icon: Undefined Undefined
    • None
    • rhel-9.5
    • virtiofsd
    • None
    • No
    • None
    • rhel-sst-virtualization-storage
    • ssg_virtualization
    • None
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • None

      Please provide the package NVR for which bug is seen:
      libvirt-10.5.0-4.el9.x86_64
      qemu-kvm-9.0.0-7.el9.x86_64
      virtiofsd-1.11.1-1.el9.x86_64

      How reproducible:
      100%

      Steps to reproduce:

      1. Prepare a guest with virtiofs device, virtiofsd in unprivileged user namespace
      $ virsh dumpxml lizhu --xpath //filesystem 
      <filesystem type="mount" accessmode="passthrough">
        <driver type="virtiofs" queue="1024"/>
        <binary path="/usr/libexec/virtiofsd" xattr="on">
          <cache mode="always"/>
          <sandbox mode="namespace"/>
          <thread_pool size="16"/>
        </binary>
        <idmap>
          <uid start="0" target="1001" count="1"/>
          <uid start="1" target="165536" count="65536"/>
          <gid start="0" target="1001" count="1"/>
          <gid start="1" target="165536" count="65536"/>
        </idmap>
        <source dir="/home/lizhu/path"/>
        <target dir="mount_tag"/>
        <alias name="fs0"/>
        <address type="pci" domain="0x0000" bus="0x07" slot="0x00" function="0x0"/>
      </filesystem>
      

      2. Mount virtiofs in guest

      [Guest OS]# mount -t virtiofs mount_tag /mnt
      [Guest OS]# ll /mnt/                              
      total 0
      -rw-r--r--. 1 root root 0 Aug 15 19:04 testfile
      

      3. Check the shared dir in target host, data under the shared dir are different with that in source host

      [Target host]$ pwd; ll
      /home/lizhu/path
      total 0
      

      4. Try to migrate the guest to target host

      $ virsh migrate lizhu qemu+ssh://lizhu@lenovo-sr630-13.lab.eng.pek2.redhat.com/session --live --verbose --p2p
      Migration: [100.00 %]error: internal error: QEMU unexpectedly closed the monitor (vm='lizhu'): 2024-08-15T11:16:09.188877Z qemu-kvm: -device {"driver":"cirrus-vga","id":"video0","bus":"pcie.0","addr":"0x1"}: warning: 'cirrus-vga' is deprecated, please use a different VGA card instead
      2024-08-15T11:16:17.176925Z qemu-kvm: Error loading back-end state of virtio-user-fs device /machine/peripheral/fs0/virtio-backend (tag: "mount_tag"): Back-end failed to process its internal state
      2024-08-15T11:16:17.176958Z qemu-kvm: Failed to load vhost-user-fs-backend:back-end
      2024-08-15T11:16:17.176972Z qemu-kvm: error while loading state for instance 0x0 of device '0000:00:02.6:00.0/vhost-user-fs'
      2024-08-15T11:16:17.183952Z qemu-kvm: load of migration failed: Input/output error
      

      5. Check the log in target host

      $ ll /home/lizhu/.cache/libvirt/qemu/log/lizhu-fs0-virtiofsd.log
      [2024-08-15T11:16:09Z WARN  virtiofsd::limits] Failure when trying to set the limit to 1000000, the hard limit (524288) of open file descriptors is used instead.
      [2024-08-15T11:16:09Z INFO  virtiofsd] Waiting for vhost-user socket connection...
      [2024-08-15T11:16:09Z INFO  virtiofsd] Client connected, servicing requests
      [2024-08-15T11:16:17Z ERROR virtiofsd] Migration failed: Failed to load state: Inode 2: Opening /testfile: No such file or directory (os error 2)
      [2024-08-15T11:16:17Z INFO  virtiofsd] Client disconnected, shutting down
      

      Expected result:
      Migration succeed

      Additional info:
      For privileged virtiofsd, even the data in shared dir are different, migration can be successful, the behavior for privileged and unprivileged virtiofsd are different.

              virt-maint virt-maint
              rhn-support-lizhu Lili Zhu
              virt-maint virt-maint
              Tingting Mao Tingting Mao
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: