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
This commit is contained in:
Pierre Riteau 2021-10-05 11:00:49 +02:00
parent c583922c27
commit 79be93baf5
4 changed files with 18 additions and 3 deletions

View File

@ -43,6 +43,7 @@ kolla_bifrost_dib_init_element: "cloud-init-datasources"
# DIB default environment variables. # DIB default environment variables.
kolla_bifrost_dib_env_vars_default: kolla_bifrost_dib_env_vars_default:
DIB_BOOTLOADER_DEFAULT_CMDLINE: "nofb nomodeset gfxpayload=text net.ifnames=1"
DIB_CLOUD_INIT_DATASOURCES: "ConfigDrive" DIB_CLOUD_INIT_DATASOURCES: "ConfigDrive"
# DIB additional environment variables. # DIB additional environment variables.

View File

@ -80,7 +80,8 @@ configuration drive built by Bifrost, rather than the Bifrost default of
releases.* releases.*
DIB default environment variables. Default is 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`` ``kolla_bifrost_dib_env_vars_extra``
*Added in the Train release. Use kolla_bifrost_dib_env_vars in earlier *Added in the Train release. Use kolla_bifrost_dib_env_vars in earlier
releases.* releases.*

View File

@ -39,8 +39,10 @@
# DIB init element. Default is "cloud-init-datasources". # DIB init element. Default is "cloud-init-datasources".
#kolla_bifrost_dib_init_element: #kolla_bifrost_dib_init_element:
# DIB default environment variables. Default is {"DIB_CLOUD_INIT_DATASOURCES": # DIB default environment variables. Default is
# "ConfigDrive"}. # {DIB_BOOTLOADER_DEFAULT_CMDLINE:
# "nofb nomodeset gfxpayload=text net.ifnames=1",
# "DIB_CLOUD_INIT_DATASOURCES": "ConfigDrive"}.
#kolla_bifrost_dib_env_vars_default: #kolla_bifrost_dib_env_vars_default:
# DIB additional environment variables. Default is none. # DIB additional environment variables. Default is none.

View File

@ -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.