From dd3b3818135ce36aa735f30ec810f5a71a47c8ee Mon Sep 17 00:00:00 2001 From: "CanbiZ (MickLesk)" <47820557+MickLesk@users.noreply.github.com> Date: Thu, 12 Mar 2026 09:17:18 +0100 Subject: [PATCH] core: validate storage availability when loading defaults (#12794) --- misc/build.func | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/misc/build.func b/misc/build.func index 33cb367be..4a4c0617f 100644 --- a/misc/build.func +++ b/misc/build.func @@ -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