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

Cloud-init should support disabling ZEROCONF #5990

Open
ani-sinha opened this issue Jan 28, 2025 · 0 comments · May be fixed by #5991
Open

Cloud-init should support disabling ZEROCONF #5990

ani-sinha opened this issue Jan 28, 2025 · 0 comments · May be fixed by #5991
Labels
bug Something isn't working correctly new An issue that still needs triage

Comments

@ani-sinha
Copy link
Contributor

ani-sinha commented Jan 28, 2025

Zeroconf is described here: https://www.brennan.id.au/04-Network_Configuration.html#zeroconf
CentOS based distros support NOZEROCONF setting to disable it and kickstart sets NOZEROCONF=yes in /etc/sysconfig/network in some deployments without which the instance does not come up. However, cloud-init sysconfig renderer removes this setting as a part of https://github.com/canonical/cloud-init/blob/main/cloudinit/net/sysconfig.py#L1123 .

This issue was raised here https://bugzilla.redhat.com/show_bug.cgi?id=1653131 and we had a downstream hack to address this up until now. See also https://access.redhat.com/solutions/3958321.

I wonder if there is a better way to address this.
(a) a cloud-init native config setting to disable zeroconf would be ideal. So we cloud do

if network_state.disable_zeroconf:
   netcfg.append("NOZEROCONF=yes")

(b) If not, lets not wipe contents of /etc/sysconfig/network if it is present since it may contain necessary customizations. What we can do is read the contents and append

                netcfg.append("NETWORKING_IPV6=yes")
                netcfg.append("IPV6_AUTOCONF=no")

to it leaving existing contents as is. I will propose a patch for the second approach.

@ani-sinha ani-sinha added bug Something isn't working correctly new An issue that still needs triage labels Jan 28, 2025
ani-sinha added a commit to ani-sinha/cloud-init that referenced this issue Jan 28, 2025
…network

In some distros, /etc/sysconfig/network may have important cconfigurations that
are necessary for the instance to come up. For example, centos based distros
write NOZEROCONF=yes in /etc/sysconfig/network for some instances that require
zeroconf to be disabled. Removing these customizations would prevent the
instance to come up. So leave the customizations in /etc/sysconfig/network
intact except those that we are interested in.

Fixes canonicalGH-5990
Signed-off-by: Ani Sinha <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly new An issue that still needs triage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant