You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support disabling initramfs networking via Ignition #979
Support running part of ignition before networking comes up
Environment
RHCOS
What hardware/cloud provider/hypervisor is being used to run Ignition?
Baremetal
Desired Feature
For baremetal IPI platform in OpenShift, we load ignition from disk. We would like to include network configuration that happens before NetworkManager starts. For example, we want to disable dhcp on some interfaces. If we can't do that, then on some hosts that could have upwards of 10 (!) interfaces, booting takes an extraordinary long time.
Also, when an ignition contains an 'append' with a network source, it's conceivable we need to do some pre-configuration to make that network endpoint accessible (for example, we need to configure a VLAN on an interface).
Other Information
It's almost like we need a pre-ignition tool (preflight?) analogous to what afterburn is doing post-ignition.
I did read through that but it's very tied to solving the problem by embedding an ignition in an ISO, rather than letting ignition do some things before and after networkmanger is up.
What I'd argued in one of the epic number of tickets around this is that I think all we need to do for all the major clouds that use the link-local address is bring up networking enough to do that, then we could pull network configuration out of the Ignition itself - then we can do static networking in clouds too (not that most people want this).
That said, if we fixed openshift/machine-config-operator#1690 then you guys could "flatten" the config into /boot/config.ign and then you wouldn't need networking in the initramfs at all, right? I go back and forth on whether or not this is a good idea; it takes away some control from the MCO.
rather than letting ignition do some things before and after networkmanger is up.
But we'd need to flesh out more what that would look like. Something like:
That said, if we fixed openshift/machine-config-operator#1690 then you guys could "flatten" the config into /boot/config.ign and then you wouldn't need networking in the initramfs at all, right? I go back and forth on whether or not this is a good idea; it takes away some control from the MCO.
That addresses the immediate problem for us, but not the general use. It makes complete sense to use network data sources for append/merge in ignition, but there's always going to be a circular dependency on environments that have networks that need configuration.
rather than letting ignition do some things before and after networkmanger is up.
But we'd need to flesh out more what that would look like. Something like:
"initramfs-network": {
"dhcp": false,
"args": "ip=192.xxx...."
Or just support writing arbitrary things into /etc/NetworkManager before it > starts, basically a filesystem bit that applies to the initramfs?
Maybe? I don't understand entirely how the initramfs dracut/ignition stuff interact -- is the /etc/NetworkManager at that stage in the ramdisk or is that the host's eventual configuration?
We may need a meeting on this but I really want to walk though how the Live ISO changes the game for you guys. Hmm....I think we maybe do need to support some flag/mechanism for the Live ISO to disable networking in the initramfs even if Ignition is injected.
Maybe? I don't understand entirely how the initramfs dracut/ignition stuff interact -- is the /etc/NetworkManager at that stage in the ramdisk or is that the host's eventual configuration?
We use NM in the initrd too (RHCOS will after 8.2). There's no required linkage between the initramfs configuration and the real root; most people will want them to be the same (see coreos/ignition-dracut#89 ) but like that PR we can add an option to avoid propagating them to the real root.
Related: #956 (which would also be smart enough to handle live ISO with embedded Ignition configs). It's also an on-ramp for supporting fetching Ignition configs over link-local addresses.
I'm very hesitant to allow Ignition to configure the initramfs itself. I'd prefer we stay away from that for as long as we can because it essentially introduces the same problem for the initrd which Ignition was meant to solve for the real root.
It makes complete sense to use network data sources for append/merge in ignition, but there's always going to be a circular dependency on environments that have networks that need configuration.
We've been working hard on improving the situation there. :) In addition to the links above, see also coreos/fedora-coreos-tracker#460. I agree with Colin that we should push further on the live ISO embedded config path for bare metal, and investigate the link-local approach for clouds. (I'm also not sure how Ignition can correctly implement the RFE here if e.g. you configure networking in the base config, but then one of the merge configs actually wants to override what the config file should have been.)
I'm very hesitant to allow Ignition to configure the initramfs itself. I'd prefer we stay away from that for as long as we can because it essentially introduces the same problem for the initrd which Ignition was meant to solve for the real root.
Would it be kernel command line arguments then for this configuration? I wasn't sure if that worked in rhcos, since we tried it when we were trying to get IPv6 working. Can you do VLAN configuration with those arguments?
It makes complete sense to use network data sources for append/merge in ignition, but there's always going to be a circular dependency on environments that have networks that need configuration.
We've been working hard on improving the situation there. :) In addition to the links above, see also coreos/fedora-coreos-tracker#460. I agree with Colin that we should push further on the live ISO embedded config path for bare metal, and investigate the link-local approach for clouds.
The ISO approach for bare metal isn't going to work in the IPI case, and that seems to be ignored in the present designs. We do exist and have customers. We have some initial discussions about how we can use the live ISO for IPI but it's going to be later than we need this problem solved.
I also don't see how the live ISO case fits into OpenShift, because the installer generates a stub ignition with network dependencies and you're going to run into customers with these complex network requirements. I don't see where that use case is being addressed.
(I'm also not sure how Ignition can correctly implement the RFE here if e.g. you configure networking in the base config, but then one of the merge configs actually wants to override what the config file should have been.)
You could have something like afterburn to be able to do preflight configuration before ignition runs.
I'm very hesitant to allow Ignition to configure the initramfs itself. I'd prefer we stay away from that for as long as we can because it essentially introduces the same problem for the initrd which Ignition was meant to solve for the real root.
If it's just constrained to networking though, that seems not too bad.
And actually perhaps to start, we could offer exactly one thing - the ability for Ignition to disable initramfs networking. That would allow using coreos-installer iso embed to be fully programmable - the system boots live, the live Ignition can bring up the network however it wants (or not), and run coreos-installer however it wants, providing that Ignition config however it wants, etc.
In particular once we have osmet, I suspect a lot of cases could get away with not even bringing up the network at all in the live OS.
changed the title [-]Support running part of ignition before networking comes up[/-][+]Support disabling initramfs networking via Ignition[/+]on May 21, 2020
Yeah I am increasingly certain that we missed this important case of "Ignition provided, but does not require networking in the initramfs" in all of the recent work following coreos/fedora-coreos-tracker#443
I took a look at the recent libvirt testing scripts and it looks like to me theyl use the default bridged network which still has DHCP enabled. So what happens here is when we're doing a static config in those tests...we still used (and required!) DHCP in the initramfs.
That's not going to work for environments without DHCP at all, or even just ones where we don't want to DHCP on each NIC but not all of them etc.
the deployer is now responsible for knowing internal details of how we are moving things around in RHCOS/FCOS land.
Yeah, it would practically require a downstream addition to the ramdisk. I'd like to note that ironic-python-agent is designed to be pretty flexible, so it's not an entirely bad thing either. We're working on a thing called "deploy steps" specifically to allow site-specific customizations.
it has been done before
I think CoreOS was so different at the time that it won't help us (and we did some ugly things like chroot in tarball contents).
the baremetal box is treated like a cloud VM - you provide an OS disk image, and optionally some user-data/meta-data (which in the metal3 case happens via a config-drive partition)
OK right, that makes a lot of sense now.
I suspect this is where we want to get to, the main challenge is right now we depend on some features of ironic-python-agent (in particular introspection), so the RHCOS/FCOS ramdisk isn't a drop-in replacement.
So to recap, I think we're agreed on where we want to go long-term. And the question now is how to get this working in the short-term with the existing constraints of the deployer. @hardys Do I understand correctly that the "edit image" hack should work for now?
So to recap, I think we're agreed on where we want to go long-term. And the question now is how to get this working in the short-term with the existing constraints of the deployer. @hardys Do I understand correctly that the "edit image" hack should work for now?
Long term, look to align the IPI deploy ramdisk with the coreos-install based solution (as mentioned there are significant issues to resolve here so we'll have to figure those out which may take some time/prioritization)
Short term workaround is to edit the RHCOS image (we'll need some docs/kbase downstream for this)
In recent ironic (~ a week ago) you can drop a python plugin to IPA that will be called automatically during deployment to do.. pretty much whatever you want. We can have a downstream plugin that does $stuff for us as a short-term workaround.
Short term workaround is to edit the RHCOS image (we'll need some docs/kbase downstream for this)
In recent ironic (~ a week ago) you can drop a python plugin to IPA that will be called automatically during deployment to do.. pretty much whatever you want. We can have a downstream plugin that does $stuff for us as a short-term workaround.
@dtantsur sounds interesting - can you link any docs/examples? Could we modify /boot (sed the grub.cfg and/or drop some file in there) after IPA writes the OS image? What would the interface from ironic look like?
sounds interesting - can you link any docs/examples?
It's a brand new feature, I'm going to work on examples this/next week.
Could we modify /boot (sed the grub.cfg and/or drop some file in there) after IPA writes the OS image?
Yes! But do you really need it to happen afterwards or do you need to modify /etc/defaults/grub before grub installation? I think the latter is a bit more robust.
What would the interface from ironic look like?
There are options. If we create an openshift-specific plugin, it may have no interface at all, just silently do what we need. If you could remind me what exactly we need to do (I'm a bit lost in the history of this issue), I can say specifically.
Could we modify /boot (sed the grub.cfg and/or drop some file in there) after IPA writes the OS image?
Yes! But do you really need it to happen afterwards or do you need to modify /etc/defaults/grub before grub installation? I think the latter is a bit more robust.
All these are things that coreos-installer has native support for (via e.g. --copy-network, --append-karg, --delete-karg), so once we switch over to that for the install, it'll be easier/safer to do these modifications.
All these are things that coreos-installer has native support for (via e.g. --copy-network, --append-karg, --delete-karg), so once we switch over to that for the install, it'll be easier/safer to do these modifications.
I'm not sure it's going to happen, at least not in all scenarios.
All these are things that coreos-installer has native support for (via e.g. --copy-network, --append-karg, --delete-karg), so once we switch over to that for the install, it'll be easier/safer to do these modifications.
@jlebon can you link any docs on how this works in an automated environment? E.g if you pxe boot the installer ramdisk, how does this data get provided to coreos-installer for a non-interactive deploy?
As @dtantsur says there is some uncertainty/challenge in making this change (hence I mention it as a long term plan above), so we'll need to investigate further.
We'll need to document a workaround in the meantime - does anything exist (upstream or downstream) that describes the process of using virt-customize to drop additional network configuration in /boot? (I know the virt-customize commands, but not certain on the network file format expected, and we need something downstream to share with $customer).
@jlebon can you link any docs on how this works in an automated environment? E.g if you pxe boot the installer ramdisk, how does this data get provided to coreos-installer for a non-interactive deploy?
We don't have good docs yet for that right now, but in an automated environment, you would script a systemd unit which calls coreos-installer install --copy-network --append-karg foo ....
Q: How do I disable initramfs networking via Ignition?
A: You provide an Ignition config that doesn't have any remote references.
This implies it doesn't require networking and no networking will be brought up in the initramfs.
The caveat to this is that there are some platforms that only get their Ignition configuration by using the network, so it's not really possible to disable it on those platforms, nor would you want to.
* Q: How do I disable initramfs networking via Ignition?
* A: You provide an Ignition config that doesn't have any remote references.
* This implies it doesn't require networking and no networking will be brought up in the initramfs.
The caveat to this is that there are some platforms that only get their Ignition configuration by using the network, so it's not really possible to disable it on those platforms, nor would you want to.
I pushed openshift/enhancements#467 so we can discuss some ideas around the "flattened ignition" solution, which (where appropriate, and in particular for IPI baremetal) could enable a MCO managed Ignition config that doesn't have any remote references
Shall we close this issue out?
It seems the the conclusion of the discussion so far is that we won't fix this by adding some new ignition interface for early network config, so that seems reasonable to me.
For people following Fedora CoreOS: the work for coreos/fedora-coreos-tracker#443 was first introduced in testing stream release 32.20200715.2.2 and stable stream release 32.20200715.3.0.
Activity
stbenjam commentedon May 14, 2020
@cgwalters What do you think of something like this?
hardys commentedon May 14, 2020
To link this to a real (OpenShift) use-case, see https://bugzilla.redhat.com/show_bug.cgi?id=1824331 - in some baremetal environments the external network can be on a tagged vlan, so you have to do some configuration via ignition before the
append(in v2.x) URL can be evaluated. I guess a similar issue exists with themergefeature in v3.cgwalters commentedon May 14, 2020
A lot of overlap here with openshift/enhancements#291
cgwalters commentedon May 14, 2020
See also https://github.com/coreos/ignition-dracut/issues/94
stbenjam commentedon May 14, 2020
I did read through that but it's very tied to solving the problem by embedding an ignition in an ISO, rather than letting ignition do some things before and after networkmanger is up.
stbenjam commentedon May 14, 2020
Yea that's a similar problem, but we are using https://coreos.com/os/docs/latest/config-drive.html instead, so I'm not sure this issue helps us
cgwalters commentedon May 14, 2020
What I'd argued in one of the epic number of tickets around this is that I think all we need to do for all the major clouds that use the link-local address is bring up networking enough to do that, then we could pull network configuration out of the Ignition itself - then we can do static networking in clouds too (not that most people want this).
That said, if we fixed openshift/machine-config-operator#1690 then you guys could "flatten" the config into
/boot/config.ignand then you wouldn't need networking in the initramfs at all, right? I go back and forth on whether or not this is a good idea; it takes away some control from the MCO.But we'd need to flesh out more what that would look like. Something like:
Or just support writing arbitrary things into
/etc/NetworkManagerbefore it starts, basically afilesystembit that applies to the initramfs?stbenjam commentedon May 14, 2020
That addresses the immediate problem for us, but not the general use. It makes complete sense to use network data sources for append/merge in ignition, but there's always going to be a circular dependency on environments that have networks that need configuration.
Maybe? I don't understand entirely how the initramfs dracut/ignition stuff interact -- is the /etc/NetworkManager at that stage in the ramdisk or is that the host's eventual configuration?
cgwalters commentedon May 15, 2020
We may need a meeting on this but I really want to walk though how the Live ISO changes the game for you guys. Hmm....I think we maybe do need to support some flag/mechanism for the Live ISO to disable networking in the initramfs even if Ignition is injected.
We use NM in the initrd too (RHCOS will after 8.2). There's no required linkage between the initramfs configuration and the real root; most people will want them to be the same (see coreos/ignition-dracut#89 ) but like that PR we can add an option to avoid propagating them to the real root.
jlebon commentedon May 15, 2020
Related: #956 (which would also be smart enough to handle live ISO with embedded Ignition configs). It's also an on-ramp for supporting fetching Ignition configs over link-local addresses.
jlebon commentedon May 15, 2020
I'm very hesitant to allow Ignition to configure the initramfs itself. I'd prefer we stay away from that for as long as we can because it essentially introduces the same problem for the initrd which Ignition was meant to solve for the real root.
We've been working hard on improving the situation there. :) In addition to the links above, see also coreos/fedora-coreos-tracker#460. I agree with Colin that we should push further on the live ISO embedded config path for bare metal, and investigate the link-local approach for clouds. (I'm also not sure how Ignition can correctly implement the RFE here if e.g. you configure networking in the base config, but then one of the
mergeconfigs actually wants to override what the config file should have been.)stbenjam commentedon May 15, 2020
Would it be kernel command line arguments then for this configuration? I wasn't sure if that worked in rhcos, since we tried it when we were trying to get IPv6 working. Can you do VLAN configuration with those arguments?
The ISO approach for bare metal isn't going to work in the IPI case, and that seems to be ignored in the present designs. We do exist and have customers. We have some initial discussions about how we can use the live ISO for IPI but it's going to be later than we need this problem solved.
I also don't see how the live ISO case fits into OpenShift, because the installer generates a stub ignition with network dependencies and you're going to run into customers with these complex network requirements. I don't see where that use case is being addressed.
You could have something like afterburn to be able to do preflight configuration before ignition runs.
OpenStack config drives have network metadata for similar reasons: https://docs.openstack.org/nova/latest/user/metadata.html.
cgwalters commentedon May 19, 2020
If it's just constrained to networking though, that seems not too bad.
And actually perhaps to start, we could offer exactly one thing - the ability for Ignition to disable initramfs networking. That would allow using
coreos-installer iso embedto be fully programmable - the system boots live, the live Ignition can bring up the network however it wants (or not), and runcoreos-installerhowever it wants, providing that Ignition config however it wants, etc.In particular once we have osmet, I suspect a lot of cases could get away with not even bringing up the network at all in the live OS.
[-]Support running part of ignition before networking comes up[/-][+]Support disabling initramfs networking via Ignition[/+]cgwalters commentedon May 21, 2020
Yeah I am increasingly certain that we missed this important case of "Ignition provided, but does not require networking in the initramfs" in all of the recent work following coreos/fedora-coreos-tracker#443
I took a look at the recent libvirt testing scripts and it looks like to me theyl use the default bridged network which still has DHCP enabled. So what happens here is when we're doing a static config in those tests...we still used (and required!) DHCP in the initramfs.
That's not going to work for environments without DHCP at all, or even just ones where we don't want to DHCP on each NIC but not all of them etc.
openshift/enhancements#291 is not complete IMO until we fix this.
Oh right actually, this is exactly what this issue is: coreos/coreos-installer#164
46 remaining items
dtantsur commentedon Jun 22, 2020
Yeah, it would practically require a downstream addition to the ramdisk. I'd like to note that ironic-python-agent is designed to be pretty flexible, so it's not an entirely bad thing either. We're working on a thing called "deploy steps" specifically to allow site-specific customizations.
I think CoreOS was so different at the time that it won't help us (and we did some ugly things like chroot in tarball contents).
jlebon commentedon Jun 22, 2020
OK right, that makes a lot of sense now.
So to recap, I think we're agreed on where we want to go long-term. And the question now is how to get this working in the short-term with the existing constraints of the deployer. @hardys Do I understand correctly that the "edit image" hack should work for now?
If we can do the flattened Ignition config thing, this could also be solved by coreos/fedora-coreos-config#426.
hardys commentedon Jul 21, 2020
Sorry for the delay responding @jlebon yes I think that's accurate, so to summarize:
@stbenjam @kirankt does that sound reasonable?
dtantsur commentedon Jul 21, 2020
In recent ironic (~ a week ago) you can drop a python plugin to IPA that will be called automatically during deployment to do.. pretty much whatever you want. We can have a downstream plugin that does $stuff for us as a short-term workaround.
hardys commentedon Jul 21, 2020
@dtantsur sounds interesting - can you link any docs/examples? Could we modify /boot (sed the grub.cfg and/or drop some file in there) after IPA writes the OS image? What would the interface from ironic look like?
dtantsur commentedon Jul 22, 2020
It's a brand new feature, I'm going to work on examples this/next week.
Yes! But do you really need it to happen afterwards or do you need to modify
/etc/defaults/grubbefore grub installation? I think the latter is a bit more robust.There are options. If we create an openshift-specific plugin, it may have no interface at all, just silently do what we need. If you could remind me what exactly we need to do (I'm a bit lost in the history of this issue), I can say specifically.
jlebon commentedon Jul 22, 2020
Note FCOS and RHCOS don't use
grub2-mkconfig, but pure BLS: https://www.freedesktop.org/wiki/Specifications/BootLoaderSpec/. So the canonical kargs live in the BLS configs at$(boot)/loader/entries/and that's what you'd typically modify after install. But here we're mostly talking about mounting boot in order to drop network configs in there.All these are things that
coreos-installerhas native support for (via e.g.--copy-network,--append-karg,--delete-karg), so once we switch over to that for the install, it'll be easier/safer to do these modifications.dtantsur commentedon Jul 22, 2020
I'm not sure it's going to happen, at least not in all scenarios.
hardys commentedon Jul 23, 2020
@jlebon can you link any docs on how this works in an automated environment? E.g if you pxe boot the installer ramdisk, how does this data get provided to coreos-installer for a non-interactive deploy?
As @dtantsur says there is some uncertainty/challenge in making this change (hence I mention it as a long term plan above), so we'll need to investigate further.
We'll need to document a workaround in the meantime - does anything exist (upstream or downstream) that describes the process of using virt-customize to drop additional network configuration in /boot? (I know the virt-customize commands, but not certain on the network file format expected, and we need something downstream to share with $customer).
jlebon commentedon Jul 23, 2020
We don't have good docs yet for that right now, but in an automated environment, you would script a systemd unit which calls
coreos-installer install --copy-network --append-karg foo ....If you're rolling your own code, you can of course do the same thing
coreos-installerdoes when handling these args. For--copy-network, you would copy the NM keyfiles into$bootmnt/coreos-firstboot-network(see the code that handles this on firstboot here: https://github.com/coreos/fedora-coreos-config/blob/87f5c512ad60e4f37c2b10434dda2e59e40dd97a/overlay.d/05core/usr/lib/dracut/modules.d/15coreos-network/coreos-copy-firstboot-network.sh). For kargs, you can modify theoptionsline in the BLS configs in$bootmnt/loader/entries.dustymabe commentedon Aug 21, 2020
Since coreos/fedora-coreos-config#426 merged (fixes coreos/fedora-coreos-tracker#443) it feels like the question of how to "Support disabling initramfs networking via Ignition" is answered.
The caveat to this is that there are some platforms that only get their Ignition configuration by using the network, so it's not really possible to disable it on those platforms, nor would you want to.
Shall we close this issue out?
hardys commentedon Sep 2, 2020
I pushed openshift/enhancements#467 so we can discuss some ideas around the "flattened ignition" solution, which (where appropriate, and in particular for IPI baremetal) could enable a MCO managed Ignition config that doesn't have any remote references
It seems the the conclusion of the discussion so far is that we won't fix this by adding some new ignition interface for early network config, so that seems reasonable to me.
dustymabe commentedon Sep 2, 2020
Thanks @hardys - Will follow along the discussion in openshift/enhancements#467
dustymabe commentedon Sep 2, 2020
For people following Fedora CoreOS: the work for coreos/fedora-coreos-tracker#443 was first introduced in testing stream release
32.20200715.2.2and stable stream release32.20200715.3.0.