Skip to content

Commit 1e68a91

Browse files
authored
Merge pull request #341 from stackhpc/feat/base-RL89
Update fatimage base to RL8.9 with robust volume mounts
2 parents 44608ac + 9b34524 commit 1e68a91

File tree

10 files changed

+17
-72
lines changed

10 files changed

+17
-72
lines changed

ansible/roles/cluster_infra/tasks/main.yml

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -57,29 +57,6 @@
5757
- terraform_state == "present"
5858
- cluster_upgrade_system_packages is not defined or not cluster_upgrade_system_packages
5959

60-
- name: Detect volume device prefix from image metadata
61-
block:
62-
- name: Get image metadata from OpenStack API
63-
openstack.cloud.image_info:
64-
image: "{{ cluster_previous_image | default(cluster_image) }}"
65-
register: cluster_image_info
66-
- name: Check only single image found
67-
assert:
68-
that: cluster_image_info.images | length == 1
69-
fail_msg: "Multiple images found for 'cluster_image' {{ cluster_image }}"
70-
- name: Set volume_device_prefix fact
71-
set_fact:
72-
block_device_prefix: >-
73-
{{
74-
'sd' if (cluster_image_info.images | first).hw_scsi_model is defined and
75-
(cluster_image_info.images | first).hw_scsi_model in scsi_models
76-
else 'vd'
77-
}}
78-
# Only run when block_device_prefix isn't set as an extravar
79-
when:
80-
- block_device_prefix is not defined
81-
- cluster_image is defined
82-
8360
- name: Template Terraform files into project directory
8461
template:
8562
src: >-

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

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -358,18 +358,13 @@ resource "openstack_compute_instance_v2" "control" {
358358
{%- for ssh_key in cluster_deploy_ssh_keys_extra %}
359359
- {{ ssh_key }}
360360
{%- endfor %}
361-
fs_setup:
362-
- label: state
363-
filesystem: ext4
364-
device: /dev/{{ block_device_prefix }}b
365-
partition: auto
366-
- label: home
367-
filesystem: ext4
368-
device: /dev/{{ block_device_prefix }}c
369-
partition: auto
361+
bootcmd:
362+
%{for volume in [openstack_blockstorage_volume_v3.state, openstack_blockstorage_volume_v3.home]}
363+
- 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
364+
%{endfor}
370365
mounts:
371-
- [LABEL=state, /var/lib/state, auto, "x-systemd.required-by=nfs-server.service,x-systemd.before=nfs-server.service"]
372-
- [LABEL=home, /exports/home, auto, "x-systemd.required-by=nfs-server.service,x-systemd.before=nfs-server.service"]
366+
- [LABEL=state, {{ appliances_state_dir }}, auto]
367+
- [LABEL=home, /exports/home, auto]
373368
EOF
374369
}
375370

environments/.stackhpc/ARCUS.pkrvars.hcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ volume_size = 10 # GB
44
image_disk_format = "qcow2"
55
networks = ["4b6b2722-ee5b-40ec-8e52-a6610e14cc51"] # portal-internal (DNS broken on ilab-60)
66
source_image_name = "openhpc-230804-1754-80b8d714" # https://github.com/stackhpc/ansible-slurm-appliance/pull/298
7-
fatimage_source_image_name = "Rocky-8-GenericCloud-Base-8.8-20230518.0.x86_64.qcow2"
7+
fatimage_source_image_name = "Rocky-8-GenericCloud-Base-8.9-20231119.0.x86_64.qcow2"
88
ssh_keypair_name = "slurm-app-ci"
99
ssh_private_key_file = "~/.ssh/id_rsa"
1010
security_groups = ["default", "SSH"]

environments/.stackhpc/SMS.pkrvars.hcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
flavor = "general.v1.tiny"
22
networks = ["26023e3d-bc8e-459c-8def-dbd47ab01756"] # stackhpc-ipv4-geneve
33
source_image_name = "openhpc-230503-0944-bf8c3f63" # https://github.com/stackhpc/ansible-slurm-appliance/pull/252
4-
fatimage_source_image_name = "Rocky-8-GenericCloud-Base-8.8-20230518.0.x86_64.qcow2"
4+
fatimage_source_image_name = "Rocky-8-GenericCloud-Base-8.9-20231119.0.x86_64.qcow2"
55
ssh_keypair_name = "slurm-app-ci"
66
ssh_private_key_file = "~/.ssh/id_rsa"
77
security_groups = ["default", "SSH"]

environments/.stackhpc/terraform/ARCUS.tfvars

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,3 @@ cluster_subnet = "portal-internal"
33
vnic_type = "normal"
44
control_node_flavor = "vm.ska.cpu.general.quarter"
55
other_node_flavor = "vm.ska.cpu.general.small"
6-
state_volume_device_path = "/dev/sdb"
7-
home_volume_device_path = "/dev/sdc"

environments/.stackhpc/terraform/SMS.tfvars

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,3 @@ cluster_subnet = "stackhpc-ipv4-geneve-subnet"
33
vnic_type = "normal"
44
control_node_flavor = "general.v1.medium"
55
other_node_flavor = "general.v1.tiny"
6-
state_volume_device_path = "/dev/vdb"
7-
home_volume_device_path = "/dev/vdc"

environments/.stackhpc/terraform/main.tf

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ variable "cluster_name" {
1313
variable "cluster_image" {
1414
description = "single image for all cluster nodes - a convenience for CI"
1515
type = string
16-
default = "openhpc-231206-1648-9d6aa4e4" # https://github.com/stackhpc/ansible-slurm-appliance/pull/340
17-
# default = "Rocky-8-GenericCloud-Base-8.8-20230518.0.x86_64.qcow2"
16+
default = "openhpc-231208-1207-b69af6e2" # https://github.com/stackhpc/ansible-slurm-appliance/pull/341
17+
# default = "Rocky-8-GenericCloud-Base-8.9-20231119.0.x86_64.qcow2"
1818
}
1919

2020
variable "cluster_net" {}
@@ -31,10 +31,6 @@ variable "volume_backed_instances" {
3131
default = false
3232
}
3333

34-
variable "state_volume_device_path" {}
35-
36-
variable "home_volume_device_path" {}
37-
3834
module "cluster" {
3935
source = "../../skeleton/{{cookiecutter.environment}}/terraform/"
4036

@@ -76,6 +72,4 @@ module "cluster" {
7672
state_volume_size = 10
7773
home_volume_size = 20
7874

79-
state_volume_device_path = var.state_volume_device_path
80-
home_volume_device_path = var.home_volume_device_path
8175
}

environments/skeleton/{{cookiecutter.environment}}/terraform/nodes.tf

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -126,19 +126,14 @@ resource "openstack_compute_instance_v2" "control" {
126126
#cloud-config
127127
fqdn: ${var.cluster_name}-${each.key}.${var.cluster_name}.${var.cluster_domain_suffix}
128128
129-
fs_setup:
130-
- label: state
131-
filesystem: ext4
132-
device: ${var.state_volume_device_path}
133-
partition: auto
134-
- label: home
135-
filesystem: ext4
136-
device: ${var.home_volume_device_path}
137-
partition: auto
129+
bootcmd:
130+
%{for volume in [openstack_blockstorage_volume_v3.state, openstack_blockstorage_volume_v3.home]}
131+
- 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
132+
%{endfor}
138133
139134
mounts:
140135
- [LABEL=state, ${var.state_dir}]
141-
- [LABEL=home, /exports/home, auto, "x-systemd.required-by=nfs-server.service,x-systemd.before=nfs-server.service"]
136+
- [LABEL=home, /exports/home]
142137
EOF
143138

144139
}

environments/skeleton/{{cookiecutter.environment}}/terraform/variables.tf

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -55,18 +55,6 @@ variable "environment_root" {
5555
description = "Path to environment root, automatically set by activate script"
5656
}
5757

58-
variable "state_volume_device_path" {
59-
type = string
60-
description = "Path to block device for state"
61-
default = "/dev/sdb"
62-
}
63-
64-
variable "home_volume_device_path" {
65-
type = string
66-
description = "Path to block device name for home directories"
67-
default = "/dev/sdc"
68-
}
69-
7058
variable "state_dir" {
7159
type = string
7260
description = "Path to state directory on control node"
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
resource "openstack_blockstorage_volume_v3" "state" {
22
name = "${var.cluster_name}-state"
3-
description = "State for control node"
3+
description = "State for control node" # first word used to label filesystem
44
size = var.state_volume_size
55
}
66

77
resource "openstack_blockstorage_volume_v3" "home" {
88
name = "${var.cluster_name}-home"
9-
description = "Home for control node"
9+
description = "Home for control node" # first word used to label filesystem
1010
size = var.home_volume_size
1111
}

0 commit comments

Comments
 (0)