Ensure system_cfg read before ds net config on Oracle (SC-720)#1174
Merged
Conversation
In 2c52e6e, the order of reading network config was changed for Oracle due to initramfs needing to take lower precedence than the datasource. However, this also bumped system_cfg to a lower precedence than ds, which means that any network configuration specified in /etc/cloud will not be applied. system_cfg should instead be moved above ds so network configuration in /etc/cloud takes precedence. LP: #1956788
blackboxsw
reviewed
Jan 13, 2022
Collaborator
blackboxsw
left a comment
There was a problem hiding this comment.
Trying to run through an Oracle test now to confirm expected behavior.
Co-authored-by: Chad Smith <chad.smith@canonical.com>
blackboxsw
approved these changes
Jan 15, 2022
Collaborator
blackboxsw
left a comment
There was a problem hiding this comment.
LGTM.
confirmed upgrade behavior without restart via sudo cloud-init init --local; sudo cloud-init init allows OracleDatasource to see the disabled config. Same across system reboot network is no longer rendered and instance remains accessible via ssh.
ubuntu@instance-20220115-0946:~$ grep 'disabled by' /var/log/cloud-init.log
2022-01-15 17:44:55,657 - stages.py[DEBUG]: network config disabled by system_cfg
2022-01-15 17:44:55,657 - stages.py[INFO]: network config is disabled by system_cfg
2022-01-15 17:44:56,102 - stages.py[DEBUG]: network config disabled by system_cfg
2022-01-15 17:44:56,102 - stages.py[INFO]: network config is disabled by system_cfg
...
ubuntu@instance-20220115-0946:~$ ls /etc/netplan/
ubuntu@instance-20220115-0946:~$
ubuntu@instance-20220115-0946:~$ cloud-init status --long
status: done
time: Sat, 15 Jan 2022 17:52:25 +0000
detail:
DataSourceOracle
ubuntu@instance-20220115-0946:~$ grep Trace /var/log/cloud-init.log
ubuntu@instance-20220115-0946:~$cloud-init can be re-enabled for networking on oracle by sudo rm /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg
TheRealFalcon
added a commit
to TheRealFalcon/cloud-init
that referenced
this pull request
Mar 10, 2022
3 tasks
This was referenced May 12, 2023
Closed
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed Commit Message
Additional Context
2c52e6e
Test Steps
Boot an Oracle instance using the Oracle datasource.
Create /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with contents
network: {config: disabled}rm /etc/netplan/50-cloud-init.yaml (or rename it if you need it)
cloud-init clean --logs && cloud-init init --localWithout patch, /etc/netplan/50-cloud-init.yaml should get written. With patch, it won't be written and logs should show no network written.
I can also include an Oracle-specific integration test, but wanted to get the PR up sooner rather than later.
Checklist: