I've had similar problems using --raw. Here is the vmbuilder debug
output from attempting to create an ubuntu guest using kvm and libvirt
on a system running 10.04. First I create a 22Gb qcow2 file with the
"preallocation=metadata" option, which preallocates the entire file.

r...@xxxxxx:/opt/virtual-machines# mkdir dev-6
r...@xxxxxx:/opt/virtual-machines# qemu-img create -f qcow2 -o 
preallocation=metadata ./dev-6/dev-6.qcow2 22G
Formatting 'dev-6.qcow2', fmt=qcow2 size=23622320128 encryption=off 
cluster_size=0 preallocation='metadata' 
r...@xxxxxx:/opt/virtual-machines# ls -al ./dev-6/dev-6.qcow2 
-rw-r--r-- 1 root root 23626186752 2010-12-30 17:18 ./dev-6/dev-6.qcow2
r...@xxxxxx:/opt/virtual-machines# file ./dev-6/dev-6.qcow2 
./dev-6/dev-6.qcow2: Qemu Image, Format: Qcow , Version: 2

This is the partition file that I use in vmbuilder.

r...@xxxxxx:/opt/virtual-machines# cat config/default.partition 
root 20480
swap 1024
---

This is the vmbuilder command I use to create the guest.

r...@xxxxxx:/opt/virtual-machines# vmbuilder kvm ubuntu -v --debug \
 --raw=/opt/virtual-machines/dev-6/dev-6.qcow2 \
 --part /opt/virtual-machines/config/default.partition --user=ubuntu 
--pass=ubuntu \
 --arch amd64 --suite lucid --flavour=virtual --mirror 
http://nas01.example.com/ubuntu/ \
 --timezone 'America/Los_Angeles' --mem 1024 --hostname dev-6 --domain 
example.com \
 --ip 192.168.1.75 --mask 255.255.255.0 --gw 192.168.1.1 --dns 192.168.1.5 \
--libvirt=qemu:///system --bridge=veth1 --addpkg=acpid --addpkg=openssh-server 
--addpkg=wget

The output from vmbuilder with the --debug and -v switch is attached.

As Curt reported the --raw option is ignored. vmbuilder created a new
directory called "ubuntu-kvm" and created two qcow2 files in it.

r...@xxxxxx:/opt/virtual-machines# ls -al ubuntu-kvm/
total 410848
drwxr-xr-x 2 root         root      4096 2010-12-30 17:29 .
drwxr-xr-x 5 root         root      4096 2010-12-30 17:25 ..
-rwx---r-x 1 root         root        96 2010-12-30 17:29 run.sh
-rw-r--r-- 1 libvirt-qemu kvm  420544512 2010-12-30 17:29 tmph29kxM.qcow2
-rw-r--r-- 1 libvirt-qemu kvm     393216 2010-12-30 17:29 tmpxxnl5e.qcow2

If I log into the system, after editing the XML definition with virsh to
change the disk type from "raw" to "qcow2" so the guest will boot, this
is what df and fdisk show me.

ubu...@dev-6:~$ df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda1             19684932    544728  18140256   3% /
none                    509476       156    509320   1% /dev
none                    511832         0    511832   0% /dev/shm
none                    511832        32    511800   1% /var/run
none                    511832         0    511832   0% /var/lock
none                    511832         0    511832   0% /lib/init/rw
ubu...@dev-6:~$ swapon -s
Filename                                Type            Size    Used    Priority
/dev/sda2                               partition       999416  0       -1

ubu...@dev-6:~$ sudo fdisk /dev/sda
[sudo] password for ubuntu: 

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c') and change display units to
         sectors (command 'u').

Command (m for help): p

Disk /dev/sda: 22.5 GB, 22549626880 bytes
4 heads, 32 sectors/track, 344080 cylinders
Units = cylinders of 128 * 512 = 65536 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000b9abb

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1      312485    19999023   83  Linux
/dev/sda2          312497      328112      999424   82  Linux swap / Solaris

Command (m for help): quit

ubu...@dev-6:~$ ls -al /dev/sdb
brw-rw---- 1 root disk 8, 16 2010-12-30 17:49 /dev/sdb
ubu...@dev-6:~$ sudo fdisk /dev/sdb
You must set cylinders.
You can do this from the extra functions menu.

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c') and change display units to
         sectors (command 'u').

Command (m for help): p

Disk /dev/sdb: 1 MB, 1048576 bytes
255 heads, 63 sectors/track, 0 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000d3dc9

So my partition file was read, although it looks as if I should delete
the --- at the end of it as this causes a 1M /dev/sdb to be created. Am
I not understanding what --raw is supposed to do?



** Attachment added: "vmbuilder output with --debug and -v flags"
   
https://bugs.launchpad.net/ubuntu/+source/vm-builder/+bug/573171/+attachment/1780047/+files/attachment.txt

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to vm-builder in ubuntu.
https://bugs.launchpad.net/bugs/573171

Title:
  vmbuilder sometimes ignores --raw option

-- 
Ubuntu-server-bugs mailing list
Ubuntu-server-bugs@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs

Reply via email to