-
Notifications
You must be signed in to change notification settings - Fork 884
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
Updates for 24.1.1 #5036
Updates for 24.1.1 #5036
Conversation
Force ds-identify to use the correct file mocks Set defaults for optional os-release fields [1] VERSION_ID and ID might not be set; set defaults. [1] man 5 os-release Fixes canonicalGH-5002
…nonical#5025) If DataSourceOracle fails to retrieve IMDS info in init-local, try again during network timeframe. Additionally, ensure max_wait, timeout, and retries are respected. LP: #2056194
In test_scaleway.py, test_metadata_connection_errors_legacy_ipv4_url assumes that a call to wait_for_url() will retry the number of retries specified by the datasource, but that retry number is used for readurl() calls, not wait_for_url() calls. The fact that the assertion happened to work previously was entirely incidental. Additionally, mock time.time() and time.sleep() calls so that we're not needlessly waiting in unit tests.
When processing multiple urls in wait_for_url and a timeout error occurs, the local variable url is None yet url_exc.url is set. Fallback to url_exc.url with url is unet to provide sensible warning messages: Calling '<full_failed_url>' failed [3/120s]: request error instead of: Calling 'None' failed [3/120s] LP: #2055077
I'm not sure 10 seconds is enough of a timeout. Azure will retry DHCP failures, but I expect the reduction from 300s/60s -> 10s will result in unexpected failures for other clouds where there is no retry. I see that dhcpcd offers a --timeout option which might be better than relying on subprocess timeout? Something to consider. In the meantime: - catch the TimeoutExpired exception and raise NoDhcpLeaseError to address below traceback - update the "dhclient" logs to "dhcpcd" ``` Traceback (most recent call last): File "/usr/lib/python3/dist-packages/cloudinit/sources/DataSourceAzure.py", line 851, in _get_data crawled_data = util.log_time( ^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/cloudinit/util.py", line 2825, in log_time ret = func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/cloudinit/sources/helpers/azure.py", line 45, in impl return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/cloudinit/sources/DataSourceAzure.py", line 630, in crawl_metadata self._setup_ephemeral_networking(timeout_minutes=timeout_minutes) File "/usr/lib/python3/dist-packages/cloudinit/sources/helpers/azure.py", line 45, in impl return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/cloudinit/sources/DataSourceAzure.py", line 440, in _setup_ephemeral_networking lease = self._ephemeral_dhcp_ctx.obtain_lease() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/cloudinit/net/ephemeral.py", line 288, in obtain_lease self.lease = maybe_perform_dhcp_discovery( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/cloudinit/net/dhcp.py", line 102, in maybe_perform_dhcp_discovery return distro.dhcp_client.dhcp_discovery(interface, dhcp_log_func, distro) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/cloudinit/net/dhcp.py", line 649, in dhcp_discovery out, err = subp.subp( ^^^^^^^^^^ File "/usr/lib/python3/dist-packages/cloudinit/subp.py", line 276, in subp out, err = sp.communicate(data, timeout=timeout) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/subprocess.py", line 1209, in communicate stdout, stderr = self._communicate(input, endtime, timeout) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/subprocess.py", line 2114, in _communicate self._check_timeout(endtime, orig_timeout, stdout, stderr) File "/usr/lib/python3.12/subprocess.py", line 1253, in _check_timeout raise TimeoutExpired( subprocess.TimeoutExpired: Command '[b'/usr/sbin/dhcpcd', b'--ipv4only', b'--waitip', b'--persistent', b'--noarp', b'--script=/bin/true', b'eth0']' timed out after 10 seconds ``` Signed-off-by: Chris Patterson <cpatterson@microsoft.com>
canonical#5030) Add RENAMED_MODULES to allow support for custom /etc/cloud/cloud.cfg.d/* which may still contain the old ubuntu_advantage module name instead of ubuntu_pro. While the typical package upgrade path would replace ubuntu_avantage with ubuntu_pro in /etc/cloud/cloud.cfg. It's possible a customer has a customized /etc/cloud/cloud.cfg that they do not wish to update with the version delivered by the cloud-init upstream package. In cases where ubuntu_advantage is listed in system config, allow cloud-init to WARN about the rename, but still load and run ubuntu_pro. Fixes canonicalGH-5019
Both the klibc initramfs code and the eni code will write a network v1 configuration including the broadcast address if it is provided. It gets rendered if using the eni renderer. LP: #2056460
@blackboxsw I can finish up 5021 and review this Monday |
+1 agreed, I'll add a comment about that to the PR description
+1 thanks @TheRealFalcon |
…anonical#5021) bug(vmware): initialize new DataSourceVMware attributes at unpickle When a datasource has already been cached from a previous boot, the datasource is deserialized from the cached object instead of running __init__ method. Across a cloud-init package upgrade if new instance attributes have been initialized in __init__, we need to also initialize them in the class _unpickle method to avoid AttributeErrors for any instance methods referencing new attributes. Fix AttributeError on rpctool and rpctool_fn LP: #2056439
…al#5039) Ensure `metadata_address` is ignored in the _unpickle test for DataSourceCloudStack. It has existed for many years.
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!
If you plan on using the list of cherry-picks in the commit message, just make sure you update it with the last 3.
24.1.1
Include the bugfixes planned for 24.1.1 (and dependent commits to avoid cherry-pick conflicts and failing tests), waiting on #5021 and #5028 to land and then will include them in this PR.
2516aed (HEAD -> 24.1.x, origin/24.1.x) fix: Add "broadcast" to network v1 schema (#5034)
db8272a pro: honor but warn on custom ubuntu_advantage in /etc/cloud/cloud.cfg (#5030)
95d6a65 net/dhcp: handle timeouts for dhcpcd (#5022)
1c4b7d5 fix: Make wait_for_url respect explicit arguments
888507d bug(wait_for_url): when exceptions occur url is unset, use url_exc
74481d2 test: Fix scaleway retry assumptions
a5aba0c fix: Make DataSourceOracle more resilient to early network issues (#5025)
38b69c8 tests: Fix wsl test (#5008)