Add subnet property to ctlplane network for server resources

The subnet property is added to puppet/role.role.j2.yaml as
`{{role}}ControlPlaneSubnet`. Roles with a different subnet specified
can be used to deploy a routed network architecture by using one
role per routed network.

When enabling the neutron segments plug-in to support routed-networks
the neutron IPAM code will defer ipallocation unless the port create
request contain enough details. (Ref: LP Bug: #1695740) By adding the
subnet to port create request this change enables tripleo deployment
on an undercloud with Neutron segments plug-in and routed networks.

This depends on a Heat change that improves network logic in server
resource to not replace the current port if new props match what is
on the current interface. Without this adding the subnet property on
update/upgrades would cause a port replacement, which in turn would
cause IPAM info in undercloud neutron to miss-match the deployed
overcloud nodes.

Depends-On: Iab75ec49b962617943017dcaf1b04b89f91a982e
Change-Id: I33804bfd105a13c25d6057e8414e09957939e8af
Implements: blueprint tripleo-routed-networks-deployment
This commit is contained in:
Harald Jensas 2017-06-13 14:34:17 +02:00 committed by Harald Jensås
parent c04b3ed5eb
commit 77c82f6645
11 changed files with 122 additions and 5 deletions

View File

@ -9,6 +9,10 @@ parameters:
replacement_policy:
type: string
default: AUTO
ControlPlaneSubnet:
default: ctlplane-subnet
description: The name of the undercloud Neutron control plane subnet
type: string
resources:
@ -16,6 +20,7 @@ resources:
type: OS::Neutron::Port
properties:
network: ctlplane
fixed_ips: [{subnet: {get_param: ControlPlaneSubnet}}]
name:
list_join:
- '-'

View File

@ -48,6 +48,10 @@ parameters:
deployment_swift_data:
type: json
default: {}
ControlPlaneSubnet:
default: ctlplane-subnet
description: The name of the undercloud Neutron control plane subnet
type: string
resources:
deployed-server:
@ -122,6 +126,7 @@ resources:
type: OS::TripleO::DeployedServer::ControlPlanePort
properties:
network: ctlplane
fixed_ips: [{subnet: {get_param: ControlPlaneSubnet}}]
name:
list_join:
- '-'

View File

@ -25,6 +25,10 @@ parameters:
description: The name of the undercloud Neutron control plane
default: ctlplane
type: string
ControlPlaneSubnet:
description: The name of the undercloud Neutron control plane subnet
default: ctlplane-subnet
type: string
FixedIPs:
description: >
Control the IP allocation for the VIP port. E.g.
@ -32,13 +36,23 @@ parameters:
default: []
type: json
conditions:
fixed_ip_not_set:
equals:
- get_param: FixedIPs
- []
resources:
VipPort:
type: OS::TripleO::Network::Ports::ControlPlaneVipPort
properties:
network: {get_param: ControlPlaneNetwork}
name: {get_param: PortName}
fixed_ips: {get_param: FixedIPs}
fixed_ips:
if:
- fixed_ip_not_set
- [{subnet: {get_param: ControlPlaneSubnet}}]
- get_param: FixedIPs
replacement_policy: AUTO
outputs:

View File

@ -24,6 +24,10 @@ parameters:
description: The name of the undercloud Neutron control plane
default: ctlplane
type: string
ControlPlaneSubnet: # Here for compatibility with ctlplane_vip.yaml
description: The name of the undercloud Neutron control plane subnet
default: ctlplane-subnet
type: string
FixedIPs: # Here for compatibility with ctlplane_vip.yaml
description: >
Control the IP allocation for the VIP port. E.g.

View File

@ -15,6 +15,10 @@ parameters:
description: The name of the undercloud Neutron control plane
default: ctlplane
type: string
ControlPlaneSubnet:
description: The name of the undercloud Neutron control plane subnet
default: ctlplane-subnet
type: string
PortName:
description: Name of the port
default: ''

View File

@ -21,6 +21,10 @@ parameters:
description: The name of the undercloud Neutron control plane
default: ctlplane
type: string
ControlPlaneSubnet: # Here for compatibility with ctlplane_vip.yaml
description: The name of the undercloud Neutron control plane subnet
default: ctlplane-subnet
type: string
FixedIPs:
description: >
Control the IP allocation for the VIP port. E.g.
@ -34,6 +38,20 @@ parameters:
default: 0
type: number
conditions:
network_is_ctlplane:
equals:
- get_param: {{network.name}}NetName
- ctlplane
fixed_ip_not_set:
equals:
- get_param: FixedIPs
- []
net_is_ctlplane_and_fixed_ip_not_set:
and:
- network_is_ctlplane
- fixed_ip_not_set
resources:
{{network.name}}Port:
@ -41,7 +59,11 @@ resources:
properties:
network: {get_param: {{network.name}}NetName}
name: {get_param: PortName}
fixed_ips: {get_param: FixedIPs}
fixed_ips:
if:
- net_is_ctlplane_and_fixed_ip_not_set
- [{subnet: {get_param: ControlPlaneSubnet}}]
- get_param: FixedIPs
replacement_policy: AUTO
outputs:

View File

@ -26,6 +26,10 @@ parameters:
description: The name of the undercloud Neutron control plane
default: ctlplane
type: string
ControlPlaneSubnet: # Here for compatibility with ctlplane_vip.yaml
description: The name of the undercloud Neutron control plane subnet
default: ctlplane-subnet
type: string
IPPool: # Set in <Role>IPs map, see environments/ips-from-pool-all.yaml
default: {}
type: json

View File

@ -25,6 +25,10 @@ parameters:
description: The name of the undercloud Neutron control plane
default: ctlplane
type: string
ControlPlaneSubnet:
description: The name of the undercloud Neutron control plane subnet
default: ctlplane-subnet
type: string
FixedIPs:
description: >
Control the IP allocation for the VIP port. E.g.
@ -32,13 +36,31 @@ parameters:
default: []
type: json
conditions:
network_is_ctlplane:
equals:
- get_param: NetworkName
- ctlplane
fixed_ip_not_set:
equals:
- get_param: FixedIPs
- []
net_is_ctlplane_and_fixed_ip_not_set:
and:
- network_is_ctlplane
- fixed_ip_not_set
resources:
VipPort:
type: OS::Neutron::Port
properties:
network: {get_param: NetworkName}
name: {get_param: PortName}
fixed_ips: {get_param: FixedIPs}
fixed_ips:
if:
- net_is_ctlplane_and_fixed_ip_not_set
- [{subnet: {get_param: ControlPlaneSubnet}}]
- get_param: FixedIPs
replacement_policy: AUTO
outputs:

View File

@ -25,6 +25,10 @@ parameters:
description: The name of the undercloud Neutron control plane
default: ctlplane
type: string
ControlPlaneSubnet:
description: The name of the undercloud Neutron control plane subnet
default: ctlplane-subnet
type: string
FixedIPs:
description: >
Control the IP allocation for the VIP port. E.g.
@ -32,13 +36,31 @@ parameters:
default: []
type: json
conditions:
network_is_ctlplane:
equals:
- get_param: NetworkName
- ctlplane
fixed_ip_not_set:
equals:
- get_param: FixedIPs
- []
net_is_ctlplane_and_fixed_ip_not_set:
and:
- network_is_ctlplane
- fixed_ip_not_set
resources:
VipPort:
type: OS::Neutron::Port
properties:
network: {get_param: NetworkName}
name: {get_param: PortName}
fixed_ips: {get_param: FixedIPs}
fixed_ips:
if:
- net_is_ctlplane_and_fixed_ip_not_set
- [{subnet: {get_param: ControlPlaneSubnet}}]
- get_param: FixedIPs
replacement_policy: AUTO
outputs:

View File

@ -94,6 +94,10 @@ parameters:
default: nic1
description: Which interface to add to the NeutronPhysicalBridge.
type: string
ControlPlaneSubnet:
description: The name of the undercloud Neutron control plane subnet
default: ctlplane-subnet
type: string
ControlFixedIPs:
default: []
description: >
@ -255,6 +259,7 @@ parameter_groups:
conditions:
add_vips_to_etc_hosts: {equals : [{get_param: AddVipsToEtcHosts}, True]}
control_fixed_ip_not_set: {equals : [{get_param: ControlFixedIPs}, []]}
resources:
@ -749,7 +754,11 @@ resources:
properties:
name: control_virtual_ip
network: {get_param: NeutronControlPlaneID}
fixed_ips: {get_param: ControlFixedIPs}
fixed_ips:
if:
- control_fixed_ip_not_set
- [{subnet: {get_param: ControlPlaneSubnet}}]
- get_param: ControlFixedIPs
replacement_policy: AUTO
RedisVirtualIP:

View File

@ -231,6 +231,11 @@ parameters:
container: overcloud-compute
object: 0
default: {}
{{role.name}}ControlPlaneSubnet:
default: ctlplane-subnet
description: |
Name of the subnet on ctlplane network for this role.
type: string
{% if role.uses_deprecated_params is defined %}
parameter_groups:
@ -310,6 +315,7 @@ resources:
key_name: {get_param: KeyName}
networks:
- network: ctlplane
subnet: {get_param: {{role.name}}ControlPlaneSubnet}
user_data_format: SOFTWARE_CONFIG
user_data: {get_resource: UserData}
name: