[CentOS] Renaming virtio devices names on CentOS 8 VM guest

Fri Feb 21 12:03:46 UTC 2020
Gianluca Cecchi <gianluca.cecchi at gmail.com>

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