Skip to content

Commit

Permalink
openstack: make server ports be trunk ports (openshift#713)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
celebdor authored and tomassedovic committed Sep 12, 2017
1 parent ecc8707 commit 1cf6275
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
12 changes: 12 additions & 0 deletions roles/openstack-stack/templates/heat_stack_server.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down

0 comments on commit 1cf6275

Please sign in to comment.