Skip to content

Commit 0b619f6

Browse files
authored
Merge pull request #31 from stackhpc/net2-fixes
Net2 fixes
2 parents 7b88103 + e058ef0 commit 0b619f6

File tree

6 files changed

+35
-36
lines changed

6 files changed

+35
-36
lines changed

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,11 @@ Heat stack.
8484
* `net`: Name or UUID of a neutron network to attach the instances to.
8585
* `subnet`: Name or UUID of a neutron subnet to attach the instances to.
8686
* `security_groups`: Optional list of names or UUIDs of security groups to
87-
add the instances' ports to.
87+
add the instances' ports to. Security groups can be present or absent
88+
on each listed network.
8889
* `floating_net`: Optional name or UUID of a neutron network to attach
89-
floating IPs to when the `Cluster::NodeNet1WithFIP` resource is used.
90+
floating IPs to when the `Cluster::NodeNet1WithFIP` or
91+
`Cluster::NodeNet2WithFIP` resources are used.
9092

9193
* `node_resource`: A resource name from the library of custom node resource
9294
names. This resource type is used as a default for groups which do not
@@ -112,6 +114,9 @@ Heat stack.
112114
(taken from a pre-allocated and supplied list) and associated with the port.
113115
* `Cluster::NodeNet2`: Two network interfaces. The first two networks listed
114116
in `cluster_net` are used.
117+
* `Cluster::NodeNet2WithFIP`: Two network interfaces. The first two networks listed
118+
in `cluster_net` are used. A floating IP will be allocated from the first network
119+
and associated with the instance.
115120
* `Cluster::NodeNet2WithFIPSRIOV`: Two network interfaces. The first interface
116121
has a floating IP attached (using the `floating_net` and `security_groups`).
117122
The second interface is configured as an SR-IOV port resource, for

files/environments/nodenet-library.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ resource_registry:
55
Cluster::NodeNet1WithFIP: ../resources/nodenet-w-fip.yaml
66
Cluster::NodeNet1WithPreallocatedFIP: ../resources/nodenet-w-prealloc-fip.yaml
77
Cluster::NodeNet2: ../resources/nodenet-2.yaml
8+
Cluster::NodeNet2WithFIP: ../resources/nodenet-2-w-fip.yaml
89
Cluster::NodeNet3: ../resources/nodenet-3.yaml
910
Cluster::NodeNet2WithFIPSRIOV: ../resources/nodenet-2-w-fip-sriov.yaml
1011
Cluster::NodeNet3WithFIPSRIOV: ../resources/nodenet-3-w-fip-sriov.yaml

files/resources/cluster-group.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ parameters:
4444
- "Cluster::NodeNet1WithFIP"
4545
- "Cluster::NodeNet1WithPreallocatedFIP"
4646
- "Cluster::NodeNet2"
47+
- "Cluster::NodeNet2WithFIP"
48+
- "Cluster::NodeNet2WithFIPSRIOV"
4749
- "Cluster::NodeNet3"
50+
- "Cluster::NodeNet3WithFIPSRIOV"
4851
group_idx:
4952
type: number
5053
label: Cluster group index

files/resources/instance-w-volume.yaml

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -77,35 +77,10 @@ resources:
7777
volume_id: { get_resource: instance_volume }
7878
boot_index: -1
7979
key_name: { get_param: key_name }
80-
# FIXME: I would like to do this but Heat does not parse it:
81-
#networks: { get_param: [ group_node_ports, {get_param: node_idx} ] }
82-
#networks:
83-
# list_concat:
84-
# - []
85-
# - { get_param: [ group_node_ports, {get_param: node_idx} ] }
86-
#networks:
87-
# - { get_param: [ group_node_ports, {get_param: node_idx}, 0 ] }
88-
#networks:
89-
# yaql:
90-
# data:
91-
# group_node_ports: { get_param: group_node_ports }
92-
# node_idx: { get_param: node_idx }
93-
# expression: $.data.group_node_ports[$.data.node_idx]
94-
#
95-
# FIXME: this works but is obviously limited to one port:
96-
#networks:
97-
# - port: { get_param: [ group_node_ports, {get_param: node_idx}, 0, port ] }
9880
networks:
99-
list_concat:
100-
- [port: { get_param: [ group_node_ports, {get_param: node_idx}, 0, port ] }]
101-
- if:
102-
- ports_gt_1
103-
- [port: { get_param: [ group_node_ports, {get_param: node_idx}, 1, port ] }]
104-
- []
105-
- if:
106-
- ports_gt_2
107-
- [port: { get_param: [ group_node_ports, {get_param: node_idx}, 2, port ] }]
108-
- []
81+
yaql:
82+
expression: "$.data != '' and $.data.select({'port' => $.port}) or []"
83+
data: {get_param: [group_node_ports, {get_param: node_idx}]}
10984
availability_zone: { get_param: availability_zone }
11085
config_drive: { get_param: config_drive }
11186

files/resources/nodenet-2-w-fip.yaml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,18 @@ parameters:
2222
default: []
2323

2424
conditions:
25-
security_groups_set:
25+
security_groups_port1:
2626
yaql:
2727
expression: $.data.cluster_net.containsKey('security_groups')
2828
data:
2929
cluster_net: { get_param: [ cluster_net, 0 ] }
3030

31+
security_groups_port2:
32+
yaql:
33+
expression: $.data.cluster_net.containsKey('security_groups')
34+
data:
35+
cluster_net: { get_param: [ cluster_net, 1 ] }
36+
3137
resources:
3238

3339
port1:
@@ -36,7 +42,7 @@ resources:
3642
network: { get_param: [ cluster_net, 0, net ] }
3743
security_groups:
3844
if:
39-
- security_groups_set
45+
- security_groups_port1
4046
- { get_param: [ cluster_net, 0, security_groups ] }
4147
- []
4248
fixed_ips:
@@ -47,7 +53,10 @@ resources:
4753
properties:
4854
network: { get_param: [ cluster_net, 1, net ] }
4955
security_groups:
50-
- []
56+
if:
57+
- security_groups_port2
58+
- { get_param: [ cluster_net, 1, security_groups ] }
59+
- []
5160
fixed_ips:
5261
- subnet_id: { get_param: [ cluster_net, 1, subnet ] }
5362

files/resources/nodenet-2.yaml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,18 @@ parameters:
2525
default: []
2626

2727
conditions:
28-
security_groups_set:
28+
security_groups_port1:
2929
yaql:
3030
expression: $.data.cluster_net.containsKey('security_groups')
3131
data:
3232
cluster_net: { get_param: [ cluster_net, 0 ] }
3333

34+
security_groups_port2:
35+
yaql:
36+
expression: $.data.cluster_net.containsKey('security_groups')
37+
data:
38+
cluster_net: { get_param: [ cluster_net, 1 ] }
39+
3440
resources:
3541

3642
port1:
@@ -39,7 +45,7 @@ resources:
3945
network: { get_param: [ cluster_net, 0, net ] }
4046
security_groups:
4147
if:
42-
- security_groups_set
48+
- security_groups_port1
4349
- { get_param: [ cluster_net, 0, security_groups ] }
4450
- []
4551
fixed_ips:
@@ -51,7 +57,7 @@ resources:
5157
network: { get_param: [ cluster_net, 1, net ] }
5258
security_groups:
5359
if:
54-
- security_groups_set
60+
- security_groups_port2
5561
- { get_param: [ cluster_net, 1, security_groups ] }
5662
- []
5763
fixed_ips:

0 commit comments

Comments
 (0)