routed networks - output network environment data

Prior to routed networks the OVB workloads could use any
IP addressing, since it did not rely on any infrastructure
networking. With routed networks the workloads must use
IP addressing in the subnets in the OVB infrastructure to
enable use of the routers and dhcp_relay.

* Use allocation pool's to control the OVB infrastructure
  use of addresses in IP subnets.
* Add stack output to templates containing iformation
  about the infrastructure provisioned. I.e the addresses
  of routers in the different subnets.

Also make the dhcp_servers to which the dhcp_relay instance
will relay dhcp request to configurable.
This commit is contained in:
Harald Jensås 2018-10-08 15:16:09 +02:00
parent 6c8d9c5da9
commit ece2b44df3
8 changed files with 127 additions and 17 deletions

View File

@ -117,3 +117,5 @@ outputs:
storage_net: {get_resource: storage_network}
storage_mgmt_net: {get_resource: storage_mgmt_network}
tenant_net: {get_resource: tenant_network}
routers_addresses:
value: {}

View File

@ -3,3 +3,5 @@ heat_template_version: 2014-10-16
outputs:
networks:
value: {}
routers_addresses:
value: {}

View File

@ -16,6 +16,11 @@ parameters:
does not need to be changed.
default: 172.17.0.0/24
overcloud_internal_net_allocation_pools:
type: json
description: Allocation pool for third overcloud_internal_net subnet
default: [{"start": "172.17.0.200", "end": "172.17.0.254"}]
overcloud_internal_net2:
type: string
description: Name of internal API network
@ -28,6 +33,11 @@ parameters:
does not need to be changed.
default: 172.17.1.0/24
overcloud_internal_net2_allocation_pools:
type: json
description: Allocation pool for third overcloud_internal_net2 subnet
default: [{"start": "172.17.1.200", "end": "172.17.1.254"}]
overcloud_storage_net:
type: string
description: Name of storage network
@ -40,6 +50,11 @@ parameters:
does not need to be changed.
default: 172.18.0.0/24
overcloud_storage_net_allocation_pools:
type: json
description: Allocation pool for third overcloud_storage_net subnet
default: [{"start": "172.18.0.200", "end": "172.18.0.254"}]
overcloud_storage_net2:
type: string
description: Name of storage network
@ -52,6 +67,11 @@ parameters:
does not need to be changed.
default: 172.18.1.0/24
overcloud_storage_net2_allocation_pools:
type: json
description: Allocation pool for third overcloud_storage_net2 subnet
default: [{"start": "172.18.1.200", "end": "172.18.1.254"}]
overcloud_storage_mgmt_net:
type: string
description: Name of storage management network
@ -64,6 +84,11 @@ parameters:
and does not need to be changed.
default: 172.19.0.0/24
overcloud_storage_mgmt_net_allocation_pools:
type: json
description: Allocation pool for third overcloud_storage_mgmt_net subnet
default: [{"start": "172.19.0.200", "end": "172.19.0.254"}]
overcloud_storage_mgmt_net2:
type: string
description: Name of storage management network
@ -76,6 +101,11 @@ parameters:
and does not need to be changed.
default: 172.19.1.0/24
overcloud_storage_mgmt_net2_allocation_pools:
type: json
description: Allocation pool for third overcloud_storage_mgmt_net2 subnet
default: [{"start": "172.19.1.200", "end": "172.19.1.254"}]
overcloud_tenant_net:
type: string
description: Name of tenant network
@ -88,6 +118,11 @@ parameters:
does not need to be changed.
default: 172.16.0.0/24
overcloud_tenant_net_allocation_pools:
type: json
description: Allocation pool for third overcloud_tenant_net subnet
default: [{"start": "172.16.0.200", "end": "172.16.0.254"}]
overcloud_tenant_net2:
type: string
description: Name of tenant network
@ -100,6 +135,11 @@ parameters:
does not need to be changed.
default: 172.16.1.0/24
overcloud_tenant_net2_allocation_pools:
type: json
description: Allocation pool for third overcloud_tenant_net2 subnet
default: [{"start": "172.16.1.200", "end": "172.16.1.254"}]
resources:
internal_router:
type: OS::Neutron::Router
@ -117,6 +157,7 @@ resources:
network: {get_resource: internal_network}
name: {get_param: overcloud_internal_net}
cidr: {get_param: overcloud_internal_net_cidr}
allocation_pools: {get_param: overcloud_internal_net_allocation_pools}
gateway_ip: null
enable_dhcp: false
@ -143,6 +184,7 @@ resources:
network: {get_resource: internal_network2}
name: {get_param: overcloud_internal_net2}
cidr: {get_param: overcloud_internal_net2_cidr}
allocation_pools: {get_param: overcloud_internal_net2_allocation_pools}
gateway_ip: null
enable_dhcp: false
@ -174,6 +216,7 @@ resources:
network: {get_resource: storage_network}
name: {get_param: overcloud_storage_net}
cidr: {get_param: overcloud_storage_net_cidr}
allocation_pools: {get_param: overcloud_storage_net_allocation_pools}
gateway_ip: null
enable_dhcp: false
@ -200,6 +243,7 @@ resources:
network: {get_resource: storage_network2}
name: {get_param: overcloud_storage_net2}
cidr: {get_param: overcloud_storage_net2_cidr}
allocation_pools: {get_param: overcloud_storage_net2_allocation_pools}
gateway_ip: null
enable_dhcp: false
@ -231,6 +275,7 @@ resources:
network: {get_resource: storage_mgmt_network}
name: {get_param: overcloud_storage_mgmt_net}
cidr: {get_param: overcloud_storage_mgmt_net_cidr}
allocation_pools: {get_param: overcloud_storage_mgmt_net_allocation_pools}
gateway_ip: null
enable_dhcp: false
@ -257,6 +302,7 @@ resources:
network: {get_resource: storage_mgmt_network2}
name: {get_param: overcloud_storage_mgmt_net2}
cidr: {get_param: overcloud_storage_mgmt_net2_cidr}
allocation_pools: {get_param: overcloud_storage_mgmt_net2_allocation_pools}
gateway_ip: null
enable_dhcp: false
@ -288,6 +334,7 @@ resources:
network: {get_resource: tenant_network}
name: {get_param: overcloud_tenant_net}
cidr: {get_param: overcloud_tenant_net_cidr}
allocation_pools: {get_param: overcloud_tenant_net_allocation_pools}
gateway_ip: null
enable_dhcp: false
@ -314,6 +361,7 @@ resources:
network: {get_resource: tenant_network2}
name: {get_param: overcloud_tenant_net2}
cidr: {get_param: overcloud_tenant_net2_cidr}
allocation_pools: {get_param: overcloud_tenant_net2_allocation_pools}
gateway_ip: null
enable_dhcp: false
@ -340,3 +388,13 @@ outputs:
storage_mgmt_net2: {get_resource: storage_mgmt_network2}
tenant_net: {get_resource: tenant_network}
tenant_net2: {get_resource: tenant_network2}
routers_addresses:
value:
internal_router_address: {get_attr: [internal_subnet_port, fixed_ips, 0, ip_address]}
internal2_router: {get_attr: [internal_subnet2_port, fixed_ips, 0, ip_address]}
storage_router_address: {get_attr: [storage_subnet_port, fixed_ips, 0, ip_address]}
storage2_router_address: {get_attr: [storage_subnet2_port, fixed_ips, 0, ip_address]}
storage_mgmt_router_address: {get_attr: [storage_mgmt_subnet_port, fixed_ips, 0, ip_address]}
storage_mgmt2_router_address: {get_attr: [storage_mgmt_subnet2_port, fixed_ips, 0, ip_address]}
tenant_router_address: {get_attr: [tenant_subnet_port, fixed_ips, 0, ip_address]}
tenant2_router_address: {get_attr: [tenant_subnet2_port, fixed_ips, 0, ip_address]}

View File

@ -19,20 +19,13 @@ parameters:
The base image for the dhcrelay instance. A CentOS 7 image is currently
the only one supported.
inspector_dhcp_ip:
type: string
default: 172.20.0.1
dhcp_ips:
type: json
default:
- 192.0.2.50
- 192.0.2.51
description: |
The IP address on the undercloud provisioning network. 'local_ip' in
undercloud.conf
provision_dhcp_ip:
type: string
default: 172.20.0.10
description: |
The IP address on the undercloud provisioning network.
(The first address in the underclouds local_subnet allocation range.
I.e the dhcp_start address)
The IP addresses of DHCP servers to relay DHCP requests to.
networks:
type: json
@ -125,14 +118,16 @@ resources:
[Service]
Type=simple
ExecStart=/usr/sbin/dhcrelay -d --no-pid $provision_dhcp_ip $inspector_dhcp_ip -i eth1 -i eth2 -i eth3
ExecStart=/usr/sbin/dhcrelay -d --no-pid $dhcp_ips -i eth1 -i eth2 -i eth3
StandardError=null
[Install]
WantedBy=multi-user.target
params:
$provision_dhcp_ip: {get_param: provision_dhcp_ip}
$inspector_dhcp_ip: {get_param: inspector_dhcp_ip}
$dhcp_ips:
list_join:
- ' '
- {get_param: dhcp_ips}
- path: /etc/sysctl.d/98-rp-filter.conf
content: |
net.ipv4.conf.eth1.rp_filter = 0

View File

@ -1,4 +1,4 @@
heat_template_version: 2015-04-30
heat_template_version: 2016-04-08
# Template that wraps virtual-baremetal.yaml and does some additional environment
# setup automatically:
@ -188,6 +188,14 @@ resources:
os_user_domain: {get_param: os_user_domain}
os_project_domain: {get_param: os_project_domain}
cloud_data: {get_param: cloud_data}
dhcp_ips:
- {get_attr: [undercloud_networks, undercloud_config_data, undercloud_local_ip]}
- {get_attr: [undercloud_networks, undercloud_config_data, provision_undercloud_dhcp_start]}
network_environment_data:
type: OS::Heat::Value
properties:
value:
outputs:
undercloud_host_floating_ip:
@ -198,3 +206,9 @@ outputs:
description: "ip of the undercloud instance on the private network"
value:
get_attr: [undercloud_env, undercloud_host_private_ip]
network_environment_data:
description: "Network environment data, router addresses etc."
value:
map_merge:
- get_attr: [undercloud_networks, provision_network_routers]
- get_attr: [baremetal_env, baremetal_networks_routers_addresses]

View File

@ -11,6 +11,11 @@ parameters:
description: CIDR for provision network subnet
default: 192.0.2.0/24
provision_net_allocation_pools:
type: json
description: Allocation pool for third provision network subnet
default: [{"start": "192.0.2.200", "end": "192.0.2.254"}]
provision_net_shared:
type: boolean
description: Whether this network should be shared across all tenants
@ -26,6 +31,11 @@ parameters:
description: CIDR for second provision network subnet
default: 192.0.3.0/24
provision_net2_allocation_pools:
type: json
description: Allocation pool for third provision network subnet
default: [{"start": "192.0.3.200", "end": "192.0.3.254"}]
provision_net2_shared:
type: boolean
description: Whether this network should be shared across all tenants
@ -41,6 +51,11 @@ parameters:
description: CIDR for third provision network subnet
default: 192.0.4.0/24
provision_net3_allocation_pools:
type: json
description: Allocation pool for third provision network subnet
default: [{"start": "192.0.4.200", "end": "192.0.4.254"}]
provision_net3_shared:
type: boolean
description: Whether this network should be shared across all tenants
@ -79,6 +94,7 @@ resources:
network: {get_resource: provision_network}
name: {get_param: provision_net}
cidr: {get_param: provision_net_cidr}
allocation_pools: {get_param: provision_net_allocation_pools}
gateway_ip: null
enable_dhcp: false
@ -106,6 +122,7 @@ resources:
network: {get_resource: provision_network2}
name: {get_param: provision_net2}
cidr: {get_param: provision_net2_cidr}
allocation_pools: {get_param: provision_net2_allocation_pools}
gateway_ip: null
enable_dhcp: false
@ -133,6 +150,7 @@ resources:
network: {get_resource: provision_network3}
name: {get_param: provision_net3}
cidr: {get_param: provision_net3_cidr}
allocation_pools: {get_param: provision_net3_allocation_pools}
gateway_ip: null
enable_dhcp: false
@ -170,3 +188,8 @@ outputs:
provision2: {get_resource: provision_network2}
provision3: {get_resource: provision_network3}
public: {get_resource: public_network}
provision_network_routers:
value:
provision_router: {get_attr: [provision_router_port, fixed_ips, 0, ip_address]}
provision2_router: {get_attr: [provision_router_port2, fixed_ips, 0, ip_address]}
provision3_router: {get_attr: [provision_router_port2, fixed_ips, 0, ip_address]}

View File

@ -67,3 +67,6 @@ outputs:
value:
provision: {get_resource: provision_network}
public: {get_resource: public_network}
# The provision_network_routers is here for compatibility only
provision_network_routers:
value: {}

View File

@ -114,6 +114,14 @@ parameters:
default: '{}'
hidden: true
dhcp_ips:
type: json
default:
- 192.0.2.1
- 192.0.2.10
description: |
The IP addresses of DHCP servers to relay DHCP requests to.
# Ignored parameters for compatibility with QuintupleO env files
undercloud_image:
type: string
@ -207,3 +215,8 @@ resources:
type: OS::OVB::DHCPRelay
properties:
networks: {get_param: networks}
dhcp_ips: {get_param: dhcp_ips}
outputs:
baremetal_networks_routers_addresses:
value: {get_attr: [baremetal_networks, routers_addresses]}