Skip to content

Commit 4e25378

Browse files
committed
add optional platform-lifecycle manila share for homedirs for caas
1 parent abd9d29 commit 4e25378

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

ansible/roles/cluster_infra/templates/resources.tf.j2

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,22 @@ resource "openstack_blockstorage_volume_v3" "state" {
7979
size = "{{ state_volume_size }}"
8080
}
8181

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 %}
8398
resource "openstack_blockstorage_volume_v3" "home" {
8499
name = "{{ cluster_name }}-home"
85100
description = "Home for control node"
@@ -336,7 +351,7 @@ resource "openstack_compute_instance_v2" "control" {
336351
uuid = openstack_blockstorage_volume_v3.state.id
337352
}
338353

339-
{% if not home_manila_share %}
354+
{% if not cluster_home_manila_share | bool %}
340355
# home volume:
341356
block_device {
342357
destination_type = "volume"
@@ -363,12 +378,12 @@ resource "openstack_compute_instance_v2" "control" {
363378
- {{ ssh_key }}
364379
{%- endfor %}
365380
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 %}]}
367382
- 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
368383
%{endfor}
369384
mounts:
370385
- [LABEL=state, {{ appliances_state_dir }}, auto]
371-
{% if not home_manila_share %}
386+
{% if not cluster_home_manila_share | bool %}
372387
- [LABEL=home, /exports/home, auto]
373388
{% endif %}
374389
EOF

environments/.caas/inventory/group_vars/all/nfs.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,4 @@ caas_nfs_home:
1717
nfs_export: "/exports/home" # assumes skeleton TF is being used
1818
nfs_client_mnt_point: "/home"
1919

20-
# home_manila_share set by platform UI:
21-
nfs_configurations: "{{ caas_nfs_ood_state + (caas_nfs_home if not home_manila_share | bool else []) }}"
20+
nfs_configurations: "{{ caas_nfs_ood_state + (caas_nfs_home if not cluster_home_manila_share | bool else []) }}"

0 commit comments

Comments
 (0)