Bug 655025

Summary: vdi image type for qemu disk driver
Product: [Community] Virtualization Tools Reporter: Benjamin Hagemann <benny>
Component: libvirtAssignee: Martin Kletzander <mkletzan>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: low    
Version: unspecifiedCC: crobinso, dallan, mattia.verga, mkletzan, moez.roy, xen-maint
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-04-17 06:44: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:
Attachments:
Description Flags
adds the vdi file type support none

Description Benjamin Hagemann 2010-11-19 11:45:32 UTC
I want to use a .vdi image with libvirt / KVM and qemu, but do not find the right driver type for qemu.

I use libvirt (0.7.5-5ubuntu27.7) with KVM / qemu (0.12.3+noroms-0ubuntu9.2) - Ubuntu 10.04.1 LTS

After an update a new libvirt version come with a new option:

<driver name='qemu' type='vdi'/>

-----
  <devices>                                                                     
    <emulator>/usr/bin/kvm</emulator>                                           
    <disk type='file' device='disk'>                                            
                                                                                
      <driver name='qemu' type='vdi'/>                                          
                                                                                
      <source file='/path/image.vdi'/>                                          
      <target dev='hda' bus='ide'/>                                             
    </disk>                                                                     
-----
              
But when I try "type=vdi" I got in the Log-File:                                
                                                                                
  libvir: Security Labeling error : error calling aa_change_profile()           
                                                                                
so I checked:                                                                   
                                                                                
  cat vdi-machine.xml | /usr/lib/libvirt/virt-aa-helper -r --uuid               
libvirt-XXXXXXXX-XXXXX-XXXX-XXXX-XXXXXXXXXXXX --dryrun -p 0                     
  libvir: Domain Config error : internal error unknown disk format 'vdi'        
for image.vdi                                                                   
  virt-aa-helper: error: invalid VM definition                                  
                                                                                
Next I checked libvirt.org:                                                     
http://libvirt.org/storage.html                                                 
                                                                                
  Valid volume format types                                                     
  raw, bochs, cloop, cow, dmg, iso, qcow, qcow2, vmdk, vpc                      
                                                                                
=> But what is the right type for .vdi-Images?

Comment 1 Pete Beardmore 2012-09-16 02:21:45 UTC
Created attachment 613369 [details]
adds the vdi file type support


it works.

studying details of the vdi structure on the likes of https://forums.virtualbox.org/viewtopic.php?t=8046 would lead to a less trivial solution to the rather sparse struct that i created, but alas, life is short

cheers

Comment 2 Dave Allan 2012-09-17 13:17:22 UTC
(In reply to comment #1)
> Created attachment 613369 [details]
> adds the vdi file type support

Pete, many thanks for the patch.  Would you mind sending it to the mailing list?  That's the fastest way to get it ack'd.  Dave

Comment 3 Mattia Verga 2012-12-09 11:53:07 UTC
Any news on that patch?
In Virtual Machine Manager 0.9.4 and libvirt 0.10.2.1-4.fc18.x86_64 I'm able to choose "vdi" type, but the VM fails to start.
Please, either enable vdi support or remove that type from the list to not generate confusion to users.

Comment 4 Moez Roy 2013-04-16 23:57:20 UTC
(In reply to comment #2)
> (In reply to comment #1)
> > Created attachment 613369 [details]
> > adds the vdi file type support
> 
> Pete, many thanks for the patch.  Would you mind sending it to the mailing
> list?  That's the fastest way to get it ack'd.  Dave

Was it sent to the mailing list???

Comment 5 Martin Kletzander 2013-04-17 06:44:55 UTC
It looks like the patch never made it to the list, but I added the support for VDI in commit v1.0.2-40-g027bf2e:

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

    Add basic support for VDI images

And size probing was fixed in commit v1.0.3-67-g6e46477:

commit 6e46477c23bfed730689fb902ff33c8ca7413ef0
Author: Ján Tomko <jtomko>
Date:   Thu Mar 14 13:24:03 2013 +0100

    Fix size probing for VDI images