dracut initrd resets networking on boot

Issues related to configuring your network
Post Reply
jamesjameson
Posts: 8
Joined: 2018/05/04 16:09:13

dracut initrd resets networking on boot

Post by jamesjameson » 2019/03/11 18:23:06

I'm running a fresh install of Centos 7 from DVD 1810 kernel version 3.10.0-957.el7.x86_64.

My server is an HP DL325 Gen10. It has a 4 port 1 Gig ethernet adapter and a 2 port 10 Gig converged network adapter. They show up in Centos as eno1 - eno6 where 5 and 6 are the ports on the 10 gig ethernet device. I am configuring my server to boot via iSCSI on eno5. Installation works just fine, however when the server boots up, it's fetching a DHCP address on eno1 instead of using the statically configured IP I give it during install. If I check the configuration file at /etc/sysconfig/network-scripts/ifcfg-eno1, it says at the top Generated by dracut initrd. I attempted to pass the IP information to dracut by creating a file at /etc/cmdline with the IP information for both eno1 and eno5, but that doesn't seem to do anything. I also disabled ifcfg from dracut, and while that makes it not overwrite my network configuration files, it still boots up with a DHCP lease instead of using my static IP address. I can manually do an ifdown eno1 ifup eno1 and then it has the appropriate IP, but this is suboptimal and undesired. I've also tried passing the IP lines in the kernel boot up of grub, however I get a kernel panic when I do that whcih shows dracut-cmdline Warning: Empty autoconf values default to dhcp, the next line says dracut FATAL For argument ip=host_ip:gateway_ip:mask:eno1:off' Sorry, setting client-ip does not make sense for 'dhcp'. Note I did remove the ips to protect the innocent :) So I'm not sure where else to check where I can configure the IP for dracut so that it's not configuring my adapters as DHCP.

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: dracut initrd resets networking on boot

Post by TrevorH » 2019/03/11 19:07:33

Check for other ifcfg files that are for the same device by a different name.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

jamesjameson
Posts: 8
Joined: 2018/05/04 16:09:13

Re: dracut initrd resets networking on boot

Post by jamesjameson » 2019/03/11 19:54:32

The only ifcfg files in there are for the 6 eno devices I expected, and of course the one for local host.

User avatar
jlehtone
Posts: 4523
Joined: 2007/12/11 08:17:33
Location: Finland

Re: dracut initrd resets networking on boot

Post by jlehtone » 2019/03/12 09:13:46

jamesjameson wrote:
2019/03/11 18:23:06
I am configuring my server to boot via iSCSI on eno5.
Do you use static address because there is no DHCP server?

Do you use NetworkManager.service or network.service?


"Generated by dracut" does not mean "maintained by dracut". The generation is oneshot
during install. Otherwise it would overwrite custom config on every boot.

If dracut indeed retouches, then it does so according to instructions in initrd.
The initrd is created based on active configuration of the running system. It can be recreated.
Each new kernel install does create initrd for that kernel.


PS.
Please explain the boot process. I've had only one partial encounter with iSCSI and thus curious.

As far as I know:
  1. EFI/BIOS/PXE configures a network interface with DHCP
  2. PXE loads boot loader from tftp server
  3. Bootloader loads kernel and initrd from tftp
  4. Kernel uses drivers, utilities, and instructions from initrd to configure a network interface
  5. Kernel initiates connection to iSCSI target
  6. Kernel mounts iSCSI volume as root
  7. Network service is loaded from volume to start the rest of interfaces
I have a feeling that this is not how "boot via iSCSI" actually goes.

jamesjameson
Posts: 8
Joined: 2018/05/04 16:09:13

Re: dracut initrd resets networking on boot

Post by jamesjameson » 2019/03/12 14:24:46

Do you use static address because there is no DHCP server?
There is a DHCP server, and I've currently set a reservation for the preferred IP until I can resolve the situation
Do you use NetworkManager.service or network.service?
We're using the NetworkManager.service
"Generated by dracut" does not mean "maintained by dracut". The generation is oneshot
during install. Otherwise it would overwrite custom config on every boot.
This is the exact behavior I'm having, it's overwriting my configuration file on boot.
If dracut indeed retouches, then it does so according to instructions in initrd.
The initrd is created based on active configuration of the running system. It can be recreated.
Each new kernel install does create initrd for that kernel.
What is interesting is that it doesn't even seem to matter if I remove ifcfg from the initrd, and it doesn't overwrite my config files. It still uses DHCP even though I have it configured in there to use a static IP.
PS.
Please explain the boot process. I've had only one partial encounter with iSCSI and thus curious.

As far as I know:
  1. EFI/BIOS/PXE configures a network interface with DHCP
  2. PXE loads boot loader from tftp server
  3. Bootloader loads kernel and initrd from tftp
  4. Kernel uses drivers, utilities, and instructions from initrd to configure a network interface
  5. Kernel initiates connection to iSCSI target
  6. Kernel mounts iSCSI volume as root
  7. Network service is loaded from volume to start the rest of interfaces
I have a feeling that this is not how "boot via iSCSI" actually goes.
Mine is much more simple than this. I'm using a controller that does iSCSI boot in hardware, so it presents as a local hard drive for the most part. The operating system does see that it's an iSCSI adapter and initializes the driver, but there is no PXE environment or tftp at all.

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: dracut initrd resets networking on boot

Post by TrevorH » 2019/03/12 16:35:13

What's the output from rpm -qa dracut\*
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

jamesjameson
Posts: 8
Joined: 2018/05/04 16:09:13

Re: dracut initrd resets networking on boot

Post by jamesjameson » 2019/03/13 12:44:36

TrevorH wrote:
2019/03/12 16:35:13
What's the output from rpm -qa dracut\*
rpm -qa dracut\*
dracut-033-554.el7.x86_64
dracut-config-rescue-033-554.el7.x86_64
dracut-network-033-554.el7.x86_64

Post Reply