disk-image-create should exit once it determines there's not enough RAM (currently it still proceeds)

Bug #1197683 reported by Kashyap Chamarthy
6
This bug affects 1 person
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://github.com/stackforge/diskimage-builder.git
  $ git log | head -1
  commit ad0fe876df8c7a8d45712163f143e48516b077b3

-> 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/dib-log-3.txt
Building elements: base fedora
If prompted for sudo, install sudoers.d/img-build-sudoers into /etc/sudoers.d and restart the build.
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.AqpUhtDJ/hooks/root.d/10-fedora-cloud-image:

Fetching Base Image
  % Total % Received % Xferd Average Speed Time Time Time Current
                                 Dload Upload Total Spent Left Speed
  0 0 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0
Server copy has not changed. Using locally cached http://mattdm.fedorapeople.org/cloud-images//Fedora18-Cloud-i386-latest.qcow2
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.AqpUhtDJ/mnt/etc/resolv.conf': No such file or directory
umount: /tmp/image.AqpUhtDJ/mnt/sys: not found
umount: /tmp/image.AqpUhtDJ/mnt/proc: not found
umount: /tmp/image.AqpUhtDJ/mnt/dev: not found
umount: /tmp/image.AqpUhtDJ/mnt/tmp/in_target.d: not found

umount: /tmp/image.AqpUhtDJ/mnt: not mounted
umount: /tmp/image.AqpUhtDJ: not mounted

-> /tmp is tmpfs

[root@localhost diskimage-builder]# df -hT
Filesystem Type Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00 ext4 23G 1.1G 21G 5% /
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)

Revision history for this message
Clint Byrum (clint-fewbar) wrote :

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.

Changed in diskimage-builder:
status: New → Confirmed
Revision history for this message
WangDong (woshisuidonghui) wrote :

when I use disk image builder, I can not find the images. I made an image,it says that the image will aside in /tmp but I can not find it. Any answers will be appreciated! Thank you!

Revision history for this message
Robert Collins (lifeless) wrote :

So I'm not clear aboutthis bug. Does the build fail? Is the bug 'the build takes too long to fail' ?

Changed in diskimage-builder:
status: Confirmed → Triaged
importance: Undecided → Wishlist
summary: - disk-image-create should exit once it determines there's note enough
- RAM (currently it still proceeds)
+ disk-image-create should exit once it determines there's not enough RAM
+ (currently it still proceeds)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.