Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IPv6 support for vmware_vmkernel #1740

Open
TheMysteriousX opened this issue May 14, 2023 · 7 comments · May be fixed by #2294
Open

IPv6 support for vmware_vmkernel #1740

TheMysteriousX opened this issue May 14, 2023 · 7 comments · May be fixed by #2294

Comments

@TheMysteriousX
Copy link

SUMMARY

At the moment, the vmware_vmkernel module only accepts IPv4 addressing.

As the vmware_host_tcpip_stacks module supports IPv6, so should the vmware_vmkernel one.

ISSUE TYPE
  • Feature Idea
COMPONENT NAME

vmware_vmkernel

ADDITIONAL INFORMATION

It would allow users to automate the addition of IPv6 addresses to vmkernel interfaces. vmware_host_tcpip_stacks already enables IPv6.

The vmware_host_tcpip_stacks module just prefixes the same variables with ipv6_ - the same could work here and look sensible, without breaking compatibility, e.g.:

-  name: Add Management vmkernel port using static network type
   community.vmware.vmware_vmkernel:
      hostname: '{{ esxi_hostname }}'
      username: '{{ esxi_username }}'
      password: '{{ esxi_password }}'
      esxi_hostname: '{{ esxi_hostname }}'
      vswitch_name: vSwitch0
      portgroup_name: PG_0001
      network:
        type: 'static'
        ip_address: 192.168.127.10
        subnet_mask: 255.255.255.0
        ipv6_type: 'static'
        ipv6_address: "a:b:c:d:e::f/64"
        ipv6_default_gateway: "a:b:c:d:e::1"
      state: present
      enable_mgmt: true

HostIpConfig appears to support IPv6 addresses alongside IPv4, encapsulated inside HostIpConfigIpV6AddressConfiguration.

@polly73
Copy link

polly73 commented Jan 9, 2025

Hallo we the same problem and cannot use this module for IPv6 configuration.
The example configuration of @TheMysteriousX c would be really nice to use.

@bastolino
Copy link

+1

@mariolenz
Copy link
Collaborator

For the record, it looks like there's a ipV6Config in HostIpConfig(vim.host.IpConfig).

@polly73
Copy link

polly73 commented Jan 22, 2025

For the record, it looks like there's a ipV6Config in HostIpConfig(vim.host.IpConfig).

would it work out of the box to use that in the ansible module?

@polly73
Copy link

polly73 commented Jan 23, 2025

well tried it out, does not work out of the box with the ansible module

Unsupported parameters for (community.vmware.vmware_vmkernel) module: network.ipV6Config. Supported parameters include: default_gateway, ip_address, subnet_mask, tcpip_stack, type.

@mariolenz
Copy link
Collaborator

mariolenz commented Jan 27, 2025

I've had a closer look at this, and it turns out to be more complicated than I thought. The ipV6Config doesn't only allow DHCPv6 and static configuration, but also auto configuration.

Additionally, it expects a list of IPv6 addresses. And they look a little bit more complicated than just address + netmask / prefix length.

Actually, I'm not really sure that I understand enough about IPv6 and how it's implemented in ESXi to come up with a solution in this module :-/

@TheMysteriousX
Copy link
Author

The HostIpConfigIpV6AddressConfiguration object is simpler than it looks - it is valid to have dhcp, autoconfig, and static addressing all switched on simultaneously, all disabled, or any combination thereof, so it's enough to just expose the toggles. They don't need to be mutually exclusive.

The extra options in HostIpConfigIpV6Address are there as the same object type is used when you query for the list of addresses, so can be mostly ignored - lifetime and dadState are populated by the hypervisor when the list of addresses is queried via the API.

For origin, you probably need to just allow the choice of 'manual' and 'other'. I don't see a valid use case for the others, as creating a DHCP or SLAAC address via the API makes no sense.

softwarefactory-project-zuul bot pushed a commit that referenced this issue Feb 2, 2025
SUMMARY
Improving the documentation a bit:

The options dealing with IP stuff is about IPv4.
ip_address and subnet_mask aren't required if state is absent.

ISSUE TYPE

Docs Pull Request

COMPONENT NAME
vmware_vmkernel
ADDITIONAL INFORMATION
#1740
#2295

Reviewed-by: Alexander Nikitin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants