vmbuilder create ubuntu-kvm directory even when using --raw

Bug #569530 reported by Simon Huerlimann
36
This bug affects 6 people
Affects Status Importance Assigned to Milestone
vm-builder (Ubuntu)
Confirmed
Low
Unassigned

Bug Description

When calling vmbuilder with --raw, it still creates a directory <distro>-<hypervisor> in the current working directory. All it contains is a file 'run.sh'. Content is similar to this:

#!/bin/sh
exec kvm -m 2048 -smp 1 -drive file=kvm-web03.demo "$@"

ProblemType: Bug
DistroRelease: Ubuntu 10.04
Package: python-vm-builder 0.12.3-0ubuntu1
ProcVersionSignature: Ubuntu 2.6.32-21.32-server 2.6.32.11+drm33.2
Uname: Linux 2.6.32-21-server x86_64
Architecture: amd64
Date: Sat Apr 24 13:48:24 2010
InstallationMedia: Ubuntu-Server 10.04 "Lucid Lynx" - Alpha amd64 (20100410)
PackageArchitecture: all
ProcEnviron:
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: vm-builder

Revision history for this message
Simon Huerlimann (huerlisi) wrote :
description: updated
Revision history for this message
Simon Huerlimann (huerlisi) wrote :

This is especially tricky as it won't let you create two raw vms (without specifying --destdir) in a row from the same directory. This is the output for the second run:

2010-04-25 06:21:52,984 ERROR : ubuntu-kvm already exists
Traceback (most recent call last):
  File "/usr/bin/vmbuilder", line 24, in <module>
    cli.main()
  File "/usr/lib/python2.6/dist-packages/VMBuilder/contrib/cli.py", line 81, in main
    raise VMBuilderUserError('%s already exists' % destdir)
VMBuilder.exception.VMBuilderUserError: ubuntu-kvm already exists

Revision history for this message
Chuck Short (zulcss) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. Please answer these questions:
1. Is this reproducible?
2. If so, what specific steps should we take to recreate this bug? Be as detailed as possible.
This will help us to find and resolve the problem.

Changed in vm-builder (Ubuntu):
importance: Undecided → Low
status: New → Incomplete
Revision history for this message
Simon Huerlimann (huerlisi) wrote :

Yes, it is reproducible.

Preconditions:
* an LVM group named leo02
* PWD were you can write...

The following steps should do it, assuming a LVM group leo02:
sudo lvcreate /dev/leo02 --name kvm-test01 --size 5G
sudo vmbuilder kvm ubuntu --addpkg=openssh-server --addpkg=unattended-upgrades, --addpkg=acpid --addpkg=puppet --domain=example.com --bridge=virbr0 --gw=10.0.0.1 --suite=lucid --libvirt=qemu:///system --ip=10.0.1.1 --hostname=test01 --raw=/dev/leo02/kvm-test01
# $PWD/ubuntu-kvm gets created, containing file run.sh

sudo lvcreate /dev/leo02 --name kvm-test02 --size 5G
sudo vmbuilder kvm ubuntu --addpkg=openssh-server --addpkg=unattended-upgrades, --addpkg=acpid --addpkg=puppet --domain=example.com --bridge=virbr0 --gw=10.0.0.1 --suite=lucid --libvirt=qemu:///system --ip=10.0.1.2 --hostname=test02 --raw=/dev/leo02/kvm-test02
# Raises the following error:
2010-04-29 15:17:27,354 ERROR : ubuntu-kvm already exists
Traceback (most recent call last):
  File "/usr/bin/vmbuilder", line 24, in <module>
    cli.main()
  File "/usr/lib/python2.6/dist-packages/VMBuilder/contrib/cli.py", line 81, in main
    raise VMBuilderUserError('%s already exists' % destdir)
VMBuilder.exception.VMBuilderUserError: ubuntu-kvm already exists

This is with python-vm-builder 0.12.3-0ubuntu1

Changed in vm-builder (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Whit Blauvelt (whit-launchpad) wrote :

Not sure if this is a related bug, or just a lack of documentation, but:

vmbuilder kvm ubuntu --suite lucid --flavour virtual --arch amd64 -o --libvirt qemu:///system

produces an ubuntu-kvm directory with, in this instance:

-rw-r--r-- 1 root root 396754944 2010-08-08 21:20 tmpEs8Mq4.qcow2
-rwx---r-x 1 root root 67 2010-08-08 21:21 run.sh

where run.sh consists of:

#!/bin/sh

exec kvm -m 128 -smp 1 -drive file=tmpEs8Mq4.qcow2 "$@"

and trying to run run.sh (which AFAIK is an undocumented file here) produces:

pci_add_option_rom: failed to find romfile "pxe-rtl8139.bin"
init kbd.
^CCould not open SDL display

(that last line after a control-C)

Is run.sh something that should be a final product? Or has vmbuilder got itself into an error state and quit in the middle somewhere, leaving that tmp*.qcow2 file and the run.sh which can't run it, and that would disappear if vmbuilder completed its job without error?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.