Compare commits

..

1 Commits

Author SHA1 Message Date
CanbiZ (MickLesk)
f28b2372cc fix(build): validate storage availability when loading defaults
When loading var_container_storage / var_template_storage from default.vars
or app defaults, validate that the storage actually exists and is active on
the current node. In mixed clusters (e.g. LVM-Thin + ZFS hosts), saved
defaults from one node type would fail on another because the referenced
storage doesn't exist. Now invalid storage values are skipped with a
warning, allowing the normal storage selection prompt to appear.

Closes #12766
2026-03-12 08:38:24 +01:00
2 changed files with 14 additions and 2 deletions

View File

@@ -1185,6 +1185,18 @@ load_vars_file() {
continue
fi
;;
var_container_storage | var_template_storage)
# Validate that the storage exists and is active on the current node
local _storage_status
_storage_status=$(pvesm status 2>/dev/null | awk -v s="$var_val" '$1 == s { print $3 }')
if [[ -z "$_storage_status" ]]; then
msg_warn "Storage '$var_val' from $file not found on this node, ignoring"
continue
elif [[ "$_storage_status" == "disabled" ]]; then
msg_warn "Storage '$var_val' from $file is disabled on this node, ignoring"
continue
fi
;;
esac
fi

View File

@@ -4685,10 +4685,10 @@ _setup_nvidia_gpu() {
# Format varies by driver type:
# Proprietary: "NVRM version: NVIDIA UNIX x86_64 Kernel Module 550.54.14 Thu..."
# Open: "NVRM version: NVIDIA UNIX Open Kernel Module for x86_64 590.48.01 Release..."
# Use regex to extract version number (###.##.## or ###.## pattern)
# Use regex to extract version number (###.##.## pattern)
local nvidia_host_version=""
if [[ -f /proc/driver/nvidia/version ]]; then
nvidia_host_version=$(grep -oP '\d{3,}\.\d+(\.\d+)?' /proc/driver/nvidia/version 2>/dev/null | head -1)
nvidia_host_version=$(grep -oP '\d{3,}\.\d+\.\d+' /proc/driver/nvidia/version 2>/dev/null | head -1)
fi
if [[ -z "$nvidia_host_version" ]]; then