canonical / canonical/cloud-init

VMware datasource: guestinfo.local-ipv6 unset when iface has global + link-local IPv6

Open
#6,851 4 comments 0 reactions 0 assignees View on GitHub
bug incomplete
Dominant language
Python
Stars
3.8k
Forks
1.1k
Avg merge
2d 23h
Merged PRs (30d)
18

Description

# Bug report
On Linux, netinfo.netdev_info() records multiple IPv6 addresses per NIC (global + fe80). DataSourceVMware.get_default_ip_addrs() only assigns an IPv6 when len(netdev[iface]["ipv6"]) == 1, so IPv6 becomes None and guestinfo.local-ipv6 is never advertised. IPv4 works because there is typically a single IPv4 global address on the NIC.

## Steps to reproduce the problem
sudo python3 -c "from cloudinit.netinfo import netdev_info; n=netdev_info(); print({k: len(v.get('ipv6',[])) for k,v in n.items()})"
sudo python3 -c "import cloudinit.sources.DataSourceVMware as ds; print(ds.get_default_ip_addrs())"

Example: eth0 has ipv6 count 2, get_default_ip_addrs() returns (v4, None).

###Expected (arguable)
Exclude link-local/loopback/unspecified before applying the len == 1 rule.

###Actual
local-ipv6 absent; info-get guestinfo.local-ipv6 → no value.

## Environment details
- Cloud-init version: 25.1.3
- Operating System Distribution: VMware Photon OS 5.0
- Cloud provider, platform or installer type: vSphere VM

##References
Same tree: cloudinit/netinfo.py (_netdev_info_iproute_json), cloudinit/sources/DataSourceVMware.py (get_default_ip_addrs, guestinfo_set_value for local-ipv6).

## cloud-init logs

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.