coreos / fedora-coreos-tracker

Issue tracker for Fedora CoreOS
https://fedoraproject.org/coreos/
260 stars 60 forks source link

Feature Request: Disable all DHCP requests #1609

Open comminutus opened 8 months ago

comminutus commented 8 months ago

Feature Request

Hello, in our environment we often teardown and recreate our cluster. This results in several DHCP requests - 1 per node that is being provisioned. I've already disabled automatic network configuration and use static IP addresses using NetworkManager, but these modifications occur after the LiveCD is booted.

I've set the offline: true value inside of an install.yaml file as part of my settings, which gets embedded via coreos-installer iso ignition embed at/etc/coreos/installer.d/install.yaml`. Here's the contents of the file that gets embedded:

variant: fcos
version: 1.5.0
storage:
  files:
    - path: /var/roothome/install.ign
      contents:
        local: install.ign

    - path: /etc/coreos/installer.d/install.yaml
      contents:
        local: install.yaml

However, despite setting offline to true, I'm still seeing DHCP requests come through during the LiveCD boot process. I tried turning off my DHCP server, and the process which requests a DHCP address eventually times out but the installation still succeeds onto the hard disk.

Desired Feature

Have some way to completely disable all network requests / DHCP requests during the LiveCD boot process.

travier commented 8 months ago

Moved to the tracker as this is a Fedora CoreOS issue.

jlebon commented 8 months ago

This should be fixed by https://github.com/coreos/coreos-installer/pull/1335.

One easy way to test it is to override the coreos-installer.service systemd unit with the new content in that PR.

comminutus commented 8 months ago

Thanks @jlebon . Since that CoreOS Installer systemd service lives on the live CD itself, how can I override it? Would I have to build the project with the changes or is there some way to patch an existing ISO?

jlebon commented 7 months ago

You can override it via your Ignition config, e.g.

systemd:
  units:
  - name: coreos-installer.service
    contents: |
      [Unit]
      ...

That said, as CI shows, #1335 is missing some bits. But short-term you can at least use a similar mechanism to remove the Wants, e.g. something like

systemd:
  units:
  - name: coreos-installer.service
    dropins:
    - name: no-wants.conf
      contents: |
        [Unit]
        Wants=
comminutus commented 7 months ago

@jlebon I thought the systemd units in the Ignition config run after the livecd/ISO copies the initial CoreOS to the hard disk. It seems like the DHCP request is coming before the systemd units run. I thought it was happening during the initial livecd/ISO boot that copies everything over to the hard disk. Is that not the case?

jlebon commented 7 months ago

OK cool, https://github.com/coreos/coreos-installer/pull/1335 is happy now! Would you be able to test that?

@jlebon I thought the systemd units in the Ignition config run after the livecd/ISO copies the initial CoreOS to the hard disk. It seems like the DHCP request is coming before the systemd units run. I thought it was happening during the initial livecd/ISO boot that copies everything over to the hard disk. Is that not the case?

There are two Ignition runs and configs: one during the live ISO boot and one during the first boot of the installed system. When you coreos-installer iso ignition embed, you're setting the Ignition config for the live ISO.

The new interface which makes that clearer is coreos-installer iso customize, and there the distinction is much more obvious: there's a --live-ignition and a --dest-ignition.

See also https://coreos.github.io/coreos-installer/customizing-install/.