Bug 907530

Summary: Error occurs when add a storage with vdi format from virt-manager
Product: Red Hat Enterprise Linux 7 Reporter: Martin Kletzander <mkletzan>
Component: libvirtAssignee: Martin Kletzander <mkletzan>
Status: CLOSED CURRENTRELEASE QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0CC: acathrow, bili, cwei, dallan, famz, hhuang, juzhang, lcui, mjenner, mkletzan, moez.roy, mzhan, sluo, tzheng, zpeng
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libvirt-1.0.3-1.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 907289 Environment:
Last Closed: 2014-06-13 12:50:26 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:
Bug Depends On: 907289    
Bug Blocks:    

Description Martin Kletzander 2013-02-04 16:10:35 UTC
+++ This bug was initially created as a clone of Bug #907289 +++

Created attachment 692589 [details]
Debug info from virt-manager

Description of problem:
Error occurs when add a storage with vdi format from virt-manager

Version-Release number of selected component (if applicable):
virt-manager-0.9.4-4.el7.noarch
libvirt-1.0.0-1.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1. create new guest via virt-manager
2. during installation ,select "Customize configuration before install"
3. Add a new storage,set storage format as vdi,error occurs:Storage parameter error.'vdi' is not a valid format.
 
Actual results:
Error occurs when add a storage with vdi format from virt-manager on rhel7.
If virt-manager doesn't support vdi format,it should hide the format type vdi.

Expected results:
No error occurs when add a storage with vdi format from virt-manager and can be added successfully.

Additional info:
1.Attached the debug info from virt-manager.
2.Checked the issues on upstream,it also exists,and there is a bug 761300.

Comment 2 Martin Kletzander 2013-02-04 22:52:14 UTC
Moving to POST:

commit 027bf2ea373392027af3b29b1f644a8342961671
Author: Martin Kletzander <mkletzan>
Date:   Mon Feb 4 20:18:22 2013 +0100

    Add basic support for VDI images

Comment 3 Huang Wenlong 2013-03-06 08:44:06 UTC
Verify this bug with:
libvirt-1.0.3-1.el7.x86_64


1) create a vdi images 
qemu-img create -f vdi /tmp/vdi.img 1G 

2) add vdi image to domain 

3) then start domain  

4)check xml 

...
  <disk type='file' device='disk'>
      <driver name='qemu' type='vdi'/>
      <source file='/tmp/vdi.img'/>
      <target dev='hda' bus='ide'/>
      <alias name='ide0-0-0'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
...

libvirt can support vdi format .

Comment 4 EricLee 2014-02-20 02:30:36 UTC
Re-tested this bug with:
libvirt-1.1.1-23.el7.x86_64
qemu-kvm-rhev-1.5.3-48.el7.x86_64

1) create a vdi images 
# qemu-img create -f vdi /var/lib/libvirt/images/vdi.img 1G
Formatting '/var/lib/libvirt/images/vdi.img', fmt=vdi size=1073741824 static=off

# qemu-img info /var/lib/libvirt/images/vdi.img 
image: /var/lib/libvirt/images/vdi.img
file format: vdi
virtual size: 1.0G (1073741824 bytes)
disk size: 8.0K
cluster_size: 1048576

2) add vdi image to domain 
...
    <disk type='file' device='disk'>
      <driver name='qemu' type='vdi' cache='none'/>
      <source file='/var/lib/libvirt/images/vdi.img'/>
      <target dev='hdb' bus='ide'/>
      <address type='drive' controller='0' bus='0' target='0' unit='1'/>
    </disk>
...

3) then start domain  
# virsh start vm2
error: Failed to start domain vm2
error: internal error: process exited while connecting to monitor: qemu-kvm: -drive file=/tmp/vdi.img,if=none,id=drive-ide0-0-0,format=vdi: 'vdi' invalid format

I found qemu can not start with the cli too. Is there something changed in qemu?

# /usr/libexec/qemu-kvm -name vm2 -S -machine pc-i440fx-rhel7.0.0,accel=kvm,usb=off -m 128 -realtime mlock=off -smp 1,sockets=1,cores=1,threads=1 -uuid cec80b76-a872-436b-9f12-74b940d28ff6 -nographic -no-user-config -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/vm2.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-shutdown -no-acpi -boot strict=on -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -drive file=/tmp/vdi.img,if=none,id=drive-ide0-0-0,format=vdi -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 -drive file=/var/lib/libvirt/images/vdi1.img,if=none,id=drive-ide0-0-1,format=vdi,cache=none -device ide-hd,bus=ide.0,unit=1,drive=drive-ide0-0-1,id=ide0-0-1 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4

qemu-kvm: -drive file=/tmp/vdi.img,if=none,id=drive-ide0-0-0,format=vdi: 'vdi' invalid format

Comment 5 EricLee 2014-02-20 02:34:09 UTC
(In reply to EricLee from comment #4)
> Re-tested this bug with:
> libvirt-1.1.1-23.el7.x86_64
> qemu-kvm-rhev-1.5.3-48.el7.x86_64
> 
> 1) create a vdi images 
> # qemu-img create -f vdi /var/lib/libvirt/images/vdi.img 1G
> Formatting '/var/lib/libvirt/images/vdi.img', fmt=vdi size=1073741824
> static=off
> 
> # qemu-img info /var/lib/libvirt/images/vdi.img 
> image: /var/lib/libvirt/images/vdi.img
> file format: vdi
> virtual size: 1.0G (1073741824 bytes)
> disk size: 8.0K
> cluster_size: 1048576
> 
> 2) add vdi image to domain 
> ...
>     <disk type='file' device='disk'>
>       <driver name='qemu' type='vdi' cache='none'/>
>       <source file='/var/lib/libvirt/images/vdi.img'/>
>       <target dev='hdb' bus='ide'/>
>       <address type='drive' controller='0' bus='0' target='0' unit='1'/>
>     </disk>
> ...
> 
> 3) then start domain  
> # virsh start vm2
> error: Failed to start domain vm2
> error: internal error: process exited while connecting to monitor: qemu-kvm:
> -drive file=/tmp/vdi.img,if=none,id=drive-ide0-0-0,format=vdi: 'vdi' invalid
> format
> 
> I found qemu can not start with the cli too. Is there something changed in
> qemu?
> 
> # /usr/libexec/qemu-kvm -name vm2 -S -machine
> pc-i440fx-rhel7.0.0,accel=kvm,usb=off -m 128 -realtime mlock=off -smp
> 1,sockets=1,cores=1,threads=1 -uuid cec80b76-a872-436b-9f12-74b940d28ff6
> -nographic -no-user-config -nodefaults -chardev
> socket,id=charmonitor,path=/var/lib/libvirt/qemu/vm2.monitor,server,nowait
> -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-shutdown
> -no-acpi -boot strict=on -device
> piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -drive
> file=/tmp/vdi.img,if=none,id=drive-ide0-0-0,format=vdi -device
> ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 -drive
> file=/var/lib/libvirt/images/vdi1.img,if=none,id=drive-ide0-0-1,format=vdi,
> cache=none -device ide-hd,bus=ide.0,unit=1,drive=drive-ide0-0-1,id=ide0-0-1
> -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4
> 
> qemu-kvm: -drive file=/tmp/vdi.img,if=none,id=drive-ide0-0-0,format=vdi:
> 'vdi' invalid format

Sorry, correct the qemu cli:
# /usr/libexec/qemu-kvm -name vm2 -S -machine pc-i440fx-rhel7.0.0,accel=kvm,usb=off -m 128 -realtime mlock=off -smp 1,sockets=1,cores=1,threads=1 -uuid cec80b76-a872-436b-9f12-74b940d28ff6 -nographic -no-user-config -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/vm2.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-shutdown -no-acpi -boot strict=on -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -drive file=/var/lib/libvirt/images/vdi.img,if=none,id=drive-ide0-0-1,format=vdi,cache=none -device ide-hd,bus=ide.0,unit=1,drive=drive-ide0-0-1,id=ide0-0-1,bootindex=1 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4
qemu-kvm: -drive file=/var/lib/libvirt/images/vdi.img,if=none,id=drive-ide0-0-1,format=vdi,cache=none: 'vdi' invalid format

Comment 9 Fam Zheng 2014-02-24 07:25:58 UTC
Hi Junyi,

VDI is only recognized in qemu-img, so we should be able to convert to/from this format. (not quite sure about how much we support it, though)

However it's not whitelisted for qemu-kvm, so attaching to a VM is not possible or supported.

Thanks,
Fam

Comment 10 juzhang 2014-02-24 07:32:34 UTC
(In reply to Fam Zheng from comment #9)
> Hi Junyi,
> 
> VDI is only recognized in qemu-img, so we should be able to convert to/from
> this format. (not quite sure about how much we support it, though)
> 
> However it's not whitelisted for qemu-kvm, so attaching to a VM is not
> possible or supported.
> 
> Thanks,
> Fam

Thanks Fam.

Best Regards,
Junyi

Comment 11 EricLee 2014-02-24 07:56:16 UTC
(In reply to Huang Wenlong from comment #3)
> Verify this bug with:
> libvirt-1.0.3-1.el7.x86_64
> 
> 
> 1) create a vdi images 
> qemu-img create -f vdi /tmp/vdi.img 1G 
> 
> 2) add vdi image to domain 
> 
> 3) then start domain  
> 
> 4)check xml 
> 
> ...
>   <disk type='file' device='disk'>
>       <driver name='qemu' type='vdi'/>
>       <source file='/tmp/vdi.img'/>
>       <target dev='hda' bus='ide'/>
>       <alias name='ide0-0-0'/>
>       <address type='drive' controller='0' bus='0' target='0' unit='0'/>
>     </disk>
> ...
> 
> libvirt can support vdi format .

As comment #10 said that vdi format is not whitelisted for qemu-kvm, so attaching to a VM is not possible or supporte, so the verified steps were only valid on the old version of qemu: qemu-kvm-1.3.0-6.el7.x86_64, another bug is tracking boot guest failed problem: bug 999288.

Comment 12 Ludek Smid 2014-06-13 12:50:26 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.