device mappings for partitions not removed after build using --raw, leading to filesystem corruption
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
vm-builder (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Lucid |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
SRU Request for Lucid
[Impact] This bug occurs systematically when the --raw option is used to create a VM. This results in file system data corruption messages in the VM created.
[Development/Stable Fix] Fixed in 0.12.4+
[ Louis Bouchard ]
* Remove dev maps created by parted. (LP: #531599)
[Test Case] section with detailed instructions how to reproduce the bug. These should allow someone who is not familiar with the affected package to reproduce the bug and verify that the updated package fixes the problem.
On an unmodified system with an existging 8Gb LVM volume named /dev/sysvg/
ubuntu-vm-builder kvm natty --lang=en_US --hostname=testvm --rootsize=8000 --mem=10240 --cpus=2 --rootpass=X --arch=amd64 --libvirt=
On an unmodified system, once completed, the dmsetup list command will show the following :
$ dmsetup ls
sysvg-testvmvol1p1 (252, 2)
sysvg-testvmvol1 (252, 1)
sysvg-testvmvol (252, 0)
The sysvg-testvmvol1p1 table should not be there
[Regression Potential] This fix needs to be backported to the LTS version to avoid potential file system corruption.
---
I've tried to install a vm using an LVM logical volume with --raw. The problem was that I used a too small logical volume.
vmbuilder told me:
2010-03-03 21:33:59,923 INFO : Adding partition table to disk image: /dev/mapper/
2010-03-03 21:34:00,007 INFO : Adding type 1 partition to disk image: /dev/mapper/
2010-03-03 21:34:00,879 INFO : Adding type 3 partition to disk image: /dev/mapper/
2010-03-03 21:34:00,890 INFO : [0] ../../libparted
2010-03-03 21:34:00,892 INFO : Cleaning up
Traceback (most recent call last):
File "/usr/bin/
VMBuilder.run()
File "/usr/lib/
frontend.run()
File "/usr/lib/
vm.create()
File "/usr/lib/
disk.
File "/usr/lib/
disk.
File "/usr/lib/
part.
File "/usr/lib/
run_
File "/usr/lib/
raise VMBuilderException, "Process (%s) returned %d. stdout: %s, stderr: %s" % (args.__repr__(), status, stdout, stderr)
VMBuilder.
, stderr: [0] ../../libparted
While this is a lot of noise, telling me 'location 1032 is outside of the device...' made me recognize my mistake.
The problem is that I wasn't able to just remove the logical volume, create a bigger one and start again:
sudo lvremove /dev/mapper/
Can't remove open logical volume "test-disk"
The reason is that there's another device map set up by vmbuilder: /dev/mapper/
This is because the first (root) partition did fit on the logical volume, but only the second (swap) one not.
I had to drop the device mapping using
sudo dmsetup remove /dev/mapper/
This would allow me to lvremove the logical volume now.
I would expect that vmbuilder cleans up on exceptions like this and remove the device mappings for the inner partitions.
Related branches
- Serge Hallyn: Needs Resubmitting
- Scott Moser: Pending requested
-
Diff: 6519 lines (+6029/-0) (has conflicts)91 files modified.bzrignore (+11/-0)
AUTHORS (+29/-0)
MANIFEST.in (+7/-0)
Makefile (+19/-0)
NEWS (+58/-0)
VMBuilder/__init__.py (+135/-0)
VMBuilder/contrib/cli.py (+450/-0)
VMBuilder/disk.py (+549/-0)
VMBuilder/distro.py (+99/-0)
VMBuilder/exception.py (+27/-0)
VMBuilder/frontend.py (+53/-0)
VMBuilder/hypervisor.py (+121/-0)
VMBuilder/log.py (+36/-0)
VMBuilder/plugins/__init__.py (+329/-0)
VMBuilder/plugins/ec2/__init__.py (+150/-0)
VMBuilder/plugins/ec2/templates/ec2_version.tmpl (+1/-0)
VMBuilder/plugins/ec2/templates/landscape_client.tmpl (+1/-0)
VMBuilder/plugins/ec2/templates/sshd_config.tmpl (+77/-0)
VMBuilder/plugins/ec2/templates/sudoers.tmpl (+29/-0)
VMBuilder/plugins/firstscripts/__init__.py (+65/-0)
VMBuilder/plugins/firstscripts/templates/firstbootrc.tmpl (+10/-0)
VMBuilder/plugins/firstscripts/templates/firstloginrc.tmpl (+10/-0)
VMBuilder/plugins/kvm/__init__.py (+19/-0)
VMBuilder/plugins/kvm/vm.py (+71/-0)
VMBuilder/plugins/libvirt/__init__.py (+87/-0)
VMBuilder/plugins/libvirt/templates/libvirtxml.tmpl (+46/-0)
VMBuilder/plugins/libvirt/templates/libvirtxml_fsimage.tmpl (+33/-0)
VMBuilder/plugins/network/__init__.py (+158/-0)
VMBuilder/plugins/postinst/__init__.py (+77/-0)
VMBuilder/plugins/ubuntu/__init__.py (+19/-0)
VMBuilder/plugins/ubuntu/dapper.py (+375/-0)
VMBuilder/plugins/ubuntu/distro.py (+294/-0)
VMBuilder/plugins/ubuntu/edgy.py (+84/-0)
VMBuilder/plugins/ubuntu/feisty.py (+26/-0)
VMBuilder/plugins/ubuntu/gutsy.py (+26/-0)
VMBuilder/plugins/ubuntu/hardy.py (+58/-0)
VMBuilder/plugins/ubuntu/intrepid.py (+45/-0)
VMBuilder/plugins/ubuntu/jaunty.py (+40/-0)
VMBuilder/plugins/ubuntu/karmic.py (+33/-0)
VMBuilder/plugins/ubuntu/lucid.py (+23/-0)
VMBuilder/plugins/ubuntu/maverick.py (+23/-0)
VMBuilder/plugins/ubuntu/natty.py (+22/-0)
VMBuilder/plugins/ubuntu/oneiric.py (+28/-0)
VMBuilder/plugins/ubuntu/precise.py (+23/-0)
VMBuilder/plugins/ubuntu/suite.py (+28/-0)
VMBuilder/plugins/ubuntu/templates/51_update-motd-hardy.tmpl (+10/-0)
VMBuilder/plugins/ubuntu/templates/51_update-motd.tmpl (+10/-0)
VMBuilder/plugins/ubuntu/templates/dapper_fstab.tmpl (+10/-0)
VMBuilder/plugins/ubuntu/templates/dapper_fstab_fsimage.tmpl (+10/-0)
VMBuilder/plugins/ubuntu/templates/devicemap.tmpl (+3/-0)
VMBuilder/plugins/ubuntu/templates/etc_hosts.tmpl (+10/-0)
VMBuilder/plugins/ubuntu/templates/initctl-stub.tmpl (+3/-0)
VMBuilder/plugins/ubuntu/templates/interfaces.tmpl (+22/-0)
VMBuilder/plugins/ubuntu/templates/is-compat-env.tmpl (+3/-0)
VMBuilder/plugins/ubuntu/templates/kernelimg.tmpl (+8/-0)
VMBuilder/plugins/ubuntu/templates/locale.tmpl (+1/-0)
VMBuilder/plugins/ubuntu/templates/nostart-policy-rc.d.tmpl (+18/-0)
VMBuilder/plugins/ubuntu/templates/sources.list.tmpl (+15/-0)
VMBuilder/plugins/ubuntu/templates/sudoers.tmpl (+23/-0)
VMBuilder/plugins/ubuntu/templates/timezone.tmpl (+1/-0)
VMBuilder/plugins/ubuntu/templates/upstart.tmpl (+16/-0)
VMBuilder/plugins/ubuntu/templates/xen-ld-so-conf.tmpl (+1/-0)
VMBuilder/plugins/ubuntu/tests/test_distro.py (+14/-0)
VMBuilder/plugins/virtualbox/__init__.py (+19/-0)
VMBuilder/plugins/virtualbox/templates/vm_deploy_script.tmpl (+65/-0)
VMBuilder/plugins/virtualbox/vm.py (+59/-0)
VMBuilder/plugins/vmware/__init__.py (+19/-0)
VMBuilder/plugins/vmware/templates/esxi.vmx.tmpl (+57/-0)
VMBuilder/plugins/vmware/templates/flat.vmdk.tmpl (+19/-0)
VMBuilder/plugins/vmware/templates/vmware.tmpl (+30/-0)
VMBuilder/plugins/vmware/vm.py (+128/-0)
VMBuilder/plugins/xen/__init__.py (+20/-0)
VMBuilder/plugins/xen/vm.py (+89/-0)
VMBuilder/tests/__init__.py (+17/-0)
VMBuilder/tests/base_test.py (+67/-0)
VMBuilder/tests/disk_tests.py (+289/-0)
VMBuilder/tests/network_tests.py (+95/-0)
VMBuilder/tests/plugin_tests.py (+119/-0)
VMBuilder/tests/ubuntu_tests.py (+39/-0)
VMBuilder/tests/util_tests.py (+10/-0)
VMBuilder/util.py (+224/-0)
VMBuilder/vm.py (+257/-0)
examples/ec2-amd64-part-file.txt (+2/-0)
examples/ec2-firstboot.sh (+20/-0)
examples/ec2-firstlogin.sh (+49/-0)
examples/ec2-i386-part-file.txt (+3/-0)
setup.py (+26/-0)
ubuntu-vm-builder (+24/-0)
ubuntu-vm-builder.1 (+7/-0)
vmbuilder (+24/-0)
vmbuilder.1 (+170/-0)
Changed in vm-builder (Ubuntu): | |
status: | Incomplete → Confirmed |
no longer affects: | vmbuilder |
description: | updated |
On Wed, Mar 03, 2010 at 09:06:21PM -0000, Simon Huerlimann wrote:
> Public bug reported:
>
> I've tried to install a vm using an LVM logical volume with --raw. The
> problem was that I used a too small logical volume.
Which version of VMBuilder are you using?
If you use "ubuntu-bug python-vm-builder" to report the bug, all this
information gets included automatically.
status incomplete
-- www.ubuntu. com/
Soren Hansen
Ubuntu Developer
http://