Skip to content

feat(opennebula): support ETHx_ALIASn_IP/MASK for anycast addresses#6876

Open
mcanevet wants to merge 1 commit into
canonical:mainfrom
mcanevet:feat/opennebula-eth-aliases
Open

feat(opennebula): support ETHx_ALIASn_IP/MASK for anycast addresses#6876
mcanevet wants to merge 1 commit into
canonical:mainfrom
mcanevet:feat/opennebula-eth-aliases

Conversation

@mcanevet
Copy link
Copy Markdown
Contributor

Proposed Commit Message

```
feat(opennebula): support ETHx_ALIASn_IP/MASK for anycast addresses

OpenNebula's context-linux package supports per-NIC alias addresses
(ETHx_ALIAS0_IP, ETHx_ALIAS1_IP, …) used for anycast IPs. Add
get_alias_addresses() to OpenNebulaNetwork and wire it into gen_conf()
so alias addresses appear in the Netplan v2 output alongside the
primary address. Missing MASK defaults to /32.
```

Additional Context

OpenNebula allows attaching multiple IP addresses to a single NIC via
ETH<x>_ALIAS<n>_IP / ETH<x>_ALIAS<n>_MASK context variables. These
are typically used for anycast or VIP addresses. Previously cloud-init
ignored them, leaving the addresses unconfigured on the guest.

Test Steps

  1. In OpenNebula, add alias addresses to a NIC context:
    ```
    ETH0_ALIAS0_IP = "192.168.1.10"
    ETH0_ALIAS0_MASK = "255.255.255.0"
    ETH0_ALIAS1_IP = "192.168.1.11"
    ```
  2. Boot a cloud-init enabled VM using that context.
  3. Verify the alias addresses appear on the interface:
    ```
    ip addr show eth0

    expected: 192.168.1.10/24 and 192.168.1.11/32 present

    ```
  4. Verify a NIC without aliases is unaffected.

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>)

Copilot AI review requested due to automatic review settings May 11, 2026 08:27
@github-actions github-actions Bot added the documentation This Pull Request changes documentation label May 11, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the OpenNebula datasource’s network configuration generation to include per-NIC alias (anycast/VIP) IPv4 addresses defined via ETH<x>_ALIAS<n>_IP / ETH<x>_ALIAS<n>_MASK, so they appear in the Netplan v2 addresses list alongside the primary address (defaulting missing masks to /32).

Changes:

  • Add OpenNebulaNetwork.get_alias_addresses() to collect alias IPv4 addresses from context.
  • Extend OpenNebulaNetwork.gen_conf() to append alias addresses into Netplan addresses.
  • Add unit tests and update OpenNebula datasource documentation for the new context variables.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
cloudinit/sources/DataSourceOpenNebula.py Implements alias address parsing and includes aliases in generated Netplan output.
tests/unittests/sources/test_opennebula.py Adds unit tests covering alias parsing and integration into gen_conf().
doc/rtd/reference/datasources/opennebula.rst Documents ETH<x>_ALIAS<n>_IP/MASK behavior and default mask handling.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread cloudinit/sources/DataSourceOpenNebula.py Outdated
OpenNebula's context-linux package supports per-NIC alias addresses
(ETHx_ALIAS0_IP, ETHx_ALIAS1_IP, …) used for anycast IPs. Add
get_alias_addresses() to OpenNebulaNetwork and wire it into gen_conf()
so alias addresses appear in the Netplan v2 output alongside the
primary address. Missing MASK defaults to /32.
@mcanevet mcanevet force-pushed the feat/opennebula-eth-aliases branch from 23811d2 to 16aff3a Compare May 11, 2026 08:54
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.

2 participants