disk-image-create should exit once it determines there's not enough RAM (currently it still proceeds)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
diskimage-builder |
Triaged
|
Wishlist
|
Unassigned |
Bug Description
disk-image-create should exit once it determines there's note enough RAM. Currently it throws a message that there isn't enough memory (fair enough), but still goes ahead and tries to create in /tmp/... (which is also on 'tmpfs' for Fedora)
Env:
$ git clone https:/
$ git log | head -1
commit ad0fe876df8c7a8
-> Try to create a guest in an a VM (with less than 4G mem): -- I tested this on a fresh F19 VM
$ disk-image-create -o fedora-test fedora -a i386 2>&1 | tee /var/tmp/
Building elements: base fedora
If prompted for sudo, install sudoers.
Expanded element dependencies to: dib-run-parts dracut-network base fedora cache-url
Not enough RAM to use tmpfs for build. (4049868 < 4G)
Building in /tmp/image.AqpUhtDJ
/tmp/image.
Fetching Base Image
% Total % Received % Xferd Average Speed Time Time Time Current
0 0 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0
Server copy has not changed. Using locally cached http://
Repacking base image as tarball.
Working in /tmp/tmp.nS7yxI2TKd
mount: special device /dev/mapper/loop0p2 does not exist
loop deleted : /dev/loop0
touch: cannot touch '/tmp/image.
umount: /tmp/image.
umount: /tmp/image.
umount: /tmp/image.
umount: /tmp/image.
umount: /tmp/image.
umount: /tmp/image.
-> /tmp is tmpfs
[root@localhost diskimage-builder]# df -hT
Filesystem Type Size Used Avail Use% Mounted on
/dev/mapper/
devtmpfs devtmpfs 491M 0 491M 0% /dev
tmpfs tmpfs 498M 0 498M 0% /dev/shm
tmpfs tmpfs 498M 300K 498M 1% /run
tmpfs tmpfs 498M 0 498M 0% /sys/fs/cgroup
tmpfs tmpfs 498M 12K 498M 1% /tmp
/dev/vda2 ext4 190M 61M 120M 34% /boot
-> Fedora 19:
$ cat /etc/fedora-release
Fedora release 19 (Schrödinger’s Cat)
The RAM check is for an optimization, but this is unrelated. Really root.d scripts should bomb out if there isn't enough space in their target.