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

Migration fails when the guest with TPM and on canonical paths in shared_filesystems

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

    • libvirt-11.5.0-1.el10
    • No
    • Low
    • rhel-virt-core-libvirt-1
    • ssg_virtualization
    • 24
    • None
    • False
    • False
    • Hide

      None

      Show
      None
    • None
    • Red Hat Enterprise Linux
    • None
    • Unspecified
    • Unspecified
    • Unspecified
    • x86_64
    • 11.5.0
    • None

      What were you trying to do that didn't work?
      Migration fails when the guest with TPM and on canonical paths in shared_filesystems.

      Please provide the package NVR for which bug is seen:
      libvirt-10.10.0-7.1.el9_6.x86_64
      qemu-kvm-9.1.0-15.el9.x86_64
      swtpm-0.8.0-2.el9_4.x86_64

      How reproducible:
      100%

      Steps to reproduce:

      1. Setup the nfs server on src host:
      # cat /etc/exports
      /nfs *(rw,no_root_squash,sync)
      
      # mkdir -p /nfs/libvirt/{images,nvram,swtpm}
      
      # systemctl restart nfs-server
      
      2. Mount the nfs source paths on src host. And mount the nfs paths to dst host.
      (on src host)
      # mount /nfs/libvirt/images/ /var/lib/libvirt/images/ --bind
      # mount /nfs/libvirt/nvram /var/lib/libvirt/qemu/nvram --bind
      # mount /nfs/libvirt/swtpm /var/lib/libvirt/swtpm --bind
      
      (on dst host)
      # mount <src host>:/nfs/libvirt/images/ /var/lib/libvirt/images/
      # mount <src host>:/nfs/libvirt/nvram /var/lib/libvirt/qemu/nvram/
      # mount <src host>:/nfs/libvirt/swtpm /var/lib/libvirt/swtpm/
      
      3. Set shared_filesystems in qemu.conf on both host. Add these paths to the list:
      shared_filesystems = [
        "/var/lib/libvirt/images/",
        "/var/lib/libvirt/qemu/nvram",
        "/var/lib/libvirt/swtpm"
      ]
      
      Restart virtqemud on both host.
      # systemctl restart virtqemud
      
      4. Start vm with tpm.
      # virsh dumpxml new
      ...
          <disk type='file' device='disk'>
            <driver name='qemu' type='qcow2'/>
            <source file='/var/lib/libvirt/images/new.qcow2' index='1'/>
            <backingStore/>
      ...
          <tpm model='tpm-crb'>
            <backend type='emulator' version='2.0'/>
            <alias name='tpm0'/>
          </tpm>
      
      5. Migrate vm.
      # virsh migrate new --live --verbose --desturi qemu+ssh://XXXX/system
      error: this function is not supported by the connection driver: the running swtpm does not support migration with shared storage
      
      6. Unmount and remount again, migration succeeded.
      # virsh destroy new
      Domain 'new' destroyed
      
      # umount /var/lib/libvirt/swtpm /var/lib/libvirt/qemu/nvram /var/lib/libvirt/images
      # mount /nfs/libvirt/images/ /var/lib/libvirt/images/ --bind 
      # mount /nfs/libvirt/nvram /var/lib/libvirt/qemu/nvram --bind 
      # mount /nfs/libvirt/swtpm /var/lib/libvirt/swtpm --bind
      # virsh start new
      Domain 'new' started
      
      # virsh migrate new --live --verbose --desturi qemu+ssh://XXXX/system
      Migration: [100.00 %]
      

      Expected results:
      Migration succeeded when vm with tpm and on canonical paths in shared_filesystems.

      Actual results:
      Migration failed with tpm.

      Additional info:
      1. After migration succeeded, destroy vm on dst host and start vm on src host.
      Then migration again, migration will fail again.

      # virsh start new
      Domain 'new' started
      
      # virsh migrate new --live --verbose --desturi qemu+ssh://XXXX/system
      error: this function is not supported by the connection driver: the running swtpm does not support migration with shared storage
      

      2. Migration succeeded when vm without tpm and on canonical paths in shared_filesystems.

              jdenemar@redhat.com Jiri Denemark
              rhn-support-lcheng Liping Cheng
              Jiri Denemark Jiri Denemark
              Liping Cheng Liping Cheng
              Votes:
              0 Vote for this issue
              Watchers:
              10 Start watching this issue

                Created:
                Updated: