Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions ansible/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,5 @@ roles/*
!roles/eessi/**
!roles/topology/
!roles/topology/**
!roles/raid/
!roles/raid/**
9 changes: 9 additions & 0 deletions ansible/extras.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
- hosts: raid
become: yes
gather_facts: no
tags: raid
name: Configure image for baremetal software raid root disks
tasks:
- include_role:
name: raid

- hosts: k3s_server:!builder
become: yes
tags: k3s
Expand Down
17 changes: 17 additions & 0 deletions ansible/roles/raid/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# raid

Configure an image to support software raid (via [mdadm](https://github.com/md-raid-utilities/mdadm)).

RockyLinux genericcloud images already have the necessary `mdraid` dracut
module installed, as well as kernel modules for `raid0`, `raikd1`, `raid10` and
`raid456` [^1]. This covers all raid modes [supported by Ironic](https://docs.openstack.org/ironic/latest/admin/raid.html#software-raid)
hence this role does not support extending this.

This role changes the command line for the current kernel. It does not reboot
the instance so generally is only useful during image builds.

Note that the `rootfs_uuid` image property described in the [Ironic raid documentation](https://docs.openstack.org/ironic/latest/admin/raid.html#image-requirements)
is not required; the root partition is the first (non-boot) partition and this
is sufficent for Ironic to find the root file system.

[^1]: As shown by `lsinitrd /boot/initramfs-$(uname -r).img | grep raid`
13 changes: 13 additions & 0 deletions ansible/roles/raid/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
- name: Enable autoassembly of mdraid devices
# adds rd.auto=1 - see `man dracut.cmdline`
ansible.builtin.lineinfile:
path: /etc/default/grub
regexp: '^GRUB_CMDLINE_LINUX_DEFAULT="((?:(?!rd.auto=1).)*?)"$'
line: 'GRUB_CMDLINE_LINUX_DEFAULT="\1 rd.auto=1"'
backup: true
backrefs: true
register: update_grub

- name: Update GRUB configuration file
command: grub2-mkconfig -o /boot/grub2/grub.cfg --update-bls-cmdline
when: update_grub.changed
4 changes: 4 additions & 0 deletions environments/.stackhpc/inventory/extra_groups
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,7 @@ cluster

[compute_init:children]
compute

[raid:children]
# Configure fatimage for raid
builder
4 changes: 2 additions & 2 deletions environments/.stackhpc/tofu/cluster_image.auto.tfvars.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"cluster_image": {
"RL8": "openhpc-RL8-250820-0800-767addd8",
"RL9": "openhpc-RL9-250908-2047-d90ebd0e"
"RL8": "openhpc-RL8-250916-1615-2aee3913",
"RL9": "openhpc-RL9-250916-1615-2aee3913"
}
}
2 changes: 2 additions & 0 deletions environments/common/inventory/groups
Original file line number Diff line number Diff line change
Expand Up @@ -218,3 +218,5 @@ extra_packages
# pulp_host ansible_host=<VM-ip-address>
# Note the host name can't conflict with group names i.e can't be called `pulp` or `pulp_server`

[raid]
# Add `builder` to configure image for software raid
3 changes: 3 additions & 0 deletions environments/site/inventory/groups
Original file line number Diff line number Diff line change
Expand Up @@ -166,3 +166,6 @@ compute
# separately from the appliance. e.g
# pulp_host ansible_host=<VM-ip-address>
# Note inventory host name cannot conflict with group names i.e can't be called `pulp` or `pulp_server`.

[raid]
# Add `builder` to configure image for software raid