Bug 1028666

Summary: virt-builder fails if you select only --format but not --size: virt-resize: error: You cannot use --expand when there is no surplus [...]
Product: [Community] Virtualization Tools Reporter: Richard W.M. Jones <rjones>
Component: libguestfsAssignee: Richard W.M. Jones <rjones>
Status: CLOSED UPSTREAM QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: acathrow, mbooth
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-12-14 13:24:43 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Richard W.M. Jones 2013-11-09 09:30:02 UTC
Description of problem:

If you use --format without --size, then you get an error:

virt-builder fedora-19 --format qcow2
[   0.0] Downloading: file:///home/rjones/d/libguestfs/builder/website/fedora-19.xz
[   1.0] Creating disk image: fedora-19.qcow2
[   1.0] Uncompressing: file:///home/rjones/d/libguestfs/builder/website/fedora-19.xz
[  15.0] Running virt-resize to expand the disk to 4.0G
virt-resize: error: You cannot use --expand when there is no surplus 
space to expand into.  You need to make the target disk larger by at 
least 1.3M.

virt-resize: If reporting bugs, run virt-resize with debugging enabled 
(-v) and include the complete output.
virt-builder: error: virt-resize failed

Version-Release number of selected component (if applicable):

libguestfs 1.25.7.

How reproducible:

100%

Steps to Reproduce:
1. See command line above.