vsphere/internal/vmworkflow/virtual_machine_customize_subresource.go
func expandCustomizationIPSettingsIPV6AddressSpec(d *schema.ResourceData, n int, gwAdd bool) (*types.CustomizationIPSettingsIpV6AddressSpec, bool) {
	v, ok := d.GetOk(netifKey("ipv6_address", n))
	var gwFound bool
	if !ok {
		return nil, gwFound
	}
	addr := v.(string)
	mask := d.Get(netifKey("ipv6_netmask", n)).(int)
	gw, gwOk := d.Get(cKeyPrefix + "." + "ipv6_gateway").(string)
	obj := &types.CustomizationIPSettingsIpV6AddressSpec{
		Ip: []types.BaseCustomizationIpV6Generator{
			&types.CustomizationFixedIpV6{
				IpAddress:  addr,
				SubnetMask: int32(mask),
			},
		},
	}
	if gwAdd && gwOk && matchGateway(addr, mask, gw) {
		obj.Gateway = []string{gw}
		gwFound = true
	}
	return obj, gwFound
}
func expandCustomizationIPSettingsIPV6AddressSpec(d *schema.ResourceData, n int, gwAdd bool) (*types.CustomizationIPSettingsIpV6AddressSpec, bool) {
	v, ok := d.GetOk(netifKey("ipv6_address", n))
	var gwFound bool
	if !ok {
		return nil, gwFound
	}
	addr := v.(string)
	mask := d.Get(netifKey("ipv6_netmask", n)).(int)
	gw, gwOk := d.Get(cKeyPrefix + "." + "ipv6_gateway").(string)
	obj := &types.CustomizationIPSettingsIpV6AddressSpec{
		Ip: []types.BaseCustomizationIpV6Generator{
			&types.CustomizationFixedIpV6{
				IpAddress:  addr,
				SubnetMask: int32(mask),
			},
		},
	}
	if gwAdd && gwOk && matchGateway(addr, mask, gw) {
		obj.Gateway = []string{gw}
		gwFound = true
	}
	return obj, gwFound
}
// expandCustomizationIPSettingsIPV6AddressSpec reads certain ResourceData keys and
// returns a CustomizationIPSettingsIpV6AddressSpec.