Skip to content

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

@hpannem

Description

@hpannem

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working correctlyincompleteAction required by submitter

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions