Chris Card
2020-Feb-21 09:56 UTC
[CentOS] Renaming virtio devices names on CentOS 8 VM guest
I have built a CentOS 8 base image from a kickstart, for use in OpenStack. This image boots fine but the problem I have is that I can't stop udev from renaming the network device from eth0 to ens<something>. I have /etc/sysconfig/network-scripts/ifcfg-eth0 with the correct HWADDR defined in it, and have set net.ifnames=0 and biosdevname=0 in the grub configuration, but nothing I have tried has stopped the renaming. I found this bug: https://bugzilla.redhat.com/show_bug.cgi?id=1660179 which describes the same situation, but the comments in the bug didn't help. I'd like to keep the eth* device names because we have various heat templates and other scripts which assume that the network devices are called eth0, eth1 etc. Any ideas? Is this even possible with a CentOS 8 VM guest? Chris
Gianluca Cecchi
2020-Feb-21 12:03 UTC
[CentOS] Renaming virtio devices names on CentOS 8 VM guest
On Fri, Feb 21, 2020 at 10:57 AM Chris Card <ctcard at hotmail.com> wrote:> I have built a CentOS 8 base image from a kickstart, for use in OpenStack. > This image boots fine but the problem I have is that I can't stop udev > from renaming the network device from eth0 to ens<something>. > I have /etc/sysconfig/network-scripts/ifcfg-eth0 with the correct HWADDR > defined in it, and have set net.ifnames=0 and biosdevname=0 in the grub > configuration, but nothing I have tried has stopped the renaming. > I found this bug: https://bugzilla.redhat.com/show_bug.cgi?id=1660179 > which describes the same situation, but the comments in the bug didn't help. > I'd like to keep the eth* device names because we have various heat > templates and other scripts which assume that the network devices are > called eth0, eth1 etc. > Any ideas? Is this even possible with a CentOS 8 VM guest? > > Chris > >It is strongly discouraged, for Openstack and when you have more than one adapter. See here if you have access: https://access.redhat.com/solutions/2435891 Anyway perhaps you could manage order of names customizing /usr/lib/systemd/network/99-default.link At least as described here: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/configuring_and_managing_networking/consistent-network-interface-device-naming_configuring-and-managing-networking but I never tried it HIH, Gianluca
Chris Card
2020-Feb-21 12:33 UTC
[CentOS] Renaming virtio devices names on CentOS 8 VM guest
Thanks Gianluca, I can't access https://access.redhat.com/solutions/2435891 unfortunately, but https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/configuring_and_managing_networking/consistent-network-interface-device-naming_configuring-and-managing-networking looks like it might help me. Chris ________________________________ From: CentOS <centos-bounces at centos.org> on behalf of Gianluca Cecchi <gianluca.cecchi at gmail.com> Sent: 21 February 2020 12:03 To: CentOS mailing list <centos at centos.org> Subject: Re: [CentOS] Renaming virtio devices names on CentOS 8 VM guest On Fri, Feb 21, 2020 at 10:57 AM Chris Card <ctcard at hotmail.com> wrote:> I have built a CentOS 8 base image from a kickstart, for use in OpenStack. > This image boots fine but the problem I have is that I can't stop udev > from renaming the network device from eth0 to ens<something>. > I have /etc/sysconfig/network-scripts/ifcfg-eth0 with the correct HWADDR > defined in it, and have set net.ifnames=0 and biosdevname=0 in the grub > configuration, but nothing I have tried has stopped the renaming. > I found this bug: https://bugzilla.redhat.com/show_bug.cgi?id=1660179 > which describes the same situation, but the comments in the bug didn't help. > I'd like to keep the eth* device names because we have various heat > templates and other scripts which assume that the network devices are > called eth0, eth1 etc. > Any ideas? Is this even possible with a CentOS 8 VM guest? > > Chris > >It is strongly discouraged, for Openstack and when you have more than one adapter. See here if you have access: https://access.redhat.com/solutions/2435891 Anyway perhaps you could manage order of names customizing /usr/lib/systemd/network/99-default.link At least as described here: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/configuring_and_managing_networking/consistent-network-interface-device-naming_configuring-and-managing-networking but I never tried it HIH, Gianluca _______________________________________________ CentOS mailing list CentOS at centos.org https://lists.centos.org/mailman/listinfo/centos
Robert G (Doc) Savage
2020-Feb-21 16:08 UTC
[CentOS] Renaming virtio devices names on CentOS 8 VM guest
On Fri, 2020-02-21 at 13:03 +0100, Gianluca Cecchi wrote:> On Fri, Feb 21, 2020 at 10:57 AM Chris Card <ctcard at hotmail.com> > wrote: > > > I have built a CentOS 8 base image from a kickstart, for use in > > OpenStack. > > This image boots fine but the problem I have is that I can't stop > > udev > > from renaming the network device from eth0 to ens<something>. > > I have /etc/sysconfig/network-scripts/ifcfg-eth0 with the correct > > HWADDR > > defined in it, and have set net.ifnames=0 and biosdevname=0 in the > > grub > > configuration, but nothing I have tried has stopped the renaming. > > I found this bug: > > https://bugzilla.redhat.com/show_bug.cgi?id=1660179 > > which describes the same situation, but the comments in the bug > > didn't help. > > I'd like to keep the eth* device names because we have various heat > > templates and other scripts which assume that the network devices > > are > > called eth0, eth1 etc. > > Any ideas? Is this even possible with a CentOS 8 VM guest? > > > > Chris > > > > > It is strongly discouraged, for Openstack and when you have more than > one > adapter. See here if you have access: > https://access.redhat.com/solutions/2435891 > > Anyway perhaps you could manage order of names customizing > /usr/lib/systemd/network/99-default.link > At least as described here: > https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/configuring_and_managing_networking/consistent-network-interface-device-naming_configuring-and-managing-networking > but I never tried it > HIH, > GianlucaGianluca, What you are trying to do is documented at https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/networking_guide/sec-disabling_consistent_network_device_naming You need to edit the GRUB_CMDLOINE_LINUX line in /etc/default/grub as shown below; ~]# cat /etc/default/grub GRUB_TIMEOUT=5 GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)" GRUB_DEFAULT=saved GRUB_DISABLE_SUBMENU=true GRUB_TERMINAL_OUTPUT="console" GRUB_CMDLINE_LINUX="rd.lvm.lv=rhel_7/swap rd.luks.uuid=luks- cc387312-6da6-469a-8e49-b40cd58ad67a crashkernel=auto vconsole.keymap=us vconsole.font=latarcyrheb-sun16 rd.lvm.lv=rhel_7/root rhgb quiet net.ifnames=0 biosdevname=0" GRUB_DISABLE_RECOVERY="true" Then for an EUFI system run this: ~]# grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg Reboot and you should have your old eth0, eth1, etc. naming convention back again. WATCH YOUR TYPING. BE CAREFUL NOT TO OMIT OR ADD EXTRANEOUS SPACES !!! Hope this helps. --Doc Savage Fairview Heights, IL 62208-3432