summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntoni Segura Puimedon <celebdor@gmail.com>2017-09-12 10:57:38 +0200
committerTomas Sedovic <tomas@sedovic.cz>2017-09-12 10:57:38 +0200
commit1cf6275b983a108a02b6ef178fe35e610162b963 (patch)
tree6e5bec92c79e89c76a1bcce9f8a7ecd061749705
parentecc87079e16a3f344ac53ac2dbee816e2712cedf (diff)
downloadopenshift-1cf6275b983a108a02b6ef178fe35e610162b963.tar.gz
openshift-1cf6275b983a108a02b6ef178fe35e610162b963.tar.bz2
openshift-1cf6275b983a108a02b6ef178fe35e610162b963.tar.xz
openshift-1cf6275b983a108a02b6ef178fe35e610162b963.zip
openstack: make server ports be trunk ports (#713)
This ensures that the ports that the servers were using before this commit will be parent ports of Neutron trunk ports. Thanks to this, there can be nested Neutron ports inside the OS::NOva::Server resources created either in the heat stack or dynamically inside the Instances. Signed-off-by: Antoni Segura Puimedon <antonisp@celebdor.com>
-rw-r--r--roles/openstack-stack/templates/heat_stack_server.yaml.j212
-rw-r--r--roles/openstack-stack/templates/heat_stack_server_nofloating.yaml.j212
2 files changed, 24 insertions, 0 deletions
diff --git a/roles/openstack-stack/templates/heat_stack_server.yaml.j2 b/roles/openstack-stack/templates/heat_stack_server.yaml.j2
index a520a8fe2..fc797941e 100644
--- a/roles/openstack-stack/templates/heat_stack_server.yaml.j2
+++ b/roles/openstack-stack/templates/heat_stack_server.yaml.j2
@@ -138,7 +138,11 @@ resources:
image: { get_param: image }
flavor: { get_param: flavor }
networks:
+{% if use_trunk_ports|default(false)|bool %}
+ - port: { get_attr: [trunk-port, port_id] }
+{% else %}
- port: { get_resource: port }
+{% endif %}
user_data:
get_file: user-data
user_data_format: RAW
@@ -151,6 +155,14 @@ resources:
sub-host-type: { get_param: subtype }
node_labels: { get_param: node_labels }
+{% if use_trunk_ports|default(false)|bool %}
+ trunk-port:
+ type: OS::Neutron::Trunk
+ properties:
+ name: { get_param: name }
+ port: { get_resource: port }
+{% endif %}
+
port:
type: OS::Neutron::Port
properties:
diff --git a/roles/openstack-stack/templates/heat_stack_server_nofloating.yaml.j2 b/roles/openstack-stack/templates/heat_stack_server_nofloating.yaml.j2
index 638fc8b45..2c16ad778 100644
--- a/roles/openstack-stack/templates/heat_stack_server_nofloating.yaml.j2
+++ b/roles/openstack-stack/templates/heat_stack_server_nofloating.yaml.j2
@@ -115,7 +115,11 @@ resources:
image: { get_param: image }
flavor: { get_param: flavor }
networks:
+{% if use_trunk_ports|default(false)|bool %}
+ - port: { get_attr: [trunk-port, port_id] }
+{% else %}
- port: { get_resource: port }
+{% endif %}
user_data:
get_file: user-data
user_data_format: RAW
@@ -128,6 +132,14 @@ resources:
sub-host-type: { get_param: subtype }
node_labels: { get_param: node_labels }
+{% if use_trunk_ports|default(false)|bool %}
+ trunk-port:
+ type: OS::Neutron::Trunk
+ properties:
+ name: { get_param: name }
+ port: { get_resource: port }
+{% endif %}
+
port:
type: OS::Neutron::Port
properties: