Skip to content

Commit 384cb1e

Browse files
committed
Add support for multiple Slurm partitions
Provision compute nodes with different flavors and place them into different Slurm partitions. Maintains the current behaviour, but allows overriding of openhpc_slurm_partitions to add more compute flavors and partitions.
1 parent b6eb1cb commit 384cb1e

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

group_vars/openhpc.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,9 @@
11
openhpc_cluster_name: "{{ cluster_name }}"
2+
3+
# Provision a single "standard" compute partition using the supplied
4+
# node count and flavor
5+
openhpc_slurm_partitions:
6+
- name: "standard"
7+
count: "{{ compute_count }}"
8+
flavor_name: "{{ compute_flavor }}"
9+
default: "YES"

roles/cluster_infra/templates/resources.tf.j2

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,16 +179,18 @@ resource "openstack_compute_instance_v2" "control" {
179179
EOF
180180
}
181181

182-
resource "openstack_compute_instance_v2" "compute" {
183-
count = {{ compute_count }}
182+
{% for partition in openhpc_slurm_partitions %}
183+
resource "openstack_compute_instance_v2" "{{ partition.name }}" {
184+
count = {{ partition.count }}
184185

185-
name = "{{ cluster_name }}-compute-${count.index}"
186+
name = "{{ cluster_name }}-compute-{{ partition.name }}-${count.index}"
186187
image_id = "{{ cluster_previous_image | default(cluster_image) }}"
187-
flavor_id = "{{ compute_flavor }}"
188+
flavor_name = "{{ partition.flavor_name }}"
188189

189190
network {
190191
name = "{{ cluster_network }}"
191192
}
193+
192194
security_groups = ["${openstack_networking_secgroup_v2.secgroup_slurm_cluster.name}"]
193195
# Use cloud-init to inject the SSH keys
194196
user_data = <<-EOF
@@ -198,6 +200,7 @@ resource "openstack_compute_instance_v2" "compute" {
198200
- {{ cluster_user_ssh_public_key }}
199201
EOF
200202
}
203+
{% endfor %}
201204

202205
#####
203206
##### Floating IP association for login node

0 commit comments

Comments
 (0)