Create types for baremetal networking

This change defines two new template resource types:
- OS::OVB::BaremetalNetworks for any extra networks required by
  baremetal nodes, the default keeps the current behaviour of adding
  no new networks
- OS::OVB::BaremetalPorts for building a list of ports to attach to
  each baremetal server. The default keeps the current behaviour of
  creating a single port on the provision network.

Future changes will have alternatives to the defaults for network
isolation
This commit is contained in:
Steve Baker 2016-03-15 17:37:23 +13:00
parent cff76bbdc3
commit 3c3d1a057e
5 changed files with 46 additions and 10 deletions

View File

@ -0,0 +1,5 @@
heat_template_version: 2014-10-16
outputs:
networks:
value: {}

View File

@ -0,0 +1,29 @@
heat_template_version: 2014-10-16
parameters:
baremetal_prefix:
type: string
provision_net:
type: string
suffix:
type: string
resources:
provision_port:
type: OS::Neutron::Port
properties:
name:
list_join:
- ''
- - {get_param: baremetal_prefix}
- {get_param: suffix}
network: {get_param: provision_net}
outputs:
ports:
value:
- {port: {get_resource: provision_port}}

View File

@ -3,3 +3,5 @@ resource_registry:
OS::OVB::BaremetalEnvironment: virtual-baremetal.yaml
OS::OVB::UndercloudFloating: undercloud-floating.yaml
OS::OVB::PrivateNetwork: private-net-existing.yaml
OS::OVB::BaremetalNetworks: baremetal-networks-none.yaml
OS::OVB::BaremetalPorts: baremetal-ports-default.yaml

View File

@ -22,15 +22,12 @@ parameters:
resources:
baremetal_port:
type: OS::Neutron::Port
baremetal_ports:
type: OS::OVB::BaremetalPorts
properties:
name:
list_join:
- ''
- - {get_param: baremetal_prefix}
- {get_param: suffix}
network: {get_param: provision_net}
suffix: {get_param: suffix}
baremetal_prefix: {get_param: baremetal_prefix}
provision_net: {get_param: provision_net}
baremetal_server:
type: OS::Nova::Server
@ -39,8 +36,7 @@ resources:
image: {get_param: baremetal_image}
config_drive: false
key_name: {get_param: key_name}
networks:
- port: {get_resource: baremetal_port}
networks: {get_attr: [baremetal_ports, ports]}
name:
list_join:
- ''

View File

@ -137,8 +137,12 @@ resources:
$openstackbmc_script: {get_file: ../bin/openstackbmc}
template: {get_file: ../bin/install_openstackbmc.sh}
baremetal_networks:
type: OS::OVB::BaremetalNetworks
openstack_baremetal_servers:
type: OS::Heat::ResourceGroup
depends_on: baremetal_networks
properties:
count: {get_param: node_count}
resource_def: