@@ -79,7 +79,22 @@ resource "openstack_blockstorage_volume_v3" "state" {
79
79
size = "{{ state_volume_size }}"
80
80
}
81
81
82
- {% if not home_manila_share %}
82
+ {% if cluster_home_manila_share | bool %}
83
+ resource "openstack_sharedfilesystem_share_v2" "home" {
84
+ name = "{{ cluster_name }}-home"
85
+ description = "Home for control node"
86
+ share_proto = "CEPHFS"
87
+ share_type = "{{ cluster_manila_share_type }}"
88
+ size = "{{ home_volume_size }}"
89
+ }
90
+
91
+ resource "openstack_sharedfilesystem_share_access_v2" "home" {
92
+ share_id = openstack_sharedfilesystem_share_v2.scratch.id
93
+ access_type = "cephx"
94
+ access_to = "{{ cluster_id }}" # TODO: is this guranteed to be unique across all projects? Presumably?
95
+ access_level = "rw"
96
+ }
97
+ {% else %}
83
98
resource "openstack_blockstorage_volume_v3" "home" {
84
99
name = "{{ cluster_name }}-home"
85
100
description = "Home for control node"
@@ -336,7 +351,7 @@ resource "openstack_compute_instance_v2" "control" {
336
351
uuid = openstack_blockstorage_volume_v3.state.id
337
352
}
338
353
339
- {% if not home_manila_share %}
354
+ {% if not cluster_home_manila_share | bool %}
340
355
# home volume:
341
356
block_device {
342
357
destination_type = " volume"
@@ -363,12 +378,12 @@ resource "openstack_compute_instance_v2" "control" {
363
378
- {{ ssh_key }}
364
379
{%- endfor %}
365
380
bootcmd:
366
- %{for volume in [openstack_blockstorage_volume_v3.state, {% if not home_manila_share %} openstack_blockstorage_volume_v3.home {% endif %}]}
381
+ %{for volume in [openstack_blockstorage_volume_v3.state, {% if not cluster_home_manila_share | bool %} openstack_blockstorage_volume_v3.home {% endif %}]}
367
382
- BLKDEV =$(readlink -f $(ls /dev /disk /by-id /*${substr(volume.id, 0, 20)}* | head -n1 )); blkid -o value -s TYPE $BLKDEV || mke2fs -t ext4 -L ${lower(split( " " , volume.description)[0])} $BLKDEV
368
383
%{endfor}
369
384
mounts:
370
385
- [LABEL =state, {{ appliances_state_dir }}, auto]
371
- {% if not home_manila_share %}
386
+ {% if not cluster_home_manila_share | bool %}
372
387
- [LABEL =home, /exports /home, auto]
373
388
{% endif %}
374
389
EOF
0 commit comments