feat(datasource/aliyun): add IPv6 metaserver and DHCP strategy based on NIC metadata#6893
Open
challvy wants to merge 1 commit into
Open
feat(datasource/aliyun): add IPv6 metaserver and DHCP strategy based on NIC metadata#6893challvy wants to merge 1 commit into
challvy wants to merge 1 commit into
Conversation
…on NIC metadata - Add IPv6 metadata server address (http://[fd00:100::100:200]) as fallback endpoint in metadata_urls - Disable DHCPv4 when NIC metadata lacks 'private-ipv4s' field, indicating no IPv4 address is assigned to the interface - Enable DHCPv6 when 'ipv6s' field is present in NIC metadata - Remove dhcp4-overrides when DHCPv4 is disabled for the interface - Update unit tests to cover IPv6-only NIC, dual-stack NIC, and mixed multi-NIC scenarios Signed-off-by: Cang Yu <zhengcongwei.zcw@alibaba-inc.com>
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
Fixes #6892
Additional Context
The IPv6 metadata endpoint and IPv6-only ENIs are documented features
of Alibaba Cloud ECS. With these changes, cloud-init can correctly
fetch metadata and render network configuration on:
private-ipv4sonlyprivate-ipv4s+ipv6s(dual-stack)ipv6sonly (IPv6-only ENI)Backwards compatibility:
always contains
private-ipv4s, sodhcp4staystrue.metadata_urlsdoes not change behaviourwhen the IPv4 IMDS endpoint responds successfully.
Test Steps
Unit tests (covers all three NIC scenarios):
Expected: all tests pass, including the new
test_dhcp4_disabled_when_no_private_ipv4s,test_dhcp6_enabled_when_ipv6s_present, andtest_ipv6_only_nic_config.Live verification on an Alibaba Cloud ECS instance:
a. Launch a dual-stack ECS instance with both IPv4 and IPv6
addresses, boot with this cloud-init build, and confirm:
/run/cloud-init/instance-data.jsoncontains metadata fetchedfrom IMDS.
dhcp4: trueanddhcp6: truefor the dual-stack NIC.
b. Attach an IPv6-only secondary ENI (no
private-ipv4sinmetadata), reboot, and confirm:
dhcp4: falseanddhcp6: true.c. (Optional) Disable IPv4 IMDS on a test instance and confirm
cloud-init still reaches metadata via
http://[fd00:100::100:200].Merge type