python-vm-builder --raw doesn't set size correctly
This bug report was converted into a question: question #115631: python-vm-builder --raw doesn't set size correctly.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
vm-builder (Ubuntu) |
Invalid
|
Medium
|
Soren Hansen |
Bug Description
Binary package hint: python-vm-builder
When using the --raw option with an LVM volume as the target to create a VM, the default size is 5G. This isn't a problem if rootsize + swapsize + optsize falls within 5GB, but if you exceed the 5GB default size, vmbuilder throws an exception (shown below). To make this concrete here is what I am trying to do. I create a logical volume with size 10GB, and on this I would like to have an 8GB root and 2GB swap partition. There should be enough space, but I'm being told otherwise. There should be a way to specify the size of the raw device, or simply ignore the size when raw is being used. I can work up a patch to add a size option to the command line if it would help.
vmbuilder kvm ubuntu --debug --verbose -c vmbuilder.cfg --raw /dev/tungsten/
Traceback (most recent call last):
File "/usr/bin/
VMBuilder.run()
File "/usr/lib/
frontend.run()
File "/usr/lib/
self.
File "/usr/lib/
disk.
File "/usr/lib/
raise Exception(
Exception: Partition is out of bounds. start=7168, end=9215, disksize=5120
root@tungsten:~# vmbuilder kvm ubuntu --debug --verbose -c vmbuilder.cfg --raw /dev/tungsten/
Traceback (most recent call last):
File "/usr/bin/
VMBuilder.run()
File "/usr/lib/
frontend.run()
File "/usr/lib/
self.
File "/usr/lib/
disk.
File "/usr/lib/
raise Exception(
Exception: Partition is out of bounds. start=8192, end=10239, disksize=5120
Output of lsb_release -rd:
Description: Ubuntu 8.10
Release: 8.10
Output of apt-cache policy python-vm-builder:
apt-cache policy python-vm-builder
python-vm-builder:
Installed: 0.9-0ubuntu3.1
Candidate: 0.9-0ubuntu3.1
Version table:
*** 0.9-0ubuntu3.1 0
500 http://
500 http://
100 /var/lib/
0.9-0ubuntu3 0
500 http://
Expected outcome: VM successfully created on the LVM partition that was previously allocated.
Actual outcome: Exception thrown due to an incorrect assumption about the size of the raw device.
Related branches
- Soren Hansen: Needs Fixing
Changed in vm-builder (Ubuntu): | |
assignee: | Nick Barcet (nijaba) → Soren Hansen (soren) |
We were indeed mistakenly setting a maximum size of 5G for raw devices for which we should not assume the size. This should now be fixed. Of course there is no telling of what happens if the device is smaller than what you try to fit into it, but I do not see any obvious way to determine reliably the size of the raw device passed considering the various type that can be used. Ideas welcome...
While at it I also realized that it was not possible to use --raw multiple times as is was possible to do with the bash implementation. It is quite useful when used together with --part when you specify multiple disk. I fixed that as well.