qemu-img baseimage creation doesn't warn for image being smaller
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
qemu-kvm (Ubuntu) |
Invalid
|
Low
|
Unassigned |
Bug Description
Binary package hint: qemu-kvm
$ qemu-img create -b ../base-
should really raise a warning if ../base-
Creating an Image of the same resulted in a successful boot though.
In fact, If QEmu doesn't handle a differnent size, even a bigger one, I don't see why qemu-img create -b ... should take a size argument at all. But then again, I don't know whether QEmu handles images backed by a smaller base image.
In any case: The command line tool is very misleading. Right now it reads:
$ qemu-img
qemu-img version 0.11.0, Copyright (c) 2004-2008 Fabrice Bellard
usage: qemu-img command [command options]
QEMU disk image utility
Command syntax:
check [-f fmt] filename
create [-F fmt] [-b base_image] [-f fmt] [-o options] filename [size]
commit [-f fmt] filename
convert [-c] [-f fmt] [-O output_fmt] [-o options] [-B output_base_image] filename [filename2 [...]] output_filename
info [-f fmt] filename
snapshot [-l | -a snapshot | -c snapshot | -d snapshot] filename
Command parameters:
'filename' is a disk image filename
'base_image' is the read-only disk image which is used as base for a copy on
write image; the copy on write image only stores the modified data
'output_
image of the specified base image; 'output_base_image' should have the same
content as the input's base image, however the path, image format, etc may
differ
'fmt' is the disk image format. It is guessed automatically in most cases
'size' is the disk image size in kilobytes. Optional suffixes
'M' (megabyte, 1024 * 1024) and 'G' (gigabyte, 1024 * 1024 * 1024) are
supported any 'k' or 'K' is ignored
'output_filename' is the destination disk image filename
'output_fmt' is the destination format
'options' is a comma separated list of format specific options in a
name=value format. Use -o ? for an overview of the options supported by the
used format
'-c' indicates that target image must be compressed (qcow format only)
'-h' with or without a command shows this help and lists the supported formats
Parameters to snapshot subcommand:
'snapshot' is the name of the snapshot to create, apply or delete
'-a' applies a snapshot (revert disk to saved state)
'-c' creates a snapshot
'-d' deletes a snapshot
'-l' lists all snapshots in the given image
Supported formats: cow qcow vmdk cloop dmg bochs vpc vvfat qcow2 parallels nbd host_cdrom host_floppy host_device raw tftp ftps ftp https http
and it doesn't mention the size problem at all. Even creation work without a single warning.
ProblemType: Bug
Architecture: amd64
Date: Sat Apr 17 18:17:28 2010
DistroRelease: Ubuntu 9.10
KvmCmdLine:
UID PID PPID C SZ RSS PSR STIME TTY TIME CMD
muelli 26589 26588 13 175490 505084 0 17:41 pts/15 00:04:50 kvm -m 512 -monitor stdio -S -hda elster.img -smb /tmp/ -snapshot
MachineType: LENOVO 766636G
Package: kvm 1:84+dfsg-
PccardctlIdent:
Socket 0:
no product info available
PccardctlStatus:
Socket 0:
no card
ProcCmdLine: root=/dev/
ProcVersionSign
SourcePackage: qemu-kvm
Uname: Linux 2.6.32-21-generic x86_64
dmi.bios.date: 03/12/2009
dmi.bios.vendor: LENOVO
dmi.bios.version: 7NETC0WW (2.20 )
dmi.board.name: 766636G
dmi.board.vendor: LENOVO
dmi.board.version: Not Available
dmi.chassis.
dmi.chassis.type: 10
dmi.chassis.vendor: LENOVO
dmi.chassis.
dmi.modalias: dmi:bvnLENOVO:
dmi.product.name: 766636G
dmi.product.
dmi.sys.vendor: LENOVO
Changed in qemu-kvm (Ubuntu): | |
importance: | Undecided → Low |
Changed in qemu-kvm (Ubuntu): | |
status: | New → Invalid |
What image format is the base image?
I just tested with qcow2 format and increased the size from 6g to 10g just fine (of course the file system size remained the same)
kvm-img create -b Lucid_64_Base.qcow2 -f qcow2 test_img.qcow2 10G
If you don't specify a format I think raw is used:
kvm-img create -b Lucid_64_Base.qcow2 test_img.qcow2 10G
Unknown option 'backing_file'
qemu-img: Backing file not supported for file format 'raw'
Try using kvm-img info [imagefile]
to see what format is being used.