From ee437265fc62c9d66acc5d1ad8efc3cfcb6e558d Mon Sep 17 00:00:00 2001 From: Josh Patterson Date: Mon, 20 Apr 2026 12:00:02 -0400 Subject: [PATCH] monitor raid for vms --- salt/common/tools/sbin_jinja/so-raid-status | 11 +++++++++-- salt/salt/cloud/cloud.profiles.d/socloud.conf.jinja | 1 + 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/salt/common/tools/sbin_jinja/so-raid-status b/salt/common/tools/sbin_jinja/so-raid-status index 3fe238c23..ca3c34608 100755 --- a/salt/common/tools/sbin_jinja/so-raid-status +++ b/salt/common/tools/sbin_jinja/so-raid-status @@ -9,7 +9,7 @@ . /usr/sbin/so-common -software_raid=("SOSMN" "SOSMN-DE02" "SOSSNNV" "SOSSNNV-DE02" "SOS10k-DE02" "SOS10KNV" "SOS10KNV-DE02" "SOS10KNV-DE02" "SOS2000-DE02" "SOS-GOFAST-LT-DE02" "SOS-GOFAST-MD-DE02" "SOS-GOFAST-HV-DE02") +software_raid=("SOSMN" "SOSMN-DE02" "SOSSNNV" "SOSSNNV-DE02" "SOS10k-DE02" "SOS10KNV" "SOS10KNV-DE02" "SOS10KNV-DE02" "SOS2000-DE02" "SOS-GOFAST-LT-DE02" "SOS-GOFAST-MD-DE02" "SOS-GOFAST-HV-DE02" "HVGUEST") hardware_raid=("SOS1000" "SOS1000F" "SOSSN7200" "SOS5000" "SOS4000") {%- if salt['grains.get']('sosmodel', '') %} @@ -87,6 +87,11 @@ check_boss_raid() { } check_software_raid() { + if [[ ! -f /proc/mdstat ]]; then + SWRAID=0 + return + fi + SWRC=$(grep "_" /proc/mdstat) if [[ -n $SWRC ]]; then # RAID is failed in some way @@ -107,7 +112,9 @@ if [[ "$is_hwraid" == "true" ]]; then fi if [[ "$is_softwareraid" == "true" ]]; then check_software_raid - check_boss_raid + if [ "$model" != "HVGUEST" ]; then + check_boss_raid + fi fi sum=$(($SWRAID + $BOSSRAID + $HWRAID)) diff --git a/salt/salt/cloud/cloud.profiles.d/socloud.conf.jinja b/salt/salt/cloud/cloud.profiles.d/socloud.conf.jinja index f8e5d5555..44bef4108 100644 --- a/salt/salt/cloud/cloud.profiles.d/socloud.conf.jinja +++ b/salt/salt/cloud/cloud.profiles.d/socloud.conf.jinja @@ -27,6 +27,7 @@ sool9_{{host}}: log_file: /opt/so/log/salt/minion grains: hypervisor_host: {{host ~ "_" ~ role}} + sosmodel: HVGUEST preflight_cmds: - | {%- set hostnames = [MANAGERHOSTNAME] %}