-
Notifications
You must be signed in to change notification settings - Fork 30
DHCP IP changes on every boot when using PXE #1432
Comments
looks like your client mac address is consistent - why don't you use that instead? |
How do you mean? A new version of ISC dhcp (that I am not running) has an option to totally ignore the client-id, but it is not really a good idea. This is a core os bug because the various RFCs specify the client-id should be a MAC when PXE booting, and frown on randomizing the DUID on every boot. |
when you pxe boot, you could set |
I could do that, however that means every PXE boot still consumes two IP addresses from the pool (sub optimal if I have a lot of machines) and it doesn't really help make PXE booting a fully functional option in CoreOS. Better would be to add a coreos.pxe=1 kernel command line that causes the ClientIdentifier to be switched to MAC as I described. Then all PXE users will have a solid fix. Why the reluctance to see this as a coreos bug? This is probably a regression as things would have worked fine for PXE before networkd changed the default to duid. |
It should be easy enough to put together a generator that adjusts the network config depending on the OEM ID ("pxe" in this case). We'll probably need it in the future for other providers cough DigitialOcean cough. |
Just to clarify, with the two patches dm0 just made, should coreos.oem=pxe be set on the kernel command line when PXE booting? Does https://coreos.com/os/docs/latest/booting-with-pxe.html need an update too? |
.. and for others stumbling across this, the systemd.machine_id kernel parameter isn't supported until systemd v229, which is newer than what coreos stable has today. |
Given the current implementation, yes they would have to be set. This is not desirable though, so we will be sure to fix it up so that it's not necessary. |
I've updated the pull requests to follow Ignition's behavior of using PXE when no OEM is given on the kernel command-line. |
LGTM |
Follow Ignition's convention of defaulting to the PXE OEM. It currently ignores the case where users define coreos.oem.id=pxe on their kernel command-line manually. This fixes coreos/bugs#1432.
@dm0- this causes a behaviour change in my non-PXE bare metal machines, they don't have a coreos.oem.id kernel command line parameter, so they change away from machine id mode to mac mode.. It would be nice if this stopped changing. Honestly, I'd just permanently set it to mac for everything. I think the target environment for the DUID mode is something like a laptop with docking stations or other variable hardware that just doesn't seem to be the focus for coreos. |
@jgunthorpe sorry about that. We are going to change it one more time (back to the original behavior). Instead of checking the OEM ID, it's more accurate to check if the |
Thanks, I still think you should seriously consider not using DUID mode at all for CoreOS. |
This has been cleaned up in the latest PRs. |
Stumbled upon this and it is not clear for me what is a recommended way to make it work in conjunction with matchbox. Current situation in stable 1520.8.0 is following: yy-pxe.network:
zz-default.network:
What happens in my case, PXE starts, downloads Ignition config from matchbox and calls coreos-install. If Igntion config is templated with values of the |
@redbaron It sounds as though you're having a slightly different issue: one client ID is used by the PXE-booted system that installs Container Linux, and a different one is used by the installed system after rebooting (since the latter won't use the PXE config). If so, could you open a new bug? |
Using coreos 1010.5.0
PXE booting via iPXE and observing that the DHCP IP changes on every boot. This is undesired.
I tracked this down to the DHCP client identifier changing on every boot. This is because networkd now defaults to ClientIdentifier=duid (see http://man7.org/linux/man-pages/man5/systemd.network.5.html)
This might make sense when booting from disk - but when PXE booting is detected CoreOS should change that parameter to ClientIdentifer=mac before starting the network. This will follow the PXE RFC for IPv4 client id generation. Not sure if networkd can do it, but for DHCPv6 the ClientIdentifier should be a type 3 DUID-LL for PXE.
This is similar to #360, but the solution 'use ignition' seems unworkable since the only way to get the ignition settings into a PXE environment is after the network has been started, which is too late to change the dhcp settings.
For reference, here is a DHCP trace of what is happening now:
System boot rom fetching iPXE:
iPXE fetching CoreOS:
CoreOS Booted:
The text was updated successfully, but these errors were encountered: