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

[enhancement]: Add ability to pass specific ipv4/ipv6 options to network renderers #4621

Open
ani-sinha opened this issue Nov 22, 2023 · 11 comments
Labels
enhancement New feature or request

Comments

@ani-sinha
Copy link
Contributor

Enhancement

Please see the discussion in #4474 . Currently network renderers use various default settings for ip configurations. For example, settings for IPV4_FAILURE_FATAL and IPV6_FAILURE_FATAL in ifcfg files and may-fail settings for nm keyfiles. See tables 70 and 71 in https://people.freedesktop.org/~lkundrak/nm-docs/nm-settings-ifcfg-rh.html for various ipv4 and ipv6 options that can be set and how they translate to ifcfg files and keyfiles. Unfortunately, the defaults may not be appropriate for some use cases and it may be required to override the default values with specific values for some of these settings. My ask here to add to cloud-init ability to override some of these values. For example it could be similar to dhcpv6-override and dhcp4-override options that are currently available https://netplan.readthedocs.io/en/latest/netplan-yaml/#dhcp-overrides . Since the above override options seems set in stone and we cannot add arbitrary options, we can introduce a new set of override options, like ipv4-override or ipv6-override that maybe passed on to the renderers and then renderers can consume it appropriately.

@ani-sinha
Copy link
Contributor Author

See also #4439 .

@holmanb
Copy link
Member

holmanb commented Nov 22, 2023

@ani-sinha see my comment here

@holmanb
Copy link
Member

holmanb commented Dec 4, 2023

@ani-sinha is this still relevant given the approach in #4622?

@ani-sinha
Copy link
Contributor Author

@ani-sinha is this still relevant given the approach in #4622?

It might be relevant later if we wanted to override default values for some other use case. For now we got past it.

@ani-sinha
Copy link
Contributor Author

@ani-sinha is this still relevant given the approach in #4622?

It might be relevant later if we wanted to override default values for some other use case. For now we got past it.

This ticket is more generic than the fix for #4622 and if we can come up with a mechanism, it may be useful for other cases.

@holmanb holmanb removed the new An issue that still needs triage label Dec 11, 2023
@jsf9k
Copy link
Contributor

jsf9k commented Jan 10, 2024

It would certainly be useful to override the default setting of false for dhcp[46]-overrides.use-domains. We want to upgrade our AMIs from Debian Bullseye to Debian Bookworm; however, on our Bookworm AMIs cloud-init uses the instance metadata to create a netplan config that does not specify dhcp[46]-overrides.use-domains and hence search domains from DHCP get ignored.

It looks like this user was experiencing the same problem a few years back. Does anyone know a workaround for dealing with this, other than modifying the systemd-networkd configurations after they are generated?

@holmanb
Copy link
Member

holmanb commented Jan 10, 2024

Hey @jsf9k, thanks for the comment. I want to make sure that I understand correctly, so I'll rephrase and ask you to confirm.

You are saying that you wish to set dhcp[46]-overrides.use-domains to true, but you cannot do that because you cannot control the instance metadata provided by the cloud. @jsf9k is that correct?

@jsf9k
Copy link
Contributor

jsf9k commented Jan 10, 2024

Thanks for the quick response @holmanb!

You're very close. I don't think that dhcp[46]-overrides.use-domains is specified in the instance metadata at all, but I'd still like to override the default value of false.

(I'm assuming that cloud-init generates the /etc/netplan/50-cloud-init.yaml file based on information collected from the instance metadata, but maybe I'm wrong about that.)

@holmanb
Copy link
Member

holmanb commented Jan 10, 2024

I don't think that dhcp[46]-overrides.use-domains is specified in the instance metadata at all

Which cloud are you using? It should be possible (from cloud-init's perspective) for the cloud to define this setting to true, but I think you are saying that they don't, right?

but I'd still like to override the default value of false.

Got that. Cloud-init doesn't currently allow users to - at runtime - define their own network settings. Currently network settings can only be set 1) by the datasource (via metadata), 2) by the user (by setting the configuration in /etc/cloud/cloud.cfg.d/*), and 2) in some cases via the kernel command line.

It sounds like you want to set this key yourself, since the datasource's instance metadata isn't doing it.

@jsf9k I just created this issue to track the request for users to define networking configuration to be applied at runtime.

@jsf9k
Copy link
Contributor

jsf9k commented Jan 10, 2024

I don't think that dhcp[46]-overrides.use-domains is specified in the instance metadata at all

Which cloud are you using? It should be possible for the cloud to define this setting to true, but I think you are saying that they don't, right?

I'm using AWS. 🤷‍♂️

but I'd still like to override the default value of false.

Got that. Cloud-init doesn't currently allow users to - at runtime - define their own network settings. Currently network settings can only be set 1) by the datasource (via metadata), 2) by the user (by setting the configuration in /etc/cloud/cloud.cfg.d/*), and 2) in some cases via the kernel command line.

It sounds like I'll have to use runcmd to edit the /etc/netplan/50-cloud-init.yaml file that cloud-init produces, then run netplan generate. Do you see any other workaround?

It sounds like you want to set this key yourself, since the datasource's instance metadata isn't doing it.

@jsf9k I just created this issue to track the request for users to define networking configuration to be applied at runtime.

Thanks for creating an issue! Yes, I want to set this key myself. There are several other keys under dhcp[46]-overrides that folks might want to override for other use cases.

@holmanb
Copy link
Member

holmanb commented Jan 10, 2024

Thanks for creating an issue! Yes, I want to set this key myself. There are several other keys under dhcp[46]-overrides that folks might want to override for other use cases.

No problem, I'm glad we're on the same page.

This issue's title reads similarly to the new one I created, but this is actually a different topic. This issue is related to changing the existing configuration to define new keys, not to adding users' ability to define network configuration.

Lets continue the conversation over on the new issue, since this one is a separate topic. I'll respond to your question over there.

@github-actions github-actions bot added the Stale label Sep 17, 2024
@aciba90 aciba90 removed the Stale label Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants