From 5f01bd5d6114225087ecf4bcc1876f668b7d5721 Mon Sep 17 00:00:00 2001 From: Julia Kreger Date: Tue, 28 Jun 2022 11:02:03 -0700 Subject: [PATCH] Use internal dhcp client for centos 9-stream and beyond All indication in CI is that Centos Stream9's use of dhclient appears to point to compatability issues when interacting with dnsmasq. However, this doesn't appear to be the issue with the internal dhcp client. As such, lets constraint the RH default so that it no longer applies to Centos 9-stream. I've also added a documentation entry for DIB_DHCP_CLIENT which was previously undocumented. As an aside, I've already reached out to RH's NetworkManager team regarding this, but root cause is not entirely understood at this point. Change-Id: I235f75b385a8b0348c8fe064038c51409f8722c4 Story: 2010109 Task: 45677 --- .../elements/dhcp-all-interfaces/README.rst | 10 ++++++++++ .../install.d/50-dhcp-all-interfaces | 19 ++++++++++++++----- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/diskimage_builder/elements/dhcp-all-interfaces/README.rst b/diskimage_builder/elements/dhcp-all-interfaces/README.rst index a11a4cb3..1fdf7044 100644 --- a/diskimage_builder/elements/dhcp-all-interfaces/README.rst +++ b/diskimage_builder/elements/dhcp-all-interfaces/README.rst @@ -39,3 +39,13 @@ DIB_DHCP_NETWORK_MANAGER_AUTO auto-configure any interface with no configuration, it will use DHCP for IPv4 and Router Advertisements to decide how to initialize IPv6. :Example: DIB_DHCP_NETWORK_MANAGER_AUTO=true + +DIB_DHCP_CLIENT + :Required: no + :Default: internal + :Description: When NetworkManager is in use, this setting conveys which DHCP + client is in use for acquiring a DHCP address for the node. In some specific + cases, where known that dhclient is the tested or most compatible default, + specifically for Centos 7, 8, and 8-Stream, as well as derived distributions. + Otherwise, the "internal" dhcp client is the default. + :Example: DIB_DHCP_CLIENT diff --git a/diskimage_builder/elements/dhcp-all-interfaces/install.d/50-dhcp-all-interfaces b/diskimage_builder/elements/dhcp-all-interfaces/install.d/50-dhcp-all-interfaces index 2b6e4ce6..d885741f 100755 --- a/diskimage_builder/elements/dhcp-all-interfaces/install.d/50-dhcp-all-interfaces +++ b/diskimage_builder/elements/dhcp-all-interfaces/install.d/50-dhcp-all-interfaces @@ -9,12 +9,21 @@ set -o pipefail SCRIPTDIR=$(dirname $0) if [ -e "/etc/redhat-release" ]; then - # NOTE(TheJulia): While the internal client which every networkmanager user - # should have is internal, dhclient has better behavior which includes - # shutting down the port between retries which is critical for recovery - # from LACP port blocking situations. As such, we'll force it to dhclient. + # NOTE(TheJulia): RHEL, prior to RHEL8 used dhclient by default launched + # by NetworkManager. In RHEL8, this default switched to the "internal" + # dhcp client. + # This is problematic in RHEL8, with port blocking situations as dhclient + # has better behavior which includes shutting down the port between + # retries which is critical for recovery from LACP port blocking + # situations. As such, we'll force it to dhclient. # For more information, see https://storyboard.openstack.org/#!/story/2008001 - DIB_DHCP_CLIENT=${DIB_DHCP_CLIENT:-dhclient} + if [[ '7' =~ ${DIB_RELEASE} ]]; then + DIB_DHCP_CLIENT=${DIB_DHCP_CLIENT:-dhclient} + elif [[ '8' =~ ${DIB_RELEASE} ]]; then + DIB_DHCP_CLIENT=${DIB_DHCP_CLIENT:-dhclient} + fi + # NOTE(TheJulia): Centos 9-stream/RHEL9, appear to need to leverage the + # internal interface. See: https://storyboard.openstack.org/#!/story/2010109 fi