Support large IPv6 subnet via NSX IPAM

New field Introduced in IPblockSubnet in order to cap the
maximum Ip Subnets across different clusters.

Jira: #NCP-439
Change-Id: I2e01f7e787c5be5d20256b96b19e9ce8b68edbe6
(cherry picked from commit 7b16449dab)
This commit is contained in:
tathgurt 2022-10-13 10:58:40 -07:00 committed by Salvatore Orlando
parent 3aba7fe4e3
commit 3068bfacb6
3 changed files with 16 additions and 3 deletions

View File

@ -165,6 +165,7 @@ NSX_VERSION_3_1_0 = '3.1.0'
NSX_VERSION_3_2_0 = '3.2.0'
NSX_VERSION_3_2_1 = '3.2.1'
NSX_VERSION_4_0_0 = '4.0.0'
NSX_VERSION_4_1_0 = '4.1.0'
# Features available depending on the NSX Manager backend version
FEATURE_MAC_LEARNING = 'MAC Learning'

View File

@ -1585,12 +1585,22 @@ class IpPoolBlockSubnetDef(IpPoolSubnetDef):
self._set_attr_if_specified(
body, 'ip_block_id', body_attr='ip_block_path',
value=ip_block_path)
# Attrs supported from NSX 3.0.0
self._set_attr_if_supported(body, 'start_ip')
# Attrs supported from NSX 4.1.0
self._set_attrs_if_supported(body, ['subnet_size',
'allocation_range'])
# Attribute "subnet size" is replacement for "size" attribute
# thus, removing redundancy
if 'subnet_size' in body:
body.pop('size', None)
return body
@property
def version_dependant_attr_map(self):
return {'start_ip': nsx_constants.NSX_VERSION_3_0_0}
return {'start_ip': nsx_constants.NSX_VERSION_3_0_0,
'subnet_size': nsx_constants.NSX_VERSION_4_1_0,
'allocation_range': nsx_constants.NSX_VERSION_4_1_0}
class IpPoolStaticSubnetDef(IpPoolSubnetDef):

View File

@ -3422,7 +3422,7 @@ class NsxPolicyIpPoolApi(NsxPolicyResourceBase):
ip_subnet_id=None, auto_assign_gateway=IGNORE,
name=IGNORE, description=IGNORE, tags=IGNORE,
tenant=constants.POLICY_INFRA_TENANT,
start_ip=IGNORE):
start_ip=IGNORE, v6_allocation_range=IGNORE):
ip_subnet_id = self._init_obj_uuid(ip_subnet_id)
args = self._get_user_args(
ip_pool_id=ip_pool_id,
@ -3434,7 +3434,9 @@ class NsxPolicyIpPoolApi(NsxPolicyResourceBase):
description=description,
tags=tags,
tenant=tenant,
start_ip=start_ip)
start_ip=start_ip,
subnet_size=str(size),
allocation_range=v6_allocation_range)
ip_subnet_def = core_defs.IpPoolBlockSubnetDef(
nsx_version=self.version, **args)