|
| 1 | +--- |
| 2 | +heat_template_version: pike |
| 3 | + |
| 4 | +description: > |
| 5 | + Heat stack template for a stack containing one Neutron port which is on |
| 6 | + a named network and subnet. A floating IP is created for the port. |
| 7 | + A second port is allocated on another network with SR-IOV port binding. |
| 8 | + A third port is allocated on another network with SR-IOV port binding. |
| 9 | +
|
| 10 | +parameters: |
| 11 | + node_idx: |
| 12 | + type: number |
| 13 | + label: Node index within cluster group |
| 14 | + cluster_net: |
| 15 | + type: json |
| 16 | + label: Network names and subnets to which the nodes should be attached |
| 17 | + cluster_fips: |
| 18 | + type: json |
| 19 | + label: List of UUIDs of prealloacted floating IPs |
| 20 | + default: [] |
| 21 | + router_networks: |
| 22 | + type: json |
| 23 | + label: Permit host to route IP traffic from specific networks through this port |
| 24 | + default: [] |
| 25 | + |
| 26 | +conditions: |
| 27 | + security_groups_set: |
| 28 | + yaql: |
| 29 | + expression: $.data.cluster_net.containsKey('security_groups') |
| 30 | + data: |
| 31 | + cluster_net: { get_param: [ cluster_net, 0 ] } |
| 32 | + |
| 33 | +resources: |
| 34 | + |
| 35 | + port1: |
| 36 | + type: OS::Neutron::Port |
| 37 | + properties: |
| 38 | + network: { get_param: [ cluster_net, 0, net ] } |
| 39 | + security_groups: |
| 40 | + if: |
| 41 | + - security_groups_set |
| 42 | + - { get_param: [ cluster_net, 0, security_groups ] } |
| 43 | + - [] |
| 44 | + fixed_ips: |
| 45 | + - subnet_id: { get_param: [ cluster_net, 0, subnet ] } |
| 46 | + |
| 47 | + # The SR-IOV port. |
| 48 | + # It might be presumptious to assume there are no security groups here. |
| 49 | + port2: |
| 50 | + type: OS::Neutron::Port |
| 51 | + properties: |
| 52 | + admin_state_up: True |
| 53 | + network: { get_param: [ cluster_net, 1, net ] } |
| 54 | + binding:vnic_type: direct |
| 55 | + security_groups: [] |
| 56 | + fixed_ips: |
| 57 | + - subnet_id: { get_param: [ cluster_net, 1, subnet ] } |
| 58 | + |
| 59 | + # The OTHER SR-IOV port. |
| 60 | + # It might be presumptious to assume there are no security groups here. |
| 61 | + port3: |
| 62 | + type: OS::Neutron::Port |
| 63 | + properties: |
| 64 | + admin_state_up: True |
| 65 | + network: { get_param: [ cluster_net, 2, net ] } |
| 66 | + binding:vnic_type: direct |
| 67 | + security_groups: [] |
| 68 | + fixed_ips: |
| 69 | + - subnet_id: { get_param: [ cluster_net, 2, subnet ] } |
| 70 | + |
| 71 | + floating_ip: |
| 72 | + type: OS::Neutron::FloatingIP |
| 73 | + properties: |
| 74 | + floating_network: { get_param: [ cluster_net, 0, floating_net ] } |
| 75 | + |
| 76 | + floating_ip_association: |
| 77 | + type: OS::Neutron::FloatingIPAssociation |
| 78 | + properties: |
| 79 | + floatingip_id: { get_resource: floating_ip } |
| 80 | + port_id: { get_resource: port1 } |
| 81 | + |
| 82 | +outputs: |
| 83 | + OS::stack_id: |
| 84 | + description: The network list |
| 85 | + value: |
| 86 | + - port1: { get_resource: port1 } |
| 87 | + - port2: { get_resource: port2 } |
| 88 | + - port3: { get_resource: port3 } |
| 89 | + |
| 90 | + networks: |
| 91 | + description: The network list |
| 92 | + value: |
| 93 | + - port: { get_resource: port1 } |
| 94 | + - port: { get_resource: port2 } |
| 95 | + - port: { get_resource: port3 } |
| 96 | + |
| 97 | + node_ips: |
| 98 | + description: List of list of IPs assigned on the named cluster networks |
| 99 | + value: |
| 100 | + - - { get_attr: [ floating_ip, floating_ip_address ] } |
| 101 | + - { get_attr: [ port1, fixed_ips, 0, ip_address ] } |
| 102 | + - - { get_attr: [ port2, fixed_ips, 0, ip_address ] } |
| 103 | + - - { get_attr: [ port3, fixed_ips, 0, ip_address ] } |
| 104 | + |
| 105 | + primary_ip: |
| 106 | + description: The primary IP of the instance |
| 107 | + value: { get_attr: [ floating_ip, floating_ip_address ] } |
0 commit comments