Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Disable all DHCP requests #1609

Open
comminutus opened this issue Nov 6, 2023 · 6 comments
Open

Feature Request: Disable all DHCP requests #1609

comminutus opened this issue Nov 6, 2023 · 6 comments

Comments

@comminutus
Copy link

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 travier transferred this issue from coreos/coreos-installer Nov 6, 2023
@travier
Copy link
Member

travier commented Nov 6, 2023

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

@jlebon
Copy link
Member

jlebon commented Nov 6, 2023

This should be fixed by coreos/coreos-installer#1335.

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

@comminutus
Copy link
Author

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
Copy link
Member

jlebon commented Nov 9, 2023

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
Copy link
Author

@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
Copy link
Member

jlebon commented Nov 9, 2023

OK cool, coreos/coreos-installer#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/.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants