RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1086121 - Improve the error message when failed to restore a guest with a not availabe disk with startupPolicy='optional'
Summary: Improve the error message when failed to restore a guest with a not availabe ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.1
Hardware: x86_64
OS: Linux
unspecified
low
Target Milestone: rc
: ---
Assignee: Pavel Hrdina
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-04-10 07:22 UTC by chhu
Modified: 2015-03-05 07:31 UTC (History)
6 users (show)

Fixed In Version: libvirt-1.2.7-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-03-05 07:31:58 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:0323 0 normal SHIPPED_LIVE Low: libvirt security, bug fix, and enhancement update 2015-03-05 12:10:54 UTC

Description chhu 2014-04-10 07:22:06 UTC
Description:
The error message should be improved when failed to restore a guest with a not availabe disk with startupPolicy='optional'

Version-Release number of selected component (if applicable):
libvirt-1.1.1-29.el7.x86_64
qemu-kvm-rhev-1.5.3-55.el7.x86_64

How reproducible:
100%

Steps to Reproduce:

1. define and start a guest with disk with startupPolicy='optional'
# virsh define r7.xml
Domain r7 defined from r7.xml
# virsh start r7
Domain r7 started
# virsh dumpxml r7| grep disk -A 7
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2' cache='none'/>
      <source file='/var/lib/libvirt/images/r7.img'/>
      <target dev='vda' bus='virtio'/>
      <alias name='virtio-disk0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </disk>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2' cache='none'/>
      <source file='/var/lib/libvirt/images/test.img' startupPolicy='optional'/>
      <target dev='vdb' bus='virtio'/>
      <alias name='virtio-disk1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
    </disk>

2. move the disk which is with startupPolicy='optional'
# mv test.img /tmp/

3. save the guest successfully
# virsh save r7 r7.save
Domain r7 saved to r7.save

4. try to restore the guest failed
# virsh restore r7.save
error: Failed to restore domain from r7.save
error: internal error: early end of file from monitor: possible problem:
red_dispatcher_loadvm_commands:
Unknown savevm section or instance '0000:00:08.0/virtio-blk' 0
load of migration failed

Actual results:
In step4: restore the guest failed.

Expected results:
In step4: the guest is restored successfully without the not existed disk or the error message should be improved.

Comment 2 Pavel Hrdina 2014-07-02 14:37:14 UTC
commit 5098f671f0dfaddb8788a959906c47b0cb4c87cc
Author: Pavel Hrdina <phrdina>
Date:   Fri Jun 27 16:34:07 2014 +0200

    qemu_domain: fix startup policy for disks
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1086121
    
    We now support startupPolicy='optional' for disks, but this
    should work only for cold boot, not for restore or migrate.
    
    Signed-off-by: Pavel Hrdina <phrdina>

Comment 4 Pei Zhang 2014-10-31 10:11:59 UTC
verify vision:
libvirt-1.2.8-5.el7.x86_64
qemu-kvm-rhev-2.1.2-4.el7.x86_64
kernel-3.10.0-191.el7.x86_64

steps:

1.
define and start a guest with one disk with startupPolicy='optional'

# virsh destroy r7new ; virsh start r7new
Domain r7new destroyed

Domain r7new started

# virsh dumpxml r7new | grep disk -A8
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2' cache='none'/>
      <source file='/var/lib/libvirt/images/r7new.img'/>
      <backingStore/>
      <target dev='hda' bus='ide'/>
      <alias name='ide0-0-0'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2' cache='none'/>
      <source file='/var/lib/libvirt/images/qcow2-1.img' startupPolicy='optional'/>  ------>optional
      <backingStore/>
      <target dev='hdb' bus='ide'/>
      <alias name='ide0-0-1'/>
      <address type='drive' controller='0' bus='0' target='0' unit='1'/>
    </disk>

2. move the disk which is with startupPolicy='optional'
# mv qcow2-1.img qcow2-1.img.bak

3. save the guest

# virsh save r7new r7new.save

Domain r7new saved to r7new.save

4.try to restore the guest

# virsh restore r7new.save
error: Failed to restore domain from r7new.save
error: Cannot access storage file '/var/lib/libvirt/images/qcow2-1.img' (as uid:107, gid:107): No such file or directory

it has a clear error message.
verified.

Comment 5 Pei Zhang 2014-11-04 05:42:21 UTC
add verify scenario:
version:
libvirt-1.2.8-5.el7.x86_64
qemu-kvm-rhev-2.1.2-5.el7.x86_64
kernel-3.10.0-196.el7.x86_64

steps:

1> test disk with startupPolicy='optional' for cold boot
1.1>
start a healthy guest with one disk with startupPolicy='optional':

# virsh dumpxml r7new | grep disk -A 8
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2' cache='none'/>
      <source file='/var/lib/libvirt/images/r7new.img'/>
      <backingStore/>
      <target dev='hda' bus='ide'/>
      <alias name='ide0-0-0'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/var/lib/libvirt/images/qcow2-2.img' startupPolicy='optional'/>
      <backingStore/>
      <target dev='hdb' bus='ide'/>
      <alias name='ide0-0-1'/>
      <address type='drive' controller='0' bus='0' target='0' unit='1'/>
    </disk>

1.2> move the disk which is with startupPolicy='optional'
# mv qcow2-2.img qcow2-2.img.bak
# ll /var/lib/libvirt/images/qcow2-2.img
ls: cannot access /var/lib/libvirt/images/qcow2-2.img: No such file or directory

1.3>try to cold boot ,disk device with startupPolicy='optional' will be removed. and boot up successfully.
# virsh destroy r7new ; virsh start r7new
Domain r7new destroyed

Domain r7new started

# virsh dumpxml r7new | grep disk -A 8
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2' cache='none'/>
      <source file='/var/lib/libvirt/images/r7new.img'/>
      <backingStore/>
      <target dev='hda' bus='ide'/>
      <alias name='ide0-0-0'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>

2> test cdrom device for save / restore
2.1> start a healthy guest with cdrom device with startupPolicy='optional':
# virsh dumpxml r7new | grep cdrom -A 8

    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/var/lib/libvirt/images/cdrom.iso' startupPolicy='optional'/>
      <backingStore/>
      <target dev='hdb' bus='ide'/>
      <readonly/>
      <alias name='ide0-0-1'/>
      <address type='drive' controller='0' bus='0' target='0' unit='1'/>
    </disk>
2.2> move the cdrom  file away 
# mv cdrom.iso cdrom.iso.bak
# ll /var/lib/libvirt/images/cdrom.iso
ls: cannot access /var/lib/libvirt/images/cdrom.iso: No such file or directory

2.3>save the guest successfully 
# virsh save r7new r7new.save

Domain r7new saved to r7new.save

2.4> restore the guest successfully
# virsh restore r7new.save
Domain restored from r7new.save

# virsh dumpxml r7new | grep cdrom -A 8
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source startupPolicy='optional'/>
      <backingStore/>
      <target dev='hdb' bus='ide'/>
      <readonly/>
      <alias name='ide0-0-1'/>
      <address type='drive' controller='0' bus='0' target='0' unit='1'/>
    </disk>

3> test cdrom device for code boot
3.1> start a healthy guest with cdrom device with startupPolicy='optional':
# virsh dumpxml r7new | grep cdrom -A 8
   
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/var/lib/libvirt/images/cdrom.iso' startupPolicy='optional'/>
      <backingStore/>
      <target dev='hdb' bus='ide'/>
      <readonly/>
      <alias name='ide0-0-1'/>
      <address type='drive' controller='0' bus='0' target='0' unit='1'/>
    </disk>
3.2>move the cdrom file away 
# mv cdrom.iso cdrom.iso.bak
# ll /var/lib/libvirt/images/cdrom.iso
ls: cannot access /var/lib/libvirt/images/cdrom.iso: No such file or directory

3.3> try to cold boot , boot up successfully
# virsh destroy r7new ; virsh start r7new
Domain r7new destroyed

Domain r7new started

# virsh dumpxml r7new | grep cdrom -A 8
  
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source startupPolicy='optional'/>
      <backingStore/>
      <target dev='hdb' bus='ide'/>
      <readonly/>
      <alias name='ide0-0-1'/>
      <address type='drive' controller='0' bus='0' target='0' unit='1'/>
    </disk>


4> test  floppy device for save / restore
4.1> start a healthy guest with floppy device with startupPolicy='optional':
# virsh dumpxml r7new | grep floppy -A 8

    <disk type='file' device='floppy'>
      <driver name='qemu' type='raw'/>
      <source file='/var/lib/libvirt/images/floppy.img' startupPolicy='optional'/>
      <backingStore/>
      <target dev='fda' bus='fdc'/>
      <alias name='fdc0-0-0'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
   
4.2>move the floppy file away 
# mv floppy.img floppy.img.bak
# ll /var/lib/libvirt/images/floppy.img
ls: cannot access /var/lib/libvirt/images/floppy.img: No such file or directory

4.3>save the guest successfully 
# virsh save r7new r7new.save

Domain r7new saved to r7new.save

4.4>restore the guest successfully 
# virsh restore r7new.save
Domain restored from r7new.save

# virsh dumpxml r7new | grep floppy -A 8
    <disk type='file' device='floppy'>
      <driver name='qemu' type='raw'/>
      <source startupPolicy='optional'/>
      <backingStore/>
      <target dev='fda' bus='fdc'/>
      <alias name='fdc0-0-0'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>

5> test floppy device for cold boot
5.1> start a healthy guest with floppy device with startupPolicy='optional':
# virsh dumpxml r7new | grep floppy -A 8

    <disk type='file' device='floppy'>
      <driver name='qemu' type='raw'/>
      <source file='/var/lib/libvirt/images/floppy.img' startupPolicy='optional'/>
      <backingStore/>
      <target dev='fda' bus='fdc'/>
      <alias name='fdc0-0-0'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
   
5.2>move the floppy file away 
# mv floppy.img floppy.img.bak
# ll /var/lib/libvirt/images/floppy.img
ls: cannot access /var/lib/libvirt/images/floppy.img: No such file or directory

5.3> try to cold boot , boot up successfully.
# virsh destroy r7new ; virsh start r7new
Domain r7new destroyed

Domain r7new started

# virsh dumpxml r7new | grep floppy -A 8
  
    <disk type='file' device='floppy'>
      <driver name='qemu' type='raw'/>
      <source startupPolicy='optional'/>
      <backingStore/>
      <target dev='fda' bus='fdc'/>
      <alias name='fdc0-0-0'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>

Comment 7 errata-xmlrpc 2015-03-05 07:31:58 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHSA-2015-0323.html


Note You need to log in before you can comment on or make changes to this bug.