vmbuilder XML is incomplete with libvirt 0.8.3 (No bootable devices)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
vm-builder (Ubuntu) |
Fix Released
|
High
|
Jamie Strandboge | ||
Lucid |
Fix Released
|
High
|
Jamie Strandboge | ||
Maverick |
Fix Released
|
High
|
Jamie Strandboge | ||
Natty |
Fix Released
|
High
|
Jamie Strandboge |
Bug Description
Binary package hint: vmbuilder
SRU
1. libvirt 0.8.3 and later (and the upcoming libvirt update for lucid-security) does not probe qemu disks for the image format and defaults to 'raw' when the format is not specified in the XML. This breaks vmbuilder because the version in maverick does not specify a format in the XML.
WORKAROUND:
After creating, use '/usr/sbin/
2. this is not yet fixed upstream (or Natty), but is ACKd by upstream
3. Patch adjusts VMbuilder/disk.py to have a new 'self.format_type' attribute. This attribute will normally be 'None', but will be set when a disk is convert()ed. VMbuilder/
4a. TEST CASE 1 (in maverick release):
$ sudo vmbuilder kvm ubuntu --suite lucid --flavour virtual --arch i386 -o --libvirt qemu:///system
$ virsh start ubuntu
$ virt-viewer ubuntu
At this point the VM will have started, but shows 'No bootable devices' if unpatched. If patched, it should boot up fine.
4b. TEST CASE 2 (don't regress --raw (first delete the previous 'ubuntu' domain)):
$ qemu-img create /tmp/foo.img 5G
$ sudo /sbin/losetup /dev/loop1 /tmp/foo.img
$ sudo vmbuilder kvm ubuntu --suite lucid --flavour virtual --arch i386 -o --libvirt qemu:///system --raw=/dev/loop1
$ virsh --connect=
$ virt-viewer --connect=
At this point the VM should be started and running.
5. Risk of regression is considered low. Patch is not intrusive and only will add the extra XML only if a disk is converted, so it should affect no other parts of libvirt. Since vm-builder with libvirt and qcow2 disks (the default) are currently broken, there is no risk of regression in the libvirt code. Tests show that --raw still works properly too.
Changed in vm-builder (Ubuntu): | |
importance: | Undecided → High |
status: | New → Triaged |
description: | updated |
Changed in vm-builder (Ubuntu Maverick): | |
status: | New → Triaged |
Changed in vm-builder (Ubuntu Lucid): | |
status: | New → Triaged |
importance: | Undecided → High |
Changed in vm-builder (Ubuntu Maverick): | |
importance: | Undecided → High |
description: | updated |
Changed in vm-builder (Ubuntu Maverick): | |
status: | Triaged → In Progress |
description: | updated |
description: | updated |
description: | updated |
tags: |
added: verification-done removed: verification-needed |
tags: | added: verification-needed |
tags: | added: testcase |
Attached is a preliminary patch for vm-builder on maverick which adjusts VMbuilder/disk.py to have a new 'self.format_type' attribute. This attribute will normally be 'None', but will be set when a disk is convert()ed. VMbuilder/ plugins/ libvirt/ templates/ libvirtxml* .tmpl is then adjusted to supply the proper qemu image format to libvirt if the format_type is set for the disk. Since libvirt defaults to 'raw' for unspecified format types, this covers the default 'qcow2' case and avoids setting the format type when using --raw.
Tested using:
$ sudo vmbuilder kvm ubuntu --suite lucid --flavour virtual --arch i386 -o --libvirt qemu:///system
$ sudo vmbuilder kvm ubuntu --suite lucid --flavour virtual --arch i386 -o --libvirt qemu:///system --raw /dev/loop1