From 79be93baf510940497f88f8b73c86022a811b6b8 Mon Sep 17 00:00:00 2001 From: Pierre Riteau Date: Tue, 5 Oct 2021 11:00:49 +0200 Subject: [PATCH] Enable consistent network device naming CentOS cloud images come with net.ifnames=0 on the kernel command line, which disables consistent network device naming. This does not provide a good experience on bare metal because NIC ordering can vary. This is specific to cloud images: an ISO installation would use consistent network device naming. We now set net.ifnames=1 in the DIB default environment to use consistent network device naming. The parameters `nofb nomodeset gfxpayload=text` are also set to preserve defaults from DIB. To restore the existing behaviour, set DIB_BOOTLOADER_DEFAULT_CMDLINE to `nofb nomodeset gfxpayload=text net.ifnames=0` in the kolla_bifrost_dib_env_vars_extra dictionary. Change-Id: I20465eab4e0aec6620578a92d3bdbddcec0954df --- ansible/group_vars/all/bifrost | 1 + doc/source/configuration/reference/bifrost.rst | 3 ++- etc/kayobe/bifrost.yml | 6 ++++-- ...istent-network-device-naming-e0edec5d5fdf83e2.yaml | 11 +++++++++++ 4 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 releasenotes/notes/dib-consistent-network-device-naming-e0edec5d5fdf83e2.yaml diff --git a/ansible/group_vars/all/bifrost b/ansible/group_vars/all/bifrost index 1b9f5f245..b51367199 100644 --- a/ansible/group_vars/all/bifrost +++ b/ansible/group_vars/all/bifrost @@ -43,6 +43,7 @@ kolla_bifrost_dib_init_element: "cloud-init-datasources" # DIB default environment variables. kolla_bifrost_dib_env_vars_default: + DIB_BOOTLOADER_DEFAULT_CMDLINE: "nofb nomodeset gfxpayload=text net.ifnames=1" DIB_CLOUD_INIT_DATASOURCES: "ConfigDrive" # DIB additional environment variables. diff --git a/doc/source/configuration/reference/bifrost.rst b/doc/source/configuration/reference/bifrost.rst index 15d718ba9..b6dc7a577 100644 --- a/doc/source/configuration/reference/bifrost.rst +++ b/doc/source/configuration/reference/bifrost.rst @@ -80,7 +80,8 @@ configuration drive built by Bifrost, rather than the Bifrost default of releases.* DIB default environment variables. Default is - ``{"DIB_CLOUD_INIT_DATASOURCES": "ConfigDrive"}``. + ``{DIB_BOOTLOADER_DEFAULT_CMDLINE: "nofb nomodeset gfxpayload=text + net.ifnames=1", "DIB_CLOUD_INIT_DATASOURCES": "ConfigDrive"}``. ``kolla_bifrost_dib_env_vars_extra`` *Added in the Train release. Use kolla_bifrost_dib_env_vars in earlier releases.* diff --git a/etc/kayobe/bifrost.yml b/etc/kayobe/bifrost.yml index 85d018d35..275d80bc8 100644 --- a/etc/kayobe/bifrost.yml +++ b/etc/kayobe/bifrost.yml @@ -39,8 +39,10 @@ # DIB init element. Default is "cloud-init-datasources". #kolla_bifrost_dib_init_element: -# DIB default environment variables. Default is {"DIB_CLOUD_INIT_DATASOURCES": -# "ConfigDrive"}. +# DIB default environment variables. Default is +# {DIB_BOOTLOADER_DEFAULT_CMDLINE: +# "nofb nomodeset gfxpayload=text net.ifnames=1", +# "DIB_CLOUD_INIT_DATASOURCES": "ConfigDrive"}. #kolla_bifrost_dib_env_vars_default: # DIB additional environment variables. Default is none. diff --git a/releasenotes/notes/dib-consistent-network-device-naming-e0edec5d5fdf83e2.yaml b/releasenotes/notes/dib-consistent-network-device-naming-e0edec5d5fdf83e2.yaml new file mode 100644 index 000000000..9a348fc0d --- /dev/null +++ b/releasenotes/notes/dib-consistent-network-device-naming-e0edec5d5fdf83e2.yaml @@ -0,0 +1,11 @@ +--- +upgrade: + - | + Consistent network device naming is now enabled by default in overcloud + root disk images, by setting ``net.ifnames=1`` on the kernel command line. + This is performed using the ``DIB_BOOTLOADER_DEFAULT_CMDLINE`` + diskimage-builder environment variable, which is set to ``nofb nomodeset + gfxpayload=text net.ifnames=1`` to preserve diskimage-builder defaults. To + restore existing behaviour, set ``DIB_BOOTLOADER_DEFAULT_CMDLINE`` to + ``nofb nomodeset gfxpayload=text net.ifnames=0`` in the + ``kolla_bifrost_dib_env_vars_extra`` dictionary.