Types to create all networks for network-isolation

The created public_net isn't used for anything at the moment
so I've assumed that it maps to the overcloud external network.
This commit is contained in:
Steve Baker 2016-03-24 14:01:42 +13:00
parent 3c3d1a057e
commit 3233c1cbb3
7 changed files with 257 additions and 5 deletions

View File

@ -0,0 +1,111 @@
heat_template_version: 2014-10-16
# Template which creates all networks required for full network isloation.
parameters:
overcloud_internal_net:
type: string
description: Name of internal API network
default: overcloud_internal_net
overcloud_internal_net_cidr:
type: string
description: CIDR for internal API network subnet
default: 172.17.0.0/24
overcloud_storage_net:
type: string
description: Name of storage network
default: overcloud_storage_net
overcloud_storage_net_cidr:
type: string
description: CIDR for storage network subnet
default: 172.18.0.0/24
overcloud_storage_mgmt_net:
type: string
description: Name of storage management network
default: overcloud_storage_mgmt_net
overcloud_storage_mgmt_net_cidr:
type: string
description: CIDR for storage management network subnet
default: 172.19.0.0/24
overcloud_tenant_net:
type: string
description: Name of tenant network
default: overcloud_tenant_net
overcloud_tenant_net_cidr:
type: string
description: CIDR for tenant network subnet
default: 172.16.0.0/24
resources:
internal_network:
type: OS::Neutron::Net
properties:
name: {get_param: overcloud_internal_net}
internal_subnet:
type: OS::Neutron::Subnet
properties:
network: {get_resource: internal_network}
name: {get_param: overcloud_internal_net}
cidr: {get_param: overcloud_internal_net_cidr}
gateway_ip: null
enable_dhcp: false
storage_network:
type: OS::Neutron::Net
properties:
name: {get_param: overcloud_storage_net}
storage_subnet:
type: OS::Neutron::Subnet
properties:
network: {get_resource: storage_network}
name: {get_param: overcloud_storage_net}
cidr: {get_param: overcloud_storage_net_cidr}
gateway_ip: null
enable_dhcp: false
storage_mgmt_network:
type: OS::Neutron::Net
properties:
name: {get_param: overcloud_storage_mgmt_net}
storage_mgmt_subnet:
type: OS::Neutron::Subnet
properties:
network: {get_resource: storage_mgmt_network}
name: {get_param: overcloud_storage_mgmt_net}
cidr: {get_param: overcloud_storage_mgmt_net_cidr}
gateway_ip: null
enable_dhcp: false
tenant_network:
type: OS::Neutron::Net
properties:
name: {get_param: overcloud_tenant_net}
tenant_subnet:
type: OS::Neutron::Subnet
properties:
network: {get_resource: tenant_network}
name: {get_param: overcloud_tenant_net}
cidr: {get_param: overcloud_tenant_net_cidr}
gateway_ip: null
enable_dhcp: false
outputs:
networks:
value:
internal_net: {get_resource: internal_network}
storage_net: {get_resource: storage_network}
storage_mgmt_net: {get_resource: storage_mgmt_network}
tenant_net: {get_resource: tenant_network}

View File

@ -0,0 +1,114 @@
heat_template_version: 2014-10-16
parameters:
baremetal_prefix:
type: string
provision_net:
type: string
public_net:
type: string
description: Name of external network
default: public
suffix:
type: string
overcloud_internal_net:
type: string
description: Name of internal API network
default: overcloud_internal_net
overcloud_storage_net:
type: string
description: Name of storage network
default: overcloud_storage_net
overcloud_storage_mgmt_net:
type: string
description: Name of storage management network
default: overcloud_storage_mgmt_net
overcloud_tenant_net:
type: string
description: Name of tenant network
default: overcloud_tenant_net
resources:
provision_port:
type: OS::Neutron::Port
properties:
name:
list_join:
- ''
- - {get_param: baremetal_prefix}
- {get_param: suffix}
network: {get_param: provision_net}
internal_port:
type: OS::Neutron::Port
properties:
name:
list_join:
- ''
- - internal_
- {get_param: baremetal_prefix}
- {get_param: suffix}
network: {get_param: overcloud_internal_net}
storage_port:
type: OS::Neutron::Port
properties:
name:
list_join:
- ''
- - storage_
- {get_param: baremetal_prefix}
- {get_param: suffix}
network: {get_param: overcloud_storage_net}
storage_mgmt_port:
type: OS::Neutron::Port
properties:
name:
list_join:
- ''
- - storage_mgmt_
- {get_param: baremetal_prefix}
- {get_param: suffix}
network: {get_param: overcloud_storage_mgmt_net}
tenant_port:
type: OS::Neutron::Port
properties:
name:
list_join:
- ''
- - tenant_
- {get_param: baremetal_prefix}
- {get_param: suffix}
network: {get_param: overcloud_tenant_net}
public_port:
type: OS::Neutron::Port
properties:
name:
list_join:
- ''
- - public_
- {get_param: baremetal_prefix}
- {get_param: suffix}
network: {get_param: public_net}
outputs:
ports:
value:
- {port: {get_resource: provision_port}}
- {port: {get_resource: public_port}}
- {port: {get_resource: internal_port}}
- {port: {get_resource: storage_port}}
- {port: {get_resource: storage_mgmt_port}}
- {port: {get_resource: tenant_port}}

View File

@ -8,6 +8,11 @@ parameters:
provision_net: provision_net:
type: string type: string
public_net:
type: string
description: Name of external network
default: public
suffix: suffix:
type: string type: string

View File

@ -34,3 +34,9 @@ parameters:
## Uncomment the following to create a private network ## Uncomment the following to create a private network
# OS::OVB::PrivateNetwork: templates/private-net-create.yaml # OS::OVB::PrivateNetwork: templates/private-net-create.yaml
## Uncomment to create all networks required for network-isolation.
## parameter_defaults should be used to override default parameter values
## in baremetal-networks-all.yaml
# OS::OVB::BaremetalNetworks: templates/baremetal-networks-all.yaml
# OS::OVB::BaremetalPorts: templates/baremetal-ports-all.yaml

View File

@ -45,10 +45,21 @@ parameters:
type: string type: string
default: provision default: provision
provision_net_cidr:
type: string
description: CIDR for provision network subnet
default: 192.0.2.0/24
public_net: public_net:
type: string type: string
description: Name of the overcloud external network
default: public default: public
public_net_cidr:
type: string
description: CIDR for external network subnet
default: 10.0.0.0/24
bmc_prefix: bmc_prefix:
type: string type: string
default: bmc default: bmc
@ -104,7 +115,7 @@ resources:
properties: properties:
network: {get_resource: provision_network} network: {get_resource: provision_network}
name: provision-subnet name: provision-subnet
cidr: 192.0.2.0/24 cidr: {get_param: provision_net_cidr}
gateway_ip: null gateway_ip: null
enable_dhcp: false enable_dhcp: false
@ -117,8 +128,8 @@ resources:
type: OS::Neutron::Subnet type: OS::Neutron::Subnet
properties: properties:
network: {get_resource: public_network} network: {get_resource: public_network}
name: public-subnet name: {get_param: public_net}
cidr: 10.0.0.0/24 cidr: {get_param: public_net_cidr}
gateway_ip: null gateway_ip: null
enable_dhcp: false enable_dhcp: false
@ -151,7 +162,7 @@ resources:
undercloud_server: undercloud_server:
type: OS::Nova::Server type: OS::Nova::Server
depends_on: provision_subnet depends_on: [provision_subnet, public_subnet]
properties: properties:
flavor: {get_param: undercloud_flavor} flavor: {get_param: undercloud_flavor}
image: {get_param: undercloud_image} image: {get_param: undercloud_image}
@ -182,7 +193,7 @@ resources:
baremetal_env: baremetal_env:
type: OS::OVB::BaremetalEnvironment type: OS::OVB::BaremetalEnvironment
depends_on: provision_subnet depends_on: [provision_subnet, public_subnet]
properties: properties:
baremetal_flavor: {get_param: baremetal_flavor} baremetal_flavor: {get_param: baremetal_flavor}
baremetal_image: {get_param: baremetal_image} baremetal_image: {get_param: baremetal_image}

View File

@ -17,6 +17,9 @@ parameters:
provision_net: provision_net:
type: string type: string
public_net:
type: string
suffix: suffix:
type: string type: string
@ -28,6 +31,7 @@ resources:
suffix: {get_param: suffix} suffix: {get_param: suffix}
baremetal_prefix: {get_param: baremetal_prefix} baremetal_prefix: {get_param: baremetal_prefix}
provision_net: {get_param: provision_net} provision_net: {get_param: provision_net}
public_net: {get_param: public_net}
baremetal_server: baremetal_server:
type: OS::Nova::Server type: OS::Nova::Server

View File

@ -152,5 +152,6 @@ resources:
baremetal_image: {get_param: baremetal_image} baremetal_image: {get_param: baremetal_image}
key_name: {get_param: key_name} key_name: {get_param: key_name}
provision_net: {get_param: provision_net} provision_net: {get_param: provision_net}
public_net: {get_param: public_net}
suffix: _%index% suffix: _%index%
baremetal_prefix: {get_param: baremetal_prefix} baremetal_prefix: {get_param: baremetal_prefix}