cloud-init-22.1-5 updates network config on every boot

Solution Verified - Updated

Environment

  • Red Hat Enterprise Linux (RHEL) 8.7+
  • Red Hat Enterprise Linux (RHEL) 9.1+
    • cloud-init-22.1-5 or higher
  • Red Hat Enterprise Linux (RHEL) 10

Issue

  • cloud-init updates the network configuration on every boot on Microsoft Azure

Resolution

  • The workaround is to disable cloud-init network configuration (option 1) or place any extra configuration on files not managed by cloud-init (option 2)
  1. To disable network configuration by cloud-init:
# mkdir -p /etc/cloud/cloud.cfg.d/
# cat <<EOF > /etc/cloud/cloud.cfg.d/99-disable-network.cfg
network:
  config: disabled
EOF

Note: this workaround may eventually leave the instance unreachable as it stops picking up networking changes from the underlying cloud.

  1. For the DNS specific requirement, if using DHCP, write modifications to /etc/dhcp/dhclient.conf manually, then it will be persist after reboot.
# cat /etc/dhcp/dhclient.conf
append domain-search "searchdomain1.com";
append domain-search "searchdomain2.com";
append domain-name-servers 8.8.8.8;

Root Cause

  • There is a change in RHEL 8.7 and 9.1 designed for Azure. Upon every boot, cloud-init needs to fetch network config again to make sure it has the most up-to-date network config for the VM. As a consequence, if you manually configured settings on interfaces, such as an additional search domain, cloud-init maybe overrides them when you reboot the VM.
Components
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.