diff --git a/scripts/proxmox-install.sh b/scripts/proxmox-install.sh index fa90aea..2119487 100644 --- a/scripts/proxmox-install.sh +++ b/scripts/proxmox-install.sh @@ -70,14 +70,17 @@ detect_resources() { # Nächste freie CT-ID NEXT_ID=$(pvesh get /cluster/nextid 2>/dev/null | tr -d '[:space:]' || echo "100") - # Verfügbare Storages (für LXC-Rootfs) - STORAGES=$(pvesm status 2>/dev/null | awk 'NR>1 && $2!="dir" || $2=="dir" {print $1}' | tr '\n' ' ' || echo "local-lvm local") + # Verfügbare Storages – NUR solche die rootdir (LXC-Rootfs) unterstützen + # "local" unterstützt nur ISO/Templates, nicht Container-Rootfs! + STORAGES=$(pvesm status --content rootdir 2>/dev/null | awk 'NR>1{print $1}' | tr '\n' ' ' || echo "local-lvm") + [[ -z "${STORAGES// }" ]] && STORAGES="local-lvm" # Verfügbare Bridges BRIDGES=$(ip link show 2>/dev/null | grep -oP '(?<=: )vmbr\d+' | tr '\n' ' ' || echo "vmbr0") - # Erster Storage als Default - DEFAULT_STORAGE=$(pvesm status 2>/dev/null | awk 'NR==2{print $1}' || echo "local-lvm") + # Erster rootdir-fähiger Storage als Default + DEFAULT_STORAGE=$(pvesm status --content rootdir 2>/dev/null | awk 'NR==2{print $1}' || echo "local-lvm") + [[ -z "$DEFAULT_STORAGE" ]] && DEFAULT_STORAGE="local-lvm" # Erste Bridge als Default DEFAULT_BRIDGE=$(ip link show 2>/dev/null | grep -oP '(?<=: )vmbr\d+' | head -1 || echo "vmbr0") @@ -111,7 +114,8 @@ prepare_template() { # ── Konfiguration abfragen ──────────────────────────────────────────────────── collect_config() { step "LXC Konfiguration" - echo -e " ${CYAN}Verfügbare Storages:${NC} $STORAGES" + echo -e " ${CYAN}Storages (rootdir-fähig):${NC} ${BOLD}$STORAGES${NC}" + echo -e " ${YELLOW} Nur diese unterstützen LXC-Container (local reicht nicht!)${NC}" echo -e " ${CYAN}Verfügbare Bridges:${NC} $BRIDGES\n" ask "LXC Container-ID" "$NEXT_ID"