Bug 730909
Summary: | setting disk with error_policy=enospace will cause error when install guest | ||||||
---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux 6 | Reporter: | zhe peng <zpeng> | ||||
Component: | libvirt | Assignee: | Laine Stump <laine> | ||||
Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> | ||||
Severity: | medium | Docs Contact: | |||||
Priority: | low | ||||||
Version: | 6.2 | CC: | dallan, danken, eblake, mzhan, rwu, weizhan, zpeng | ||||
Target Milestone: | rc | ||||||
Target Release: | --- | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Whiteboard: | |||||||
Fixed In Version: | libvirt-0.9.4-16.el6 | Doc Type: | Bug Fix | ||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2011-12-06 11:26:55 UTC | Type: | --- | ||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | --- | Target Upstream Version: | |||||
Embargoed: | |||||||
Bug Depends On: | |||||||
Bug Blocks: | 747120 | ||||||
Attachments: |
|
Description
zhe peng
2011-08-16 08:03:45 UTC
Can you please provide the full output of running virt-install with --debug? I don't think this is a virtinst issue, either libvirt or qemu. Reassigning to libvirt. Created attachment 519546 [details]
virt-install --debug full output
# tail -f /var/log/libvirt/libvirtd.log 22:24:11.889: 1594: error : qemuProcessReadLogOutput:939 : internal error Process exited while reading console log output: char device redirected to /dev/pts/7 qemu-kvm: -drive file=/dev/sda2,if=none,id=drive-ide0-0-1,format=raw,cache=none,werror=enospace,rerror=enospace,aio=native: 'enospace' invalid write error action According to blockdev.c in the qemu source, the proper name for this option is "enospc", not "enospace". Additionally, it is only valid for werror, not for rerror. It's simple enough to change enospace to enospc in the generated qemu commandline, but since libvirt's config has a single setting "error_policy" which is applied to both qemu's werror and rerror options, and "enospc" isn't allowed for rerror, what should rerror be set to when we set werror=enospc? IRC suggestions: patch 1: map error_policy=enospace to werror=enospc,rerror=ignore patch 2: add XML attribute read_error_policy='stop|ignore', if not present, then it defaults to the error_policy='stop|ignore|enospace' setting except that enospace maps to ignore, where error_policy controls werror and read_error_policy controls rerror Then we could backport patch 1 in isolation to fix the problem, while using both patches upstream for maximal flexibility A patch to fix the spelling problem, and avoid using enospc for rerror, has been pushed to upstream libvirt, and a rebased version posted to rhvirt-patches for inclusion in the next libvirt build for RHEL: http://post-office.corp.redhat.com/archives/rhvirt-patches/2011-October/msg00161.html commit 12062abb89fe3684712ed454f090a86e6ce4f185 Author: Laine Stump <laine> Date: Tue Oct 4 13:26:29 2011 -0400 qemu: correct misspelled 'enospc' option, and only use for werror This resolves: https://bugzilla.redhat.com/show_bug.cgi?id=730909 When support for setting the qemu disk error policy to "enospc" was added, it was inadvertently spelled "enospace". This patch corrects that on the qemu commandline (while retaining the "enospace" spelling for libvirt's XML). Also, while examining the qemu source, I found that "enospc" is not allowed for the read error policy, only for write error policy (makes sense). Since libvirt currently only has a single error policy setting, when "enospace" is selected, the read error policy is set to "ignore". Paolo pointed out that the default when rerror= is omitted is rerror=report, which makes more sense than rerror=ignore. We need a further upstream patch to use a nicer default, so I'm moving this back to ASSIGNED to remind us to backport that once it is available. There's a new patch upstream, and posted to rhvirt-patches, to remedy the issues brought up by Paolo: http://post-office.corp.redhat.com/archives/rhvirt-patches/2011-October/msg00221.html commit 91195b4321a1508139e36bcafc98201094af05de Author: Laine Stump <laine> Date: Wed Oct 5 11:19:28 2011 -0400 qemu: leave rerror policy at default when enospace is requested commit 12062ab set rerror=ignore when error_policy="enospace" was selected (since the rerror option in qemu doesn't accept "enospc", as the werror option does). After that patch was already pushed, Paolo Bonzini noticed it and commented that leaving rerror at the default ("report") would be a better choice. This patch corrects the problem - if error_policy = "enospace" is given, rerror is left off the qemu commandline, effectively setting it to "report". For other values, rerror is still set to match werror. Additionally, the parsing of error_policy was changed to no longer erroneously allow "default" as a choice - as with most other attributes, if you want the default setting, just don't specify an error_policy. Finally, two ommissions in the first patch were corrected - a long-dormant qemuxml2argv test for enospace was enabled, and fixed to pass, and the argv2xml parser in qemu_command.c was updated to recognize the different spelling on the qemu commandline. verify pass on qemu-kvm-0.12.1.2-2.195.el6.x86_64 kernel-2.6.32-206.el6.x86_64 libvirt-0.9.4-16.el6.x86_64 with command # virt-install -n demo -r 1024 --disk path=/tmp/demo.img,size=4 --disk path=/dev/sda12,error_policy=enospace -c /tmp/RHEL6.0-20100922.1-Server-x86_64-DVD1.iso --vnc install does not report error like "'enospace' invalid write error action" and installation can succeed verify with: libvirt-0.9.4-16.el6 qemu-img-0.12.1.2-2.195.el6 kernel-2.6.32-206.el6 python-virtinst-0.600.0-3.el6 step: test error_policy=enospace: 1: run command line: #virt-install -n demo -r 1024 --disk path=/tmp/demo.img,size=4 --disk path=/dev/sda2,error_policy=enospace -c /dev/cdrom --vnc --debug ...... <disk type='block' device='disk'> <driver name='qemu' type='raw' cache='none' error_policy='enospace' io='native'/> <source dev='/dev/sda2'/> ...... the installation will success without error. 2: #ps -ef | grep demo qemu 5108 1 4 02:42 ? 00:00:19 /usr/libexec/qemu-kvm -S -M rhel6.2.0 -enable-kvm -m 1024 -smp 1,sockets=1,cores=1,threads=1 -name demo -uuid 2f3c5809-ca3b-82ef-6a7b-c324550d1d5a -nodefconfig -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/demo.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-shutdown -drive file=/tmp/demo.img,if=none,id=drive-ide0-0-0,format=raw,cache=none -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 -drive file=/dev/sda2,if=none,id=drive-ide0-0-1,format=raw,cache=none,werror=enospc,aio=native -device ide-drive,bus=ide.0,unit=1,drive=drive-ide0-0-1,id=ide0-0-1 -drive if=none,media=cdrom,id=drive-ide0-1-0,readonly=on,format=raw -device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 -netdev tap,fd=23,id=hostnet0 -device rtl8139,netdev=hostnet0,id=net0,mac=52:54:00:30:a3:aa,bus=pci.0,addr=0x3 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -usb -vnc 127.0.0.1:0 -vga cirrus -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4 test error_policy=stop 3: #virt-install -n demo2 -r 1024 --disk path=/tmp/demo2.img,size=4 --disk path=/dev/sda2,error_policy=stop -c /dev/cdrom --vnc --debug --force .... <disk type='block' device='disk'> <driver name='qemu' type='raw' cache='none' error_policy='stop' io='native'/> <source dev='/dev/sda2'/> .... #ps -ef | grep demo2qemu 5963 1 3 02:52 ? 00:00:06 /usr/libexec/qemu-kvm -S -M rhel6.2.0 -enable-kvm -m 1024 -smp 1,sockets=1,cores=1,threads=1 -name demo2 -uuid c09c1cc0-43c9-9b58-9372-1e643455ad7e -nodefconfig -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/demo2.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-reboot -no-shutdown -drive file=/tmp/demo2.img,if=none,id=drive-ide0-0-0,format=raw,cache=none -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=2 -drive file=/dev/sda2,if=none,id=drive-ide0-0-1,format=raw,cache=none,werror=stop,rerror=stop,aio=native -device ide-drive,bus=ide.0,unit=1,drive=drive-ide0-0-1,id=ide0-0-1 -drive file=/dev/cdrom,if=none,media=cdrom,id=drive-ide0-1-0,readonly=on,format=raw -device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0,bootindex=1 -netdev tap,fd=23,id=hostnet0 -device rtl8139,netdev=hostnet0,id=net0,mac=52:54:00:4b:36:21,bus=pci.0,addr=0x3 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -usb -vnc 127.0.0.1:0 -vga cirrus -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4 test error_policy=ignore for virt-install, both error_policy= none and ignore have error, i will open a virtinst bug for it, so test this manually ,edit xml for existing vm. #virsh dumpxml demo ..... <disk type='block' device='disk'> <driver name='qemu' type='raw' cache='none' error_policy='ignore' io='native'/> <source dev='/dev/sda2'/> .... #ps -ef | grep demo qemu 7038 1 9 03:07 ? 00:00:19 /usr/libexec/qemu-kvm -S -M rhel6.2.0 -enable-kvm -m 1024 -smp 1,sockets=1,cores=1,threads=1 -name demo -uuid 2f3c5809-ca3b-82ef-6a7b-c324550d1d5a -nodefconfig -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/demo.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-shutdown -drive file=/tmp/demo.img,if=none,id=drive-ide0-0-0,format=raw,cache=none -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 -drive file=/dev/sda2,if=none,id=drive-ide0-0-1,format=raw,cache=none,werror=ignore,rerror=ignore,aio=native -device ide-drive,bus=ide.0,unit=1,drive=drive-ide0-0-1,id=ide0-0-1 -drive if=none,media=cdrom,id=drive-ide0-1-0,readonly=on,format=raw -device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 -netdev tap,fd=23,id=hostnet0 -device rtl8139,netdev=hostnet0,id=net0,mac=52:54:00:30:a3:aa,bus=pci.0,addr=0x3 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -usb -vnc 127.0.0.1:1 -vga cirrus -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4 verification passed. ..... 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. http://rhn.redhat.com/errata/RHBA-2011-1513.html |