diskimage-builder/diskimage_builder/elements/simple-init
Steve Baker eb395ec558 Remove EOLed CentOS 7 and RHEL 7
CentOS 7 reached EOL on 30th June 2024[1] and RHEL 7 ended its
maintenance support 2 phase[2] the same date.

This change removes the ablity to build images derived from these base
images.

The centos and centos-minimal elements now default to a DIB_RELEASE
value of 9-stream.

[1] https://www.redhat.com/en/topics/linux/centos-linux-eol
[2] https://www.redhat.com/en/technologies/linux-platforms/enterprise-linux/rhel-7-end-of-maintenance

Change-Id: Ic50e08d9f84bbd319129be236d799eade5f40be8
2024-07-05 09:53:29 +12:00
..
environment.d Remove EOLed CentOS 7 and RHEL 7 2024-07-05 09:53:29 +12:00
install.d Merge "simple-init: allow disabling DHCP fallback" 2021-09-10 14:54:03 +00:00
post-install.d Remove EOLed CentOS 7 and RHEL 7 2024-07-05 09:53:29 +12:00
element-deps Add ensure-venv element, install glean with it 2020-03-10 11:57:43 +11:00
package-installs.yaml Remove cloud-init when using simple-init 2023-11-01 09:41:44 -07:00
pkg-map Install Fedora ifcfg NM compat package 2022-09-20 08:58:37 -07:00
README.rst Remove cloud-init when using simple-init 2023-11-01 09:41:44 -07:00
source-repository-simple-init Replace git.openstack.org URLs with opendev.org URLs 2019-05-16 14:45:52 +08:00

simple-init

Basic network and system configuration that can't be done until boot

Unfortunately, as much as we'd like to bake it in to an image, we can't know in advance how many network devices will be present, nor if DHCP is present in the host cloud. Additionally, in environments where cloud-init is not used, there are a couple of small things, like mounting config-drive and pulling ssh keys from it, that need to be done at boot time.

Note

This element removes cloud-init as it can stomp on the configuration applied by glean, resulting in additional problems for operators, and a more difficult path troubleshooting.

Autodetect network interfaces during boot and configure them

The rationale for this is that we are likely to require multiple network interfaces for use cases such as baremetal and there is no way to know ahead of time which one is which, so we will simply run a DHCP client on all interfaces with real MAC addresses (except lo) that are visible on the first boot.

The script /usr/local/sbin/simple-init.sh will be called early in each boot and will scan available network interfaces and ensure they are configured properly before networking services are started.

Processing startup information from config-drive

On most systems, the DHCP approach desribed above is fine. But in some clouds, such as Rackspace Public cloud, there is no DHCP. Instead, there is static network config via config-drive. simple-init will happily call glean which will do nothing if static network information is not there.

Finally, glean will handle ssh-keypair-injection from config drive if cloud-init is not installed.

Chosing glean installation source

By default glean is installed using pip using the latest release on pypi. It is also possible to install glean from a specified git repository location. This is useful for debugging and testing new glean changes for example. To do this you need to set these variables:

DIB_INSTALLTYPE_simple_init=repo
DIB_REPOLOCATION_glean=/path/to/glean/repo
DIB_REPOREF_glean=name_of_git_ref

For example to test glean change 364516 do:

git clone https://opendev.org/opendev/glean /tmp/glean
cd /tmp/glean
git review -d 364516
git checkout -b my-test-ref

Then set your DIB env vars like this before running DIB:

DIB_INSTALLTYPE_simple_init=repo
DIB_REPOLOCATION_glean=/tmp/glean
DIB_REPOREF_glean=my-test-ref

NetworkManager

By default, this uses the "legacy" scripts on each platform. To use NetworkManager instead, set DIB_SIMPLE_INIT_NETWORKMANAGER to non-zero. See the glean documentation for what the implications for this are on each platform.

This is currently only implemented for CentOS and Fedora platforms.

Fallback

Glean falls back to DHCPv4 for all interfaces that do not have an explicit configuration. If this is not desired, set the following variable to disable the fallback and leave such interfaces unconfigured:

export DIB_SIMPLE_INIT_NO_DHCP_FALLBACK=1