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

Live migration fails with ejected media 'tray="open"'

    • sst_virtualization
    • ssg_virtualization
    • None
    • QE ack
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None

      What were you trying to do that didn't work?

      {}{}

      Live migrate a guest with NFS storage from source to target after ejecting media from guest on source. The live migration is expected to succeed, but failed:

      # virsh migrate --live a qemu+ssh://<target-ip>/system --verbose
      
      error: Cannot access storage file '/var/lib/libvirt/images/cdrom': No such file or directory
      
      # virsh dumpxml a --xpath //disk
      ...
      <disk type="file" device="cdrom">
        <driver name="qemu" type="raw"/>
        <source file="/var/lib/libvirt/images/cdrom" index="1"/>
        <backingStore/>
        <target dev="hdc" bus="scsi" tray="open"/>
        <readonly/>
        <alias name="scsi0-0-0-2"/>
        <address type="drive" controller="0" bus="0" target="0" unit="2"/>
      </disk>
      

       

       

      Please provide the package NVR for which bug is seen:

      For both migration source and target:

      1. rpm -qa qemu-kvm
        qemu-kvm-8.2.0-6.el9.x86_64
      2. # rpm -qa libvirt
        libvirt-10.0.0-4.el9.x86_64
      3. # uname -r
        5.14.0-423.el9.x86_64

      Guest

      1. uname -r
        5.14.0-425.el9.x86_64

        How reproducible:

      100%

      Steps to reproduce

       

      1. Create cdrom disk that is not available to migration target
         # qemu-img create -f raw /var/lib/libvirt/images/cdrom 10M   
      2. Attach disk to vm
        # virsh attach-disk --domain a --source /var/lib/libvirt/images/cdrom --target sdb --config --driver qemu --subdriver raw --cache none --type cdrom --mode readonly
      3. Start vm
        # virsh start a --console
      1. Check disk is attached (sr0) (inside guest)
        # lsblk
        
        NAME          MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
        ...
        sr0            11:0    1   10M  0 ro
      2. Eject the media (inside guest)
        # eject /dev/sr0 
        # echo $?
        0
      3. PS. ejection process silently fails, lsblk after eject:
        From `eject` man page: 
        "If eject does not work, it is most likely a limitation of the kernel driver for the device and not the eject program itself."
        # lsblk
        NAME          MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
        ...
        sr0            11:0    1   10M  0 rom 
      4. Check disk tray is open:
        # virsh dumpxml a --xpath //disk
        ...
        <disk type="file" device="cdrom">
          <driver name="qemu" type="raw"/>
          <source file="/var/lib/libvirt/images/cdrom" index="1"/>
          <backingStore/>
          <target dev="hdc" bus="scsi" tray="open"/>
          <readonly/>
          <alias name="scsi0-0-0-2"/>
          <address type="drive" controller="0" bus="0" target="0" unit="2"/>
        </disk>
        
      5. # virsh migrate --live a qemu+ssh://10.73.211.28/system --verbose
        
        error: Cannot access storage file '/var/lib/libvirt/images/cdrom': No such file or directory
        

      Expected results

      With tray="open" the live migration should succeed. See patch: https://listman.redhat.com/archives/libvir-list/2011-September/msg00465.html

      Actual results

      Live migration fails

            pkrempa@redhat.com Peter Krempa
            rh-ee-wveedla Walter Veedla (Inactive)
            Peter Krempa Peter Krempa
            Meina Li Meina Li
            Votes:
            0 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved: