Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1086121 - Improve the error message when failed to restore a guest with a not availabe disk with startupPolicy='optional'
Improve the error message when failed to restore a guest with a not availabe ...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt (Show other bugs)
7.1
x86_64 Linux
unspecified Severity low
: rc
: ---
Assigned To: Pavel Hrdina
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2014-04-10 03:22 EDT by chhu
Modified: 2015-03-05 02:31 EST (History)
6 users (show)

See Also:
Fixed In Version: libvirt-1.2.7-1.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-03-05 02:31:58 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:0323 normal SHIPPED_LIVE Low: libvirt security, bug fix, and enhancement update 2015-03-05 07:10:54 EST

  None (edit)
Description chhu 2014-04-10 03:22:06 EDT
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 10:37:14 EDT
commit 5098f671f0dfaddb8788a959906c47b0cb4c87cc
Author: Pavel Hrdina <phrdina@redhat.com>
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@redhat.com>
Comment 4 Pei Zhang 2014-10-31 06:11:59 EDT
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 00:42:21 EST
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 02:31:58 EST
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.