-
Notifications
You must be signed in to change notification settings - Fork 908
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
Ensure system_cfg read before ds net config on Oracle (SC-720) #1174
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trying to run through an Oracle test now to confirm expected behavior.
Co-authored-by: Chad Smith <chad.smith@canonical.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
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 --local
Without 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: