Bug 1086121
Summary: | Improve the error message when failed to restore a guest with a not availabe disk with startupPolicy='optional' | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | chhu |
Component: | libvirt | Assignee: | Pavel Hrdina <phrdina> |
Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> |
Severity: | low | Docs Contact: | |
Priority: | unspecified | ||
Version: | 7.1 | CC: | ajia, dyuan, mzhan, pzhang, rbalakri, shyu |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
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 07:31:58 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
chhu
2014-04-10 07:22:06 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> 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. 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> 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 |