feat(opennebula): support ETHx_ALIASn_IP/MASK for anycast addresses#6876
Open
mcanevet wants to merge 1 commit into
Open
feat(opennebula): support ETHx_ALIASn_IP/MASK for anycast addresses#6876mcanevet wants to merge 1 commit into
mcanevet wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
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 Netplanaddresses. - 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.
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.
23811d2 to
16aff3a
Compare
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
```
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>_MASKcontext variables. Theseare typically used for anycast or VIP addresses. Previously cloud-init
ignored them, leaving the addresses unconfigured on the guest.
Test Steps
```
ETH0_ALIAS0_IP = "192.168.1.10"
ETH0_ALIAS0_MASK = "255.255.255.0"
ETH0_ALIAS1_IP = "192.168.1.11"
```
```
ip addr show eth0
expected: 192.168.1.10/24 and 192.168.1.11/32 present
```Merge type