core: validate storage availability when loading defaults (#12794)

This commit is contained in:
CanbiZ (MickLesk) 2026-03-12 09:17:18 +01:00 committed by GitHub
parent 667efeab5e
commit dd3b381813
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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