simple-init/glean missing some requirements (centos-minimal 8)

Bug #1916348 reported by frigo
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
diskimage-builder
New
Undecided
Unassigned

Bug Description

Following some tests with -e simple-init and centos-minimal version 8, there are a few things that prevent simple-init / glean, to work:

- glean calls the "hostname" binary but it is not installed. The "hostname" package is missing.
- NetworkManager conf (for example, through NetworkManager-conf.d-00-main.conf) needs the ifcfg-rh to be activated,for example, through:
```
[main]
plugins=ifcfg-rh
```
per glean doc.

- dhcp-all-interfaces is installed, but it should probably not be when simple-init is included

In addition, and I don't know if it's really an issue with glean or the way it is packaged, there are more issues with glean: the network configuration (handled through NetworkManager in centos8) is not refreshed, and glean can fail to find the right config drive (if we run simple-init, with some networkdata attached to a node, and some networkdata already present on a disk, there will be multiple disks labelled config-2, and glean might pick up the wrong one. I personally am happy with a fix like this:

```
--- glean.sh 2021-03-18 13:56:34.635167121 +0000
+++ glean.sh.new 2021-03-18 13:56:49.727167074 +0000
@@ -31,7 +31,14 @@

 # Test to see if config-drive exists. If not, skip and assume DHCP networking
 # will work because sanity
-if [ -n "$CONFIG_DRIVE_LABEL" ]; then
+if lsblk /dev/sr0 -o LABEL | grep "config-2" ; then
+ mkdir -p /mnt/config
+ sleep $(( $$ % 11 ))
+ mount -t iso9660 -o ro,mode=0700 /dev/sr0 /mnt/config || true
+ [[ -d /mnt/config/openstack ]] || ( sleep $(( $$ % 11 )) ; mount -t iso9660 -o ro,mode=0700 /dev/sr0 /mnt/config )
+
+ glean --ssh --skip-network --hostname
+elif [ -n "$CONFIG_DRIVE_LABEL" ]; then
     # Mount config drive
     mkdir -p /mnt/config
     BLOCKDEV="$(blkid -L ${CONFIG_DRIVE_LABEL})"
@@ -47,3 +54,7 @@
 fi

 glean $@
+rc=$?
+nmcli connection reload
+nmcli networking off ; sleep 2 ; nmcli networking on
+exit $rc
```
)

frigo (rigault-francois)
description: updated
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.