Fix for RHEL8 derived image containers having no network

The issue with using any of the RHEL 8 derived cloud images is that NetworkManager doesn’t work with veth devices (so eth0 for a lxdbr0 IP address). Which makes the newly launched instance basically useless.

I’m currently using the following bootcmd section for centos/alma/rocky etc. distros… It disables NetworkManager, brings up eth0 annually and then installs and enables old-school networking…

I’ve managed to create a cloud-init bootcmd section which automatically works around this issue for RHEL8 devilled containers… Disable NetworkManger which is ignoring veth derived devices (e.g. eth0) and then bring up the eth0 manually and then install and enable old school networking which does work.

#cloud-config
package_update: true
timezone: Europe/London
bootcmd:
- [ cloud-init-per, once, nmdis, systemctl, disable, NetworkManager, --now ]
- [ cloud-init-per, once, eth0up, dhclient, eth0 ]
- [ cloud-init-per, once, epel, yum, -y, install, epel-release, network-scripts ]
- [ cloud-init-per, once, nwup, systemctl, enable, network, --now ]

I believe this PR should help the situation:

CC @monstermunchkin @stgraber

Sounds hopeful… This issue has cost me a lot of time working around it :frowning:

We do already have some similar workarounds, are you using an image that has this fix?

Yes I’ve tried editing the udev configuration to remove the veth unmanaged override… Didn’t work for me…

Hrm it might be a different issue then, as the PR I linked to basically does the same thing, but covers all images rather than specific RHEL derived ones.

NetworkManager appears to be very picky about the sorts of interfaces it will allowed to be configured.