Bug 677255

Summary: Error display when setting format as qcow2 for not pre-existing disk in guest installation
Product: Red Hat Enterprise Linux 6 Reporter: Min Zhan <mzhan>
Component: virt-managerAssignee: Cole Robinson <crobinso>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: low Docs Contact:
Priority: low    
Version: 6.1CC: dallan, dyuan, hjiang, kxiong, llim, mjenner, mliu, mzhan, xen-maint
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-05-19 13:47:53 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Min Zhan 2011-02-14 08:55:44 UTC
Description of problem:
The disk is not pre-existing.At the end of the installation wizard, select 'Customize before install', go to the disk details section,click Advanced options and set format as 'qcow2'.Then begin installation. But an error display.

Version-Release number of selected component (if applicable):
# uname -a
Linux dhcp-65-85.nay.redhat.com 2.6.32-99.el6.x86_64 #1 SMP Fri Jan 14 10:46:00
EST 2011 x86_64 x86_64 x86_64 GNU/Linux

virt-manager-0.8.6-1.el6
kernel-2.6.32-99.el6.x86_64
qemu-kvm-0.12.1.2-2.129.el6.x86_64
libvirt-0.8.7-1.el6.x86_64

How reproducible:
Always

Steps to Reproduce:
> - guest creation using qcow2. At the end of the install wizard, select 'Customize
> before install', go to the disk details section,click Advanced options and set
> format as 'qcow2'. but an error display in the installation process.
> Error:
> Unable to complete install: 'internal error Process exited while reading
> console log output: char device redirected to /dev/pts/5
> qemu: could not open disk image /var/lib/libvirt/images/xx.img: Inappropriate
> ioctl for device

  
Actual results:
but an error display in the installation process.
> Error:
> Unable to complete install: 'internal error Process exited while reading
> console log output: char device redirected to /dev/pts/5
> qemu: could not open disk image /var/lib/libvirt/images/xx.img: Inappropriate
> ioctl for device
> 
> # tail -f .virt-manager/virt-manager.log
> ...
>  <devices>
>     <emulator>/usr/libexec/qemu-kvm</emulator>
>     <disk type='file' device='disk'>
>       <driver name='qemu' type='qcow2' cache='none'/>
>       <source file='/var/lib/libvirt/images/xx.img'/>
>       <target dev='vda' bus='virtio'/>
>     </disk>
> ...
> [Wed, 19 Jan 2011 01:53:43 virt-manager 706] DEBUG (error:66) dialog message:
> Unable to complete install: 'internal error Process exited while reading
> console log output: char device redirected to /dev/pts/5
> qemu: could not open disk image /var/lib/libvirt/images/xx.img: Inappropriate
> ioctl for device
> ' : Unable to complete install: 'internal error Process exited while reading
> console log output: char device redirected to /dev/pts/5
> qemu: could not open disk image /var/lib/libvirt/images/xx.img: Inappropriate
> ioctl for device
> '
> Traceback (most recent call last):
>   File "/usr/share/virt-manager/virtManager/asyncjob.py", line 45, in
> cb_wrapper
>     callback(asyncjob, *args, **kwargs)
>   File "/usr/share/virt-manager/virtManager/create.py", line 1622, in
> do_install
>     guest.start_install(False, meter=meter)
>   File "/usr/lib/python2.6/site-packages/virtinst/Guest.py", line 1193, in
> start_install
>     start_xml, final_xml, is_initial)
>   File "/usr/lib/python2.6/site-packages/virtinst/Guest.py", line 1252, in
> _create_guest
>     dom = self.conn.createLinux(start_xml or final_xml, 0)
>   File "/usr/lib64/python2.6/site-packages/libvirt.py", line 1346, in
> createLinux
>     if ret is None:raise libvirtError('virDomainCreateLinux() failed',
> conn=self)
> libvirtError: internal error Process exited while reading console log output:
> char device redirected to /dev/pts/5
> qemu: could not open disk image /var/lib/libvirt/images/xx.img: Inappropriate
> ioctl for device
> 
> And I check the disk img type
> # qemu-img info /var/lib/libvirt/images/xx.img
> image: /var/lib/libvirt/images/xx.img
> file format: raw
> virtual size: 5.0G (5368709120 bytes)
> disk size: 0
> 
> So this disk file format is actually raw,not qcow2 as selected. Then installation display an error.

Expected results:
According to BZ #620878 comment #11, Choosing 'Customize before
install' and changing the format type in the disk details section is not
expected to change the format when creating the new disk image.

So for clear virt-manager UI design,it is better to desensitize the format combobox if the user isn't selecting preexisting storage.

Additional info:

Comment 3 Huming Jiang 2011-03-16 08:21:49 UTC
Hi, Cole Robinson:

Scene 1:
   guest creation using default. At the end of the install wizard, select 'Customize before install', go to the disk details section,click 'Advanced options', and the 'storage format' is 'raw' and also readonly. after 'Begin installation', the guest could be boot successfully.

Scene 2:
a. guest creation using default. At the end of the install wizard, select 'Customize before install', go to the disk details section,remove 'Disk 1',then 'Add hardware',choose the 'storage',and set the 'storage format' as 'qcow2'. After 'Begin installation', the guest could be boot successfully.

b. Open the newly installed guest, choose 'View'->'Detail'-> the added disk, then click the 'Advance options', set the 'Storage format' as 'raw', and 'Apply', then power on the guest, it will fail: 'No bootable device'.


Both scene 1 and scene 2 are OK?

Comment 5 Cole Robinson 2011-03-21 17:09:02 UTC
Both scenarios are expected. Particularly in scene 2, if you start with a qcow2 disk but explicitly set the format to raw, the guest is not expected to boot.

Comment 6 Huming Jiang 2011-03-22 02:51:47 UTC
Verfied it on build :
virt-manager-0.8.6-3.el6.noarch
libvirt-0.8.7-13.el6.x86_64
qemu-kvm-0.12.1.2-2.150.el6.x86_64
kernel-2.6.32-120.el6.x86_64

Steps:
1.  #virt-manager; 

2. Guest creation using default. At the end of the install wizard, select
'Customize before install';

3. Go to the disk details section,click 'Advanced options', and the 'storage format' is 'raw' and also readonly.;

4. after 'Begin installation', the guest could be boot successfully.

Verification is passed.

Comment 7 mliu 2011-04-18 06:53:48 UTC
Verfied it Pass on build :
virt-manager-0.8.6-3.el6.noarch
libvirt-0.8.7-17.el6.x86_64
qemu-kvm-0.12.1.2-2.153.el6.x86_64
kernel-2.6.32-130.el6.x86_64

Comment 8 errata-xmlrpc 2011-05-19 13:47:53 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-0637.html