From 6b3d7f1aaa7e85b2a1ba8d74f86aa6c5eca04963 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Harald=20Jens=C3=A5s?= Date: Sat, 28 Mar 2020 00:06:58 +0100 Subject: [PATCH] Add prefix --id support for the radvd and dhcrelay Add prefix support for radvd and dhcrelay instances. Also adds missing parameters for these instances in the sample env generator environment. Change-Id: I86bd6b014b62c3a382458f68443cfb02ed2e7031 --- environments/ipv6-radvd-configuration.yaml | 14 +++++++++++++ .../routed-networks-configuration.yaml | 21 +++++++++++++++++++ openstack_virtual_baremetal/deploy.py | 12 ++++------- sample-env-generator/environments.yaml | 8 +++++++ templates/dhcp-relay.yaml | 7 ++++++- templates/ipv6-radvd.yaml | 7 ++++++- 6 files changed, 59 insertions(+), 10 deletions(-) diff --git a/environments/ipv6-radvd-configuration.yaml b/environments/ipv6-radvd-configuration.yaml index 26e5db1..8bf9593 100644 --- a/environments/ipv6-radvd-configuration.yaml +++ b/environments/ipv6-radvd-configuration.yaml @@ -9,6 +9,12 @@ # Contains the available parameters that need to be configured when using # a IPv6 network. Requires the ipv6-radvd.yaml environment. parameter_defaults: + # Controls radvd parameters AdvManagedFlag and AdvAutonomous. For stateful + # addressing these should be AdvManagedFlag: on, AdvAutonomous: off, for + # statelss (SLAAC) these should be AdvManagedFlag: off, AdvAutonomous: on. + # Type: boolean + IPv6_dhcpv6-statefull: False + # The Nova flavor to use for the radvd instance # Type: string radvd_flavor: m1.small @@ -18,3 +24,11 @@ parameter_defaults: # Type: string radvd_image: CentOS-7-x86_64-GenericCloud + # Prefix for the name of the radvd instance + # Type: string + radvd_prefix: radvd + + # radvd address on the provision network subnet + # Type: string + radvd_provision_address: fd12:3456:789a:1::fffe + diff --git a/environments/routed-networks-configuration.yaml b/environments/routed-networks-configuration.yaml index 2171885..3e31ef1 100644 --- a/environments/routed-networks-configuration.yaml +++ b/environments/routed-networks-configuration.yaml @@ -10,6 +10,11 @@ # a routed networks environment. Requires the routed-networks.yaml # environment. parameter_defaults: + # The IP addresses of DHCP servers to relay DHCP requests to. + # Mandatory. This parameter must be set by the user. + # Type: json + dhcp_ips: + # The Nova flavor to use for the dhcrelay instance # Type: string dhcp_relay_flavor: m1.small @@ -19,3 +24,19 @@ parameter_defaults: # Type: string dhcp_relay_image: CentOS-7-x86_64-GenericCloud + # DHCP relay address on the provision2 network subnet + # Type: string + dhcp_relay_provision2_address: 192.168.25.253 + + # DHCP relay address on the provision3 network subnet + # Type: string + dhcp_relay_provision3_address: 192.168.26.253 + + # DHCP relay address on the provision network subnet + # Type: string + dhcp_relay_provision_address: 192.168.24.253 + + # Prefix for the name of the dhcrelay instance + # Type: string + dhcrelay_prefix: dhcrelay + diff --git a/openstack_virtual_baremetal/deploy.py b/openstack_virtual_baremetal/deploy.py index c5da02f..c1ec5ab 100755 --- a/openstack_virtual_baremetal/deploy.py +++ b/openstack_virtual_baremetal/deploy.py @@ -139,18 +139,14 @@ def _generate_id_env(args): _add_identifier(env_data, 'provision_net2', args.id, default='provision2') _add_identifier(env_data, 'provision_net3', args.id, default='provision3') _add_identifier(env_data, 'public_net', args.id, default='public') - _add_identifier(env_data, - 'baremetal_prefix', - args.id, - default='baremetal') + _add_identifier(env_data, 'baremetal_prefix', args.id, default='baremetal') role = env_data['parameter_defaults'].get('role') if role: _add_identifier(env_data, 'baremetal_prefix', role) _add_identifier(env_data, 'bmc_prefix', args.id, default='bmc') - _add_identifier(env_data, - 'undercloud_name', - args.id, - default='undercloud') + _add_identifier(env_data, 'undercloud_name', args.id, default='undercloud') + _add_identifier(env_data, 'dhcrelay_prefix', args.id, default='dhcrelay') + _add_identifier(env_data, 'radvd_prefix', args.id, default='radvd') _add_identifier(env_data, 'overcloud_internal_net', args.id, default='internal') _add_identifier(env_data, 'overcloud_storage_net', args.id, diff --git a/sample-env-generator/environments.yaml b/sample-env-generator/environments.yaml index 66ebfa9..633862a 100644 --- a/sample-env-generator/environments.yaml +++ b/sample-env-generator/environments.yaml @@ -202,6 +202,11 @@ environments: parameters: - dhcp_relay_flavor - dhcp_relay_image + - dhcrelay_prefix + - dhcp_relay_provision_address + - dhcp_relay_provision2_address + - dhcp_relay_provision3_address + - dhcp_ips - name: routed-networks title: Enable Routed Networks @@ -274,6 +279,9 @@ environments: parameters: - radvd_flavor - radvd_image + - radvd_prefix + - radvd_provision_address + - IPv6_dhcpv6-statefull - name: ipv6-radvd title: Enable router advertisement daemon (radvd) diff --git a/templates/dhcp-relay.yaml b/templates/dhcp-relay.yaml index f4e5acc..0e767a2 100644 --- a/templates/dhcp-relay.yaml +++ b/templates/dhcp-relay.yaml @@ -19,6 +19,11 @@ parameters: The base image for the dhcrelay instance. A CentOS 7 image is currently the only one supported. + dhcrelay_prefix: + type: string + default: dhcrelay + description: Prefix for the name of the dhcrelay instance + dhcp_relay_provision_address: type: string description: DHCP relay address on the provision network subnet @@ -175,7 +180,7 @@ resources: dhcp_relay_server: type: OS::Nova::Server properties: - name: dhcrelay + name: {get_param: dhcrelay_prefix} flavor: {get_param: dhcp_relay_flavor} image: {get_param: dhcp_relay_image} key_name: {get_param: key_name} diff --git a/templates/ipv6-radvd.yaml b/templates/ipv6-radvd.yaml index 9befd47..c4812af 100644 --- a/templates/ipv6-radvd.yaml +++ b/templates/ipv6-radvd.yaml @@ -19,6 +19,11 @@ parameters: The base image for the radvd instance. A CentOS 7 image is currently the only one supported. + radvd_prefix: + type: string + default: radvd + description: Prefix for the name of the radvd instance + radvd_provision_address: type: string description: radvd address on the provision network subnet @@ -198,7 +203,7 @@ resources: radvb_server: type: OS::Nova::Server properties: - name: radvd + name: {get_param: radvd_prefix} flavor: {get_param: radvd_flavor} image: {get_param: radvd_image} key_name: {get_param: key_name}