Skip to content

feat(opennebula): support ETHx_METHOD and ETHx_IP6_METHOD#6814

Open
mcanevet wants to merge 1 commit intocanonical:mainfrom
mcanevet:feat/opennebula-eth-method
Open

feat(opennebula): support ETHx_METHOD and ETHx_IP6_METHOD#6814
mcanevet wants to merge 1 commit intocanonical:mainfrom
mcanevet:feat/opennebula-eth-method

Conversation

@mcanevet
Copy link
Copy Markdown

Proposed Commit Message

feat(opennebula): support ETHx_METHOD and ETHx_IP6_METHOD

cloud-init's OpenNebula datasource always generated static Netplan
configuration, ignoring ETHx_METHOD and ETHx_IP6_METHOD entirely.

Add get_method() and get_ip6_method() helpers and rework the IPv4/IPv6
blocks in gen_conf() to branch on the configured method:

IPv4 (ETHx_METHOD):
- static (default): existing behaviour, no regression
- dhcp: emit dhcp4: true, no addresses
- skip: omit interface from Netplan output entirely

IPv6 (ETHx_IP6_METHOD):
- static (default when ETHx_IP6 or ETHx_IP6_GATEWAY is present):
  existing behaviour
- dhcp/dhcp6: emit dhcp6: true
- auto/slaac: emit accept-ra: true
- disable/skip: suppress all IPv6 config

Additional Context

Part of a series bringing cloud-init's OpenNebula datasource to feature
parity with the context-linux package from one-apps.

The get_ip6_method() helper infers the default IPv6 method from context:
if ETHx_IP6 or ETHx_IP6_GATEWAY is present, it defaults to static;
otherwise disable. This preserves backwards-compatible behaviour for all
existing tests.

Test Steps

In an OpenNebula VM context, set:

ETH0_METHOD="dhcp"

After boot, verify the interface obtains its IP via DHCP (no static
address in ip addr show).

For IPv6 SLAAC:

ETH0_IP6_METHOD="auto"

After boot, verify ip addr show shows a SLAAC-derived IPv6 address.

Merge type

  • Squash merge using "Proposed Commit Message"
  • Rebase and merge unique commits. Requires commit messages per-commit each referencing the pull request number (#<PR_NUM>)

@github-actions github-actions bot added the documentation This Pull Request changes documentation label Mar 30, 2026
@mcanevet mcanevet force-pushed the feat/opennebula-eth-method branch 2 times, most recently from 22a11c2 to ec4a406 Compare April 1, 2026 08:06
cloud-init's OpenNebula datasource always generated static Netplan
configuration, ignoring ETHx_METHOD and ETHx_IP6_METHOD entirely.

Add get_method() and get_ip6_method() helpers and rework the IPv4/IPv6
blocks in gen_conf() to branch on the configured method:

IPv4 (ETHx_METHOD):
- static (default): existing behaviour, no regression
- dhcp: emit dhcp4: true, no addresses
- skip: omit interface from Netplan output entirely

IPv6 (ETHx_IP6_METHOD):
- static (default when ETHx_IP6 or ETHx_IP6_GATEWAY is present):
  existing behaviour
- dhcp/dhcp6: emit dhcp6: true
- auto/slaac: emit accept-ra: true
- disable/skip: suppress all IPv6 config
@mcanevet mcanevet force-pushed the feat/opennebula-eth-method branch from ec4a406 to e7733bf Compare April 1, 2026 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation This Pull Request changes documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant