aboutsummaryrefslogtreecommitdiffstats
path: root/network/ports
diff options
context:
space:
mode:
authorDan Prince <dprince@redhat.com>2015-04-27 11:00:52 -0400
committerDan Prince <dprince@redhat.com>2015-05-26 08:50:44 -0400
commitc527d88e9d0ab11b2490713623b2f84f64d71a12 (patch)
treec55cf7e08ebd1b534bfe70484b6cbfac18548650 /network/ports
parent5c8576f4556a2ffdd2d8582d77daaa56d7138c72 (diff)
Add a ports (ip address) abstraction layer
This patch adds a set of templates to create ports on isolated networks via Heat. There are 5 port templates in total which are split out according to the available overcloud networks. Change-Id: I5175ef48c1960ea0d13fc8518328db53921c70cd
Diffstat (limited to 'network/ports')
-rw-r--r--network/ports/external.yaml36
-rw-r--r--network/ports/internal_api.yaml36
-rw-r--r--network/ports/noop.yaml26
-rw-r--r--network/ports/storage.yaml37
-rw-r--r--network/ports/storage_mgmt.yaml36
-rw-r--r--network/ports/tenant.yaml36
6 files changed, 207 insertions, 0 deletions
diff --git a/network/ports/external.yaml b/network/ports/external.yaml
new file mode 100644
index 00000000..db86b329
--- /dev/null
+++ b/network/ports/external.yaml
@@ -0,0 +1,36 @@
+heat_template_version: 2015-04-30
+
+description: >
+ Creates a port on the external network.
+
+parameters:
+ ExternalNetName:
+ description: Name of the external neutron network
+ default: external
+ type: string
+ ControlPlaneIP: # Here for compatability with noop.yaml
+ description: IP address on the control plane
+ type: string
+
+resources:
+
+ ExternalPort:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: ExternalNetName}
+ replacement_policy: AUTO
+
+outputs:
+ ip_address:
+ description: external network IP
+ value: {get_attr: [ExternalPort, fixed_ips, 0, ip_address]}
+ ip_subnet:
+ # FIXME: this assumes a 2 digit subnet CIDR (need more heat functions?)
+ description: IP/Subnet CIDR for the external network IP
+ value:
+ list_join:
+ - ''
+ - - {get_attr: [ExternalPort, fixed_ips, 0, ip_address]}
+ - '/'
+ - {get_attr: [ExternalPort, subnets, 0, cidr, -2]}
+ - {get_attr: [ExternalPort, subnets, 0, cidr, -1]}
diff --git a/network/ports/internal_api.yaml b/network/ports/internal_api.yaml
new file mode 100644
index 00000000..59c0e0ad
--- /dev/null
+++ b/network/ports/internal_api.yaml
@@ -0,0 +1,36 @@
+heat_template_version: 2015-04-30
+
+description: >
+ Creates a port on the internal_api network.
+
+parameters:
+ InternalApiNetName:
+ description: Name of the internal API neutron network
+ default: internal_api
+ type: string
+ ControlPlaneIP: # Here for compatability with noop.yaml
+ description: IP address on the control plane
+ type: string
+
+resources:
+
+ InternalApiPort:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: InternalApiNetName}
+ replacement_policy: AUTO
+
+outputs:
+ ip_address:
+ description: internal API network IP
+ value: {get_attr: [InternalApiPort, fixed_ips, 0, ip_address]}
+ ip_subnet:
+ # FIXME: this assumes a 2 digit subnet CIDR (need more heat functions?)
+ description: IP/Subnet CIDR for the internal API network IP
+ value:
+ list_join:
+ - ''
+ - - {get_attr: [InternalApiPort, fixed_ips, 0, ip_address]}
+ - '/'
+ - {get_attr: [InternalApiPort, subnets, 0, cidr, -2]}
+ - {get_attr: [InternalApiPort, subnets, 0, cidr, -1]}
diff --git a/network/ports/noop.yaml b/network/ports/noop.yaml
new file mode 100644
index 00000000..6bbf23c9
--- /dev/null
+++ b/network/ports/noop.yaml
@@ -0,0 +1,26 @@
+heat_template_version: 2015-04-30
+
+description: >
+ Returns the control plane port (provisioning network) as the ip_address.
+
+parameters:
+ ControlPlaneIP:
+ description: IP address on the control plane
+ type: string
+ ControlPlaneSubnetCidr: # Override this via parameter_defaults
+ default: '24'
+ description: The subnet CIDR of the control plane network.
+ type: string
+
+outputs:
+ ip_address:
+ description: pass thru network IP
+ value: {get_param: ControlPlaneIP}
+ ip_subnet:
+ description: IP/Subnet CIDR for the pass thru network IP
+ value:
+ list_join:
+ - ''
+ - - {get_param: ControlPlaneIP}
+ - '/'
+ - {get_param: ControlPlaneSubnetCidr}
diff --git a/network/ports/storage.yaml b/network/ports/storage.yaml
new file mode 100644
index 00000000..27f60a0d
--- /dev/null
+++ b/network/ports/storage.yaml
@@ -0,0 +1,37 @@
+heat_template_version: 2015-04-30
+
+description: >
+ Creates a port on the storage network.
+
+parameters:
+ StorageNetName:
+ description: Name of the storage neutron network
+ default: storage
+ type: string
+ ControlPlaneIP: # Here for compatability with noop.yaml
+ description: IP address on the control plane
+ type: string
+
+resources:
+
+ StoragePort:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: StorageNetName}
+ replacement_policy: AUTO
+
+outputs:
+ ip_address:
+ description: storage network IP
+ value: {get_attr: [StoragePort, fixed_ips, 0, ip_address]}
+ ip_subnet:
+ # FIXME: this assumes a 2 digit subnet CIDR (need more heat functions?)
+ description: IP/Subnet CIDR for the storage network IP
+ value:
+ list_join:
+ - ''
+ - - {get_attr: [StoragePort, fixed_ips, 0, ip_address]}
+ - '/'
+ - {get_attr: [StoragePort, subnets, 0, cidr, -2]}
+ - {get_attr: [StoragePort, subnets, 0, cidr, -1]}
+
diff --git a/network/ports/storage_mgmt.yaml b/network/ports/storage_mgmt.yaml
new file mode 100644
index 00000000..03cc224e
--- /dev/null
+++ b/network/ports/storage_mgmt.yaml
@@ -0,0 +1,36 @@
+heat_template_version: 2015-04-30
+
+description: >
+ Creates a port on the storage_mgmt API network.
+
+parameters:
+ StorageMgmtNetName:
+ description: Name of the storage_mgmt API neutron network
+ default: storage_mgmt
+ type: string
+ ControlPlaneIP: # Here for compatability with noop.yaml
+ description: IP address on the control plane
+ type: string
+
+resources:
+
+ StorageMgmtPort:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: StorageMgmtNetName}
+ replacement_policy: AUTO
+
+outputs:
+ ip_address:
+ description: storage_mgmt network IP
+ value: {get_attr: [StorageMgmtPort, fixed_ips, 0, ip_address]}
+ ip_subnet:
+ # FIXME: this assumes a 2 digit subnet CIDR (need more heat functions?)
+ description: IP/Subnet CIDR for the storage_mgmt network IP
+ value:
+ list_join:
+ - ''
+ - - {get_attr: [StorageMgmtPort, fixed_ips, 0, ip_address]}
+ - '/'
+ - {get_attr: [StorageMgmtPort, subnets, 0, cidr, -2]}
+ - {get_attr: [StorageMgmtPort, subnets, 0, cidr, -1]}
diff --git a/network/ports/tenant.yaml b/network/ports/tenant.yaml
new file mode 100644
index 00000000..1957c41b
--- /dev/null
+++ b/network/ports/tenant.yaml
@@ -0,0 +1,36 @@
+heat_template_version: 2015-04-30
+
+description: >
+ Creates a port on the tenant network.
+
+parameters:
+ TenantNetName:
+ description: Name of the tenant neutron network
+ default: tenant
+ type: string
+ ControlPlaneIP: # Here for compatability with noop.yaml
+ description: IP address on the control plane
+ type: string
+
+resources:
+
+ TenantPort:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: TenantNetName}
+ replacement_policy: AUTO
+
+outputs:
+ ip_address:
+ description: tenant network IP
+ value: {get_attr: [TenantPort, fixed_ips, 0, ip_address]}
+ ip_subnet:
+ # FIXME: this assumes a 2 digit subnet CIDR (need more heat functions?)
+ description: IP/Subnet CIDR for the tenant network IP
+ value:
+ list_join:
+ - ''
+ - - {get_attr: [TenantPort, fixed_ips, 0, ip_address]}
+ - '/'
+ - {get_attr: [TenantPort, subnets, 0, cidr, -2]}
+ - {get_attr: [TenantPort, subnets, 0, cidr, -1]}