#366 When building cloud images oz uses dracut to setup networking and it
Merged 2 years ago by ausil. Opened 2 years ago by kevin.

file modified
+8 -8

@@ -35,7 +35,8 @@

  

  firewall --disabled

  

- bootloader --timeout=1 --append="no_timer_check console=tty1 console=ttyS0,115200n8"

+ # We pass net.ifnames=0 because we always want to use eth0 here on all the cloud images.

+ bootloader --timeout=1 --append="no_timer_check net.ifnames=0 console=tty1 console=ttyS0,115200n8"

  

  network --bootproto=dhcp --device=link --activate --onboot=on

  services --enabled=sshd,cloud-init,cloud-init-local,cloud-config,cloud-final

@@ -170,11 +171,6 @@

  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"

@@ -245,8 +241,12 @@

  rm -f /var/tmp/zeros

  echo "(Don't worry -- that out-of-space error was expected.)"

  

- # For trac ticket https://fedorahosted.org/cloud/ticket/128

- rm -f /etc/sysconfig/network-scripts/ifcfg-ens3

+ # When we build the image with oz, dracut is used 

+ # and sets up a ifcfg-en<whatever> for the device. We don't 

+ # want to use this, we use eth0 so it is always the same. 

+ # So we remove all these ifcfg-en<whatever> devices so 

+ # The 'network' service can come up cleanly.

+ rm -f /etc/sysconfig/network-scripts/ifcfg-en*

  

  # Enable network service here, as doing it in the services line

  # fails due to RHBZ #1369794

in turn makes a ifcfg-en<something> file with this config. We don't
want to use this, we want to always use ifcfg-eth0 so it's the same
on all images. So, we remove ifcfg-en (They are different on each
arch we make cloud images for, but en
gets them all).
Additionally we were using some old udev tricks to get eth0, but this
is error prone and already incorrect as systemd-udev has moved files
around, so instead we just switch to net.ifnames=0 on the boot line,
which should continue working.

Pull-Request has been merged by ausil

2 years ago

This should also pass biosdevname=0, which ensures an older 'persistent device naming' mechanism will be disabled. We are still building and shipping biosdevname.

Another thing I noticed: we need to do the same in fedora-atomic.ks, which has the same issues (it does the udev bits slightly differently, but equally badly).

Another thing I noticed: we need to do the same in fedora-atomic.ks, which has the same issues (it does the udev bits slightly differently, but equally badly).

Yes please. @nirik, do you mind? AH doesn't fail in the same way the cloud base images did, though. Maybe because it's using NetworkManager.

yeah, it winds up disabling network.service, and NM behaves differently on non-existent interfaces etc. Still, the two should be consistent.

I've filed https://pagure.io/releng/issue/7400 as a more comprehensive ticket thinking about this whole area.

edit: also, he's @kevin on Pagure and @nirik on Github. Just to keep you on your toes. ;)

edit: also, he's @kevin on Pagure and @nirik on Github. Just to keep you on your toes. ;)

fun.. sounds like @ausil and @dgilmore :)

Metadata