From 393476fda3652637bf6e5344f8815b3bb5398900 Mon Sep 17 00:00:00 2001 From: Dan Sneddon Date: Tue, 8 May 2018 15:27:50 -0700 Subject: [PATCH] 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 --- environments/ips-from-pool-ctlplane.yaml | 26 +++++++++++++++++++ puppet/role.role.j2.yaml | 22 ++++++++++++++-- .../ctlplane_fixed_ip-81d14db5a01fa531.yaml | 8 ++++++ 3 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 environments/ips-from-pool-ctlplane.yaml create mode 100644 releasenotes/notes/ctlplane_fixed_ip-81d14db5a01fa531.yaml diff --git a/environments/ips-from-pool-ctlplane.yaml b/environments/ips-from-pool-ctlplane.yaml new file mode 100644 index 0000000000..db457cc854 --- /dev/null +++ b/environments/ips-from-pool-ctlplane.yaml @@ -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 diff --git a/puppet/role.role.j2.yaml b/puppet/role.role.j2.yaml index 841f56ec95..6a86448e10 100644 --- a/puppet/role.role.j2.yaml +++ b/puppet/role.role.j2.yaml @@ -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: diff --git a/releasenotes/notes/ctlplane_fixed_ip-81d14db5a01fa531.yaml b/releasenotes/notes/ctlplane_fixed_ip-81d14db5a01fa531.yaml new file mode 100644 index 0000000000..dc053024a4 --- /dev/null +++ b/releasenotes/notes/ctlplane_fixed_ip-81d14db5a01fa531.yaml @@ -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.