Don't use precreated ports in heat templates

To have ability of creating clusters on deployments
with Ironic we should avoid using precreated ports. Now
to create floating ip we will use Nova floaiting ip
serializations.

Closes-bug: 1557066
Change-Id: I64eef2d645edf12022f686fac14cf04227eedb86
This commit is contained in:
Vitaly Gridnev 2016-03-15 13:31:28 +03:00
parent fc7edcf61d
commit bf09037919

View File

@ -329,22 +329,15 @@ class ClusterStack(object):
if ng.auto_security_group:
resources.update(self._serialize_auto_security_group(ng))
if ng.floating_ip_pool:
resources.update(self._serialize_nova_floating(ng))
if CONF.use_neutron:
port_name = _get_port_name(ng)
resources.update(self._serialize_port(
port_name, self.cluster.neutron_management_network,
self._get_security_groups(ng)))
properties["networks"] = [{
"network": self.cluster.neutron_management_network}]
properties["networks"] = [{"port": {"get_resource": "port"}}]
if ng.floating_ip_pool:
resources.update(self._serialize_neutron_floating(ng))
else:
if ng.floating_ip_pool:
resources.update(self._serialize_nova_floating(ng))
if ng.security_groups or ng.auto_security_group:
properties["security_groups"] = self._get_security_groups(ng)
if ng.security_groups or ng.auto_security_group:
properties["security_groups"] = self._get_security_groups(ng)
# Check if cluster contains user key-pair and include it to template.
if self.cluster.user_keypair_id:
@ -411,33 +404,6 @@ class ClusterStack(object):
}
}
def _serialize_port(self, port_name, fixed_net_id, security_groups):
properties = {
"network_id": fixed_net_id,
"replacement_policy": "AUTO",
"name": port_name
}
if security_groups:
properties["security_groups"] = security_groups
return {
"port": {
"type": "OS::Neutron::Port",
"properties": properties,
}
}
def _serialize_neutron_floating(self, ng):
return {
"floating_ip": {
"type": "OS::Neutron::FloatingIP",
"properties": {
"floating_network_id": ng.floating_ip_pool,
"port_id": {"get_resource": "port"}
}
}
}
def _serialize_nova_floating(self, ng):
return {
"floating_ip": {