Skip to content

Commit

Permalink
ansible-scylla-node: auto-detect NVMe: only use non-mounted and non-p…
Browse files Browse the repository at this point in the history
…artitioned disks.

NVMe disks should only be selected that are not in use, which should be the case when they are not mounted and not partitioned.

Signed-off-by: Vincent Reniers <[email protected]>
  • Loading branch information
vreniers committed Oct 23, 2024
1 parent cb6a054 commit ae5f053
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
1 change: 0 additions & 1 deletion ansible-scylla-node/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ scylla_dependencies:
- curl
- wget
- python3-yaml # this will fail on non centos systems
- nvme-cli
#- software-properties-common
#- apt-transport-https
#- gnupg2
Expand Down
5 changes: 0 additions & 5 deletions ansible-scylla-node/tasks/RedHat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,6 @@
for i in `yum search python3|grep -i pyyaml|awk '{ print $1 }'`; do sudo yum -y install $i; done
become: true

- name: install nvme-cli
shell: |
yum install -y nvme-cli
become: true

- name: install and configure Scylla Manager Agent
block:
- name: add Scylla Manager repo
Expand Down
8 changes: 6 additions & 2 deletions ansible-scylla-node/tasks/common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@

- name: Detect NVME disks
block:
- name: Get list of NVMEs
- name: Get list of NVMEs with no partitions and no mount point
shell: |
nvme list | awk '{print $1}' | tail -n +3
lsblk -oNAME,PATH,PTTYPE,MOUNTPOINT -nd | grep nvme | awk '{if ($3=="" && $4=="") print $2}'
register: _detected_nvmes

- set_fact:
Expand Down Expand Up @@ -80,6 +80,10 @@
_disable_online_discard: "--online-discard {{ scylla_raid_online_discard }}"
when: _scylla_raid_setup_help.stdout is search("--online-discard")

- name: "ansible-scylla-node: common.yml: Setting raid setup with disks"
debug:
msg: "Using the following disk devices: {{ scylla_raid_setup | join(',') }}"

- name: run raid setup if there is no scylla mount yet
shell: "scylla_raid_setup --disks {{ scylla_raid_setup | join(',') }} --update-fstab {{ _disable_online_discard }}"
become: true
Expand Down

0 comments on commit ae5f053

Please sign in to comment.