Bug 1288689 - virt-builder does not resize partitions to fill image(?)
Summary: virt-builder does not resize partitions to fill image(?)
Keywords:
Status: CLOSED DUPLICATE of bug 1256743
Alias: None
Product: Fedora
Classification: Fedora
Component: libguestfs
Version: 23
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Richard W.M. Jones
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-12-05 02:09 UTC by Adam Williamson
Modified: 2015-12-07 09:16 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-12-05 07:37:03 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
complete console output of virt-builder command with -v -x (355.85 KB, text/plain)
2015-12-05 02:09 UTC, Adam Williamson
no flags Details

Description Adam Williamson 2015-12-05 02:09:48 UTC
Created attachment 1102488 [details]
complete console output of virt-builder command with -v -x

Another problem with virt-builder while building disk images for openQA use.

One of the images we need to build is basically a Workstation install of Fedora. To do this we use virt-builder to create a basic image of the desired release, then boot it and install the workstation package group.

Every time I try to create the F23 workstation base image, it fails at the point of installing the workstation package group, saying there isn't enough space:

Error Summary
-------------
Disk Requirements:
  At least 409MB more space needed on the / filesystem.

this seems to happen *no matter how big I make the image*. This is the command our script runs (I added -v -x):

virt-builder fedora-23 -v -x -o disk_f23_desktop_x86_64.img --size 20G --arch x86_64 --update --run-command "dnf -y groupinstall 'Fedora Workstation'" --selinux-relabel --root-password password:weakpassword --firstboot-command 'useradd -m -p "" ejohn'

but if I try it with --size 25G or --size 30G I get the exact same output from dnf - exactly 409MB more space needed.

Best I can tell from the logs, it seems like the / partition is initially created about 5GB big, and it's never resized - so I think the image itself is 20GB or 25GB or 30GB, but there's a bunch of empty space in there.

I'll attach the full log from the command as you can probably read it better than I can!

Comment 1 Richard W.M. Jones 2015-12-05 07:37:03 UTC
I think you need to install 'libguestfs-xfs' since (for some reason)
the Fedora 23 image is using XFS for its root filesystem.

In Rawhide, we added a Recommends dependency for libguestfs-xfs,
but that hasn't been added to Fedora 23.

Anyhow, WFM with Fedora 23 + libguestfs-xfs:

$ virt-builder fedora-23 --size 20G
[   0.1] Downloading: http://libguestfs.org/download/builder/fedora-23.xz
[   0.6] Planning how to build this image
[   0.6] Uncompressing
[  15.5] Resizing (using virt-resize) to expand the disk to 20.0G
[  43.5] Opening the new disk
[  59.5] Setting a random seed
[  59.5] Setting passwords
virt-builder: Setting random password of root to BzfREACh6aiNGzvc
[  60.5] Finishing off
                   Output file: fedora-23.img
                   Output size: 20.0G
                 Output format: raw
            Total usable space: 19.4G
                    Free space: 18.6G (95%)
$ virt-filesystems -a fedora-23.img --all --long -h
Name       Type        VFS   Label  MBR  Size  Parent
/dev/sda1  filesystem  ext4  -      -    500M  -
/dev/sda2  filesystem  swap  -      -    615M  -
/dev/sda3  filesystem  xfs   -      -    19G   -
/dev/sda1  partition   -     -      83   500M  /dev/sda
/dev/sda2  partition   -     -      82   615M  /dev/sda
/dev/sda3  partition   -     -      83   19G   /dev/sda
/dev/sda   device      -     -      -    20G   -

*** This bug has been marked as a duplicate of bug 1256743 ***

Comment 2 Adam Williamson 2015-12-05 17:15:32 UTC
OK, I'll try that. Assuming it's the problem: could virt-builder print a prominent warning/error when this happens (resize fails due to missing support tools)?

Comment 3 Pino Toscano 2015-12-07 09:16:14 UTC
(In reply to awilliam from comment #2)
> OK, I'll try that. Assuming it's the problem: could virt-builder print a
> prominent warning/error when this happens (resize fails due to missing
> support tools)?

This has been done recently -- see bug #1204063, comment #4.


Note You need to log in before you can comment on or make changes to this bug.