Comment 0 for bug 1507631

Revision history for this message
Holger King (holger-king) wrote :

Dear DIB ,

when using diskimage-builder (DIB: http://docs.openstack.org/developer/diskimage-builder/) to create a custom Red Hat Enterprise Linux (RHEL) 6 QCOW2 image (see: https://rhn.redhat.com/rhn/software/channel/downloads/Download.do?cid=16952) we get a non-bootable result although the disk image building process ends successfully. The log of the disk image building run can be found here: https://drive.google.com/file/d/0B6btT4vDRIz_NkhScXpnV2Q4UEE/view?usp=sharing!

The host where the image is built runs on RHEL 7.1 using:
- dib-utils 0.0.9-1
- sfdisk 2.23.2

We've set the following environment variables to allow a proper execution and connection setup with our RHEL Satellite environment for package updates during the diskimage-builder run:

- export DIB_RHSM_USER=<user>
- export DIB_RHSM_PASSWORD=<password>
- export DIB_SAT_URL=https://<host>.xx.xxxxx.xxx/XMLRPC
- export DIB_SAT_KEY=<key_1>,<key_2>
- export DIB_RHN_CHANNELS=""
- export DIB_REG_TYPE=rhn
- export DIB_RELEASE=6.7-20150706.0
- export DIB_CLOUD_IMAGES=file:///root
- export DIB_IMAGE_SIZE=5
- export TMP_DIR=$HOME/oso

The command we use to start the image creation:

diskimage-builder/bin/disk-image-create --no-tmpfs -a amd64 vm rhel <custom_dib_element> -o RHEL-x86_64-openshift-origin-broker >/tmp/dib_rhel.log 2>&1

The problem seems to be the partition table writing respectively the bootloader handling. We found the following interesting informations in the written log file:

dib-run-parts Mon Sep 21 18:29:08 CEST 2015 Running /root/oso/image.c8DfiJSU/hooks/block-device.d/10-partition
Checking that no-one is using this disk right now ...
BLKRRPART: Invalid argument
OK

sfdisk: Disk /dev/loop2: cannot get geometry

sfdisk: /dev/loop2: unrecognized partition table type

sfdisk: No partitions found

sfdisk: Warning: The partition table looks like it was made
  for C/H/S=*/181/40 (instead of 652/255/63).
For this listing I'll assume that geometry.

sfdisk: start: (c,h,s) expected (0,51,9) found (0,32,33)

sfdisk: end: (c,h,s) expected (1023,180,40) found (652,180,40)

Warning: partition 1 does not end at a cylinder boundary
end of partition 1 has impossible value for cylinders: 652 (should be in 0-651)
BLKRRPART: Invalid argument
If you created or changed a DOS partition, /dev/foo7, say, then use dd(1)
to zero the first 512 bytes: dd if=/dev/zero of=/dev/foo7 bs=512 count=1
(See fdisk(8).)
dib-run-parts Mon Sep 21 18:29:08 CEST 2015 10-partition completed

Disk /dev/loop2: 652 cylinders, 255 heads, 63 sectors/track
Old situation:
New situation:
Units: sectors of 512 bytes, counting from 0

   Device Boot Start End #sectors Id System
/dev/loop2p1 * 2048 10485759 10483712 83 Linux
/dev/loop2p2 0 - 0 0 Empty
/dev/loop2p3 0 - 0 0 Empty
/dev/loop2p4 0 - 0 0 Empty
Successfully wrote the new partition table

Re-reading the partition table ...

IMAGE_BLOCK_DEVICE=/dev/loop2p1

...

dib-run-parts Mon Sep 21 18:29:32 CEST 2015 Running /root/oso/image.c8DfiJSU/hooks/cleanup.d/51-bootloader
+ set -eu
+ set -o pipefail
+ '[' -n /root/oso/image.c8DfiJSU/mnt ']'
+ source /root/oso/diskimage-builder/bin/../lib/img-functions
+ '[' -d /root/oso/image.c8DfiJSU/mnt/boot/extlinux ']'
+ CONF=/root/oso/image.c8DfiJSU/mnt/boot/extlinux/extlinux.conf
+ select_boot_kernel_initrd /root/oso/image.c8DfiJSU/mnt
+ TARGET_ROOT=/root/oso/image.c8DfiJSU/mnt
+ BOOTDIR=/root/oso/image.c8DfiJSU/mnt/boot
+ '[' -n '' -a -n '' ']'
+ '[' -f /root/oso/image.c8DfiJSU/mnt/etc/redhat-release ']'
++ grep PAE
++ ls -1rv /root/oso/image.c8DfiJSU/mnt/boot/vmlinuz-2.6.32-573.3.1.el6.x86_64 /root/oso/image.c8DfiJSU/mnt/boot/vmlinuz-2.6.32-573.el6.x86_64
++ grep -v debug
++ head -1
++ echo ''
+ KERNEL=
++ ls -1rv /root/oso/image.c8DfiJSU/mnt/boot/vmlinuz-2.6.32-573.3.1.el6.x86_64 /root/oso/image.c8DfiJSU/mnt/boot/vmlinuz-2.6.32-573.el6.x86_64
++ grep -v debug
++ head -1
+ KERNEL=/root/oso/image.c8DfiJSU/mnt/boot/vmlinuz-2.6.32-573.el6.x86_64
+ '[' '!' /root/oso/image.c8DfiJSU/mnt/boot/vmlinuz-2.6.32-573.el6.x86_64 ']'
++ basename /root/oso/image.c8DfiJSU/mnt/boot/vmlinuz-2.6.32-573.el6.x86_64
+ KERNEL=vmlinuz-2.6.32-573.el6.x86_64
+ KERNEL_VERSION=2.6.32-573.el6.x86_64
+++ ls /root/oso/image.c8DfiJSU/mnt/boot/initramfs-2.6.32-573.el6.x86_64.img
++ basename /root/oso/image.c8DfiJSU/mnt/boot/initramfs-2.6.32-573.el6.x86_64.img
+ RAMDISK=initramfs-2.6.32-573.el6.x86_64.img
+ '[' '!' initramfs-2.6.32-573.el6.x86_64.img ']'
+ sudo sh -c 'cat > /root/oso/image.c8DfiJSU/mnt/boot/extlinux/extlinux.conf <<_EOF_
DEFAULT linux

LABEL linux
    KERNEL /boot/vmlinuz-2.6.32-573.el6.x86_64
    APPEND ro root=LABEL=cloudimg-rootfs console=tty0 console=ttyS0,115200 nofb nomodeset vga=normal
    INITRD /boot/initramfs-2.6.32-573.el6.x86_64.img
_EOF_'
dib-run-parts Mon Sep 21 18:29:32 CEST 2015 51-bootloader completed

When adding this QCOW2 image to glance and booting from it via the OpenStack Horizon dashboard, the instance console log below:

/var/lib/nova/instances/<instance_id>/console.log

stays empty :-(

When uploading the original RHEL QCOW2 image retrieved from https://rhn.redhat.com/rhn/software/c... to glance and booting from it, it works successfully!

From our point of view there seems to be bug within the DIB. Do you agree?