Standalone: Generate port map in a new format

The DeployedServerPortMap parameter was already deprecated[1] in favor
of the new NodePortMap, ControlPlaneVipData and VipPortMap. This change
ensures the deployment command use the new parameters.

Note that the old parameter is still kept until the environment file
is updated to use the new deployed-ports.yaml template.

[1] 26be3179905c7751812aa10a0af9f56e58e7ef08

Change-Id: Ifd7bfe266be39b4a3643e5fcf1fd506d777448db
This commit is contained in:
Takashi Kajinami 2022-10-30 00:26:45 +09:00
parent 70bbc79cb1
commit 055133078d

View File

@ -316,6 +316,11 @@ class Deploy(command.Command):
}
return data
def _ip_for_uri(self, ip_addr, ip_nw):
if ip_nw.version == 6:
return '[%s]' % ip_addr
return ip_addr
def _generate_portmap_parameters(self, ip_addr, ip_nw, ctlplane_vip_addr,
public_vip_addr, stack_name='Undercloud',
role_name='Undercloud'):
@ -357,6 +362,34 @@ class Deploy(command.Command):
'ip_version': ip_nw.version}],
'network': {'tags': [str(ip_nw.cidr)]}
}
},
'NodePortMap': {
hostname: {
'ctlplane': {
'ip_address': ip_addr,
'ip_address_uri': self._ip_for_uri(ip_addr, ip_nw),
'ip_subnet': '%s/%s' % (ip_addr, ip_nw.prefixlen)
}
}
},
'ControlPlaneVipData': {
'fixed_ips': [
{'ip_address': ctlplane_vip_addr}
],
'name': 'control_virtual_ip',
'network': {
'tags': ['%s/%s' % (ctlplane_vip_addr, ip_nw.prefixlen)]
},
'subnets': [
{'ip_version': ip_nw.version}
]
},
'VipPortMap': {
'external': {
'ip_address': public_vip_addr,
'ip_address_uri': self._ip_for_uri(public_vip_addr, ip_nw),
'ip_subnet': '%s/%s' % (public_vip_addr, ip_nw.prefixlen)
}
}
}
return data