Add net.ifnames=0 to Atomic host

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



See attached patch for making atomic host have eth0 be the interface by default:

>From 2ccdc01d6cb956025b9528e1380382475e052e49 Mon Sep 17 00:00:00 2001
From: Dusty Mabe <dusty@xxxxxxxxxxxxx>
Date: Fri, 20 Nov 2015 12:37:51 -0500
Subject: [PATCH] Fix cloud atomic host not having eth0 net device name.

Doing the symlink to mask 80-net-setup-link.rules [1] seems unreliable as
it is in place on our Atomic host images but the system is still
coming up with different named devices. This causes issues as across
reboots the interface name could change [2]. Instead of using the symlink
let's just use the kernel parameter for all of our images.

[1] http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/
[2] https://fedorahosted.org/cloud/ticket/141
---
 fedora-cloud-atomic.ks       | 9 +++------
 fedora-cloud-base-vagrant.ks | 6 ------
 fedora-cloud-base.ks         | 9 +++------
 3 files changed, 6 insertions(+), 18 deletions(-)

diff --git a/fedora-cloud-atomic.ks b/fedora-cloud-atomic.ks
index d33f316..3dd259b 100644
--- a/fedora-cloud-atomic.ks
+++ b/fedora-cloud-atomic.ks
@@ -18,7 +18,9 @@ user --name=none
 
 firewall --disabled
 
-bootloader --timeout=1 --append="no_timer_check console=tty1 console=ttyS0,115200n8"
+# Add net.ifnames=0 and biosdevnames=0 to ensure that we get eth0 on
+# bringup of the VMs with a single network device.
+bootloader --timeout=1 --append="no_timer_check console=tty1 console=ttyS0,115200n8 net.ifnames=0 biosdevname=0"
 
 network --bootproto=dhcp --device=link --activate --onboot=on
 services --disabled=network
@@ -66,11 +68,6 @@ NETWORKING=yes
 NOZEROCONF=yes
 EOF
 
-# For cloud images, 'eth0' _is_ the predictable device name, since
-# we don't want to be tied to specific virtual (!) hardware
-rm -f /etc/udev/rules.d/70*
-ln -s /dev/null /etc/udev/rules.d/80-net-setup-link.rules
-
 # simple eth0 config, again not hard-coded to the build hardware
 cat > /etc/sysconfig/network-scripts/ifcfg-eth0 << EOF
 DEVICE="eth0"
diff --git a/fedora-cloud-base-vagrant.ks b/fedora-cloud-base-vagrant.ks
index df338d7..2ad4d95 100644
--- a/fedora-cloud-base-vagrant.ks
+++ b/fedora-cloud-base-vagrant.ks
@@ -15,12 +15,6 @@ user --name=vagrant --password=vagrant
 # to "vagrant" for ease of use.  Again, see comments above.
 rootpw vagrant
 
-# The addition of the net.ifnames=0 and biosdevnames=0 option ensures that
-# even on VirtualBox virt, we get a primary network device with "eth0" as the name
-# This simplifies things and allows a single disk image for both supported Vagrant
-# platforms (virtualbox and kvm)
-bootloader --timeout=1 --append="no_timer_check console=tty1 console=ttyS0,115200n8 net.ifnames=0 biosdevname=0"
-
 %packages
 # The default koji Vagrantfile configuration uses rsync to sync files between
 # the vagrant host and the guest.  It uses yum to verify that rsync is present
diff --git a/fedora-cloud-base.ks b/fedora-cloud-base.ks
index bb62285..d134513 100644
--- a/fedora-cloud-base.ks
+++ b/fedora-cloud-base.ks
@@ -36,7 +36,9 @@ user --name=none
 
 firewall --disabled
 
-bootloader --timeout=1 --append="no_timer_check console=tty1 console=ttyS0,115200n8"
+# Add net.ifnames=0 and biosdevnames=0 to ensure that we get eth0 on
+# bringup of the VMs with a single network device.
+bootloader --timeout=1 --append="no_timer_check console=tty1 console=ttyS0,115200n8 net.ifnames=0 biosdevname=0"
 
 network --bootproto=dhcp --device=link --activate --onboot=on
 services --enabled=network,sshd,rsyslog,cloud-init,cloud-init-local,cloud-config,cloud-final
@@ -169,11 +171,6 @@ NOZEROCONF=yes
 DEVTIMEOUT=10
 EOF
 
-# For cloud images, 'eth0' _is_ the predictable device name, since
-# we don't want to be tied to specific virtual (!) hardware
-rm -f /etc/udev/rules.d/70*
-ln -s /dev/null /etc/udev/rules.d/80-net-setup-link.rules
-
 # simple eth0 config, again not hard-coded to the build hardware
 cat > /etc/sysconfig/network-scripts/ifcfg-eth0 << EOF
 DEVICE="eth0"
-- 
2.4.3

_______________________________________________
cloud mailing list
cloud@xxxxxxxxxxxxxxxxxxxxxxx
http://lists.fedoraproject.org/admin/lists/cloud@xxxxxxxxxxxxxxxxxxxxxxx

[Index of Archives]     [Fedora General Discussion]     [Older Fedora Users Archive]     [Fedora Advisory Board]     [Fedora Security]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Mentors]     [Fedora Package Announce]     [Fedora Package Review]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Coolkey]     [Yum Users]     [Big List of Linux Books]     [Yosemite News]     [Linux Apps]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]

  Powered by Linux