Add ability to pre-assign IPs by role on ctlplane

This change adds the ability to pre-assign IP addresses
that will be used on the ctlplane network for each node.
The functionality is similar to the existing ips-from-pool
templates, but the IP will be passed to the Nova server
resource rather than a dedicated Neutron port (as happens
with the isolated networks templates). This allows for
compatibility with legacy installations for upgrades.
In testing, it also appears that the fixed IP can be
changed in a stack update, but more testing will have to
be done. Note that if an IP address is defined for
some nodes but not others, nodes without a fixed IP
will get an IP assigned automatically by Neutron.

Change-Id: I67513f54a60f5a50a2bc435099fbb2a643adc277
This commit is contained in:
Dan Sneddon 2018-05-08 15:27:50 -07:00
parent 62a266c6c4
commit 393476fda3
3 changed files with 54 additions and 2 deletions

View File

@ -0,0 +1,26 @@
# Environment file demonstrating how to pre-assign provisioning IPs on the
# boot NIC to all node types. In order to use this file, set
# ctlplane_fixed_ip to True in the role definition, otherwise these
# settings will be ignored.
parameter_defaults:
ControllerIPs:
# Each controller will get an IP from the lists below, first controller, first IP
ctlplane:
- 192.168.24.251
ComputeIPs:
# Each compute will get an IP from the lists below, first compute, first IP
ctlplane:
- 192.168.24.252
CephStorageIPs:
# Each ceph node will get an IP from the lists below, first node, first IP
ctlplane:
- 192.168.24.253
SwiftStorageIPs:
# Each swift node will get an IP from the lists below, first node, first IP
ctlplane:
- 192.168.24.254
BlockStorageIPs:
# Each cinder node will get an IP from the lists below, first node, first IP
ctlplane:
- 192.168.24.250

View File

@ -284,6 +284,15 @@ conditions:
equals:
- {get_param: {{role.name}}NetworkDeploymentActions}
- []
ctlplane_fixed_ip_set:
not:
equals:
{%- if role.deprecated_param_ips %}
- {get_param: [{{role.deprecated_param_ips}}, 'ctlplane', {get_param: NodeIndex}]}
{%- else %}
- {get_param: [{{role.name}}IPs, 'ctlplane', {get_param: NodeIndex}]}
{%- endif %}
- ""
resources:
{{server_resource_name}}:
@ -314,8 +323,17 @@ resources:
{%- endif %}
key_name: {get_param: KeyName}
networks:
- network: ctlplane
subnet: {get_param: {{role.name}}ControlPlaneSubnet}
- if:
- ctlplane_fixed_ip_set
- network: ctlplane
subnet: {get_param: {{role.name}}ControlPlaneSubnet}
{%- if role.deprecated_param_ips %}
fixed_ip: {get_param: [{{role.deprecated_param_ips}}, 'ctlplane', {get_param: NodeIndex}]}
{%- else %}
fixed_ip: {get_param: [{{role.name}}IPs, 'ctlplane', {get_param: NodeIndex}]}
{%- endif %}
- network: ctlplane
subnet: {get_param: {{role.name}}ControlPlaneSubnet}
user_data_format: SOFTWARE_CONFIG
user_data: {get_resource: UserData}
name:

View File

@ -0,0 +1,8 @@
---
features:
- |
Add ability to specify a fixed IP for the provisioning control plane
(ctlplane) network. This works similarly to the existing fixed IPs
for isolated networks, by including an environment file which includes
an IP for each node in each role that should use a fixed IP. An example
environment file is included in environments/ips-from-pool-ctlplane.yaml.