diff --git a/defaults.inc b/defaults.inc index c5d93f4..f27ad12 100755 --- a/defaults.inc +++ b/defaults.inc @@ -3,7 +3,7 @@ action="${1:-}" FOLDER='/opt/idssys/ta-proxmenu' -VERS='2026.7.25-40' +VERS='2026.7.25-44' noupdate=' ' diff --git a/inc/deploy-iso-nfs-lxc.sh b/inc/deploy-iso-nfs-lxc.sh index eff7097..71d914f 100644 --- a/inc/deploy-iso-nfs-lxc.sh +++ b/inc/deploy-iso-nfs-lxc.sh @@ -111,7 +111,7 @@ TAPM_DEPLOY_ISO_NFS_LXC() { [[ $EUID -eq 0 ]] || { TAPM_ISO_NFS_FAIL "Run this action as root on a Proxmox VE host."; return 1; } - for command in pct pvesm pveam pvesh; do + for command in pct pvesm pveam pvesh ha-manager; do command -v "$command" >/dev/null 2>&1 || { TAPM_ISO_NFS_FAIL "Required Proxmox command '${command}' was not found."; return 1; } done @@ -160,7 +160,7 @@ TAPM_DEPLOY_ISO_NFS_LXC() { TAPM_ISO_NFS_PROMPT data_size "ISO volume size in GiB" "250" [[ "$data_size" =~ ^[1-9][0-9]*$ ]] || { TAPM_ISO_NFS_FAIL "The ISO volume size must be a positive integer."; return 1; } - TAPM_ISO_NFS_PROMPT pve_storage_id "Proxmox cluster storage ID" "PVE-Shared-Storage" + TAPM_ISO_NFS_PROMPT pve_storage_id "Proxmox cluster storage ID" "$hostname" TAPM_ISO_NFS_VALID_ID "$pve_storage_id" || { TAPM_ISO_NFS_FAIL "The Proxmox storage ID is invalid."; return 1; } if pvesm status 2>/dev/null | awk 'NR > 1 { print $1 }' | grep -Fxq -- "$pve_storage_id"; then @@ -180,13 +180,15 @@ TAPM_DEPLOY_ISO_NFS_LXC() { echo " Deployment summary" echo " LXC: ${ctid} (${hostname}), privileged" echo " Network: ${address_cidr} via ${gateway} on ${bridge}" + echo " Resources: 2 vCPU, 2048 MiB RAM, 512 MiB swap, 100 CPU units" echo " Root volume: ${root_storage}:${root_size} GiB" echo " ISO volume mp0: ${data_storage}:${data_size} GiB -> /srv/iso" echo " NFS clients: ${client_cidr}" echo " Cluster storage: ${pve_storage_id}" + echo " HA resource: ct:${ctid} (started)" echo - read -r -p " Create this container and storage (type YES to continue)? " choice - [[ "$choice" == "YES" ]] || { + read -r -p " Create this container and storage (type yes to continue)? " choice + [[ "$choice" =~ ^[Yy][Ee][Ss]$ ]] || { echo " Cancelled; no changes were made." return 0 } @@ -216,7 +218,8 @@ TAPM_DEPLOY_ISO_NFS_LXC() { --unprivileged 0 \ --features nesting=1 \ --cores 2 \ - --memory 1024 \ + --cpunits 100 \ + --memory 2048 \ --swap 512 \ --rootfs "${root_storage}:${root_size}" \ --mp0 "${data_storage}:${data_size},mp=/srv/iso,backup=1" \ @@ -283,9 +286,17 @@ TAPM_DEPLOY_ISO_NFS_LXC() { return 1 fi + echo -e "\n${idsCL[LightCyan]}Adding LXC ${ctid} to Proxmox HA...${idsCL[Default]}" + if ! ha-manager add "ct:${ctid}" --state started; then + TAPM_ISO_NFS_FAIL \ + "Shared storage '${pve_storage_id}' is active, but LXC ${ctid} could not be added to HA." + return 1 + fi + echo echo -e "${idsCL[Green]}Shared ISO storage '${pve_storage_id}' is active.${idsCL[Default]}" echo " LXC ${ctid} serves ${data_storage}:${data_size} GiB from ${server_ip}:/srv/iso." + echo " HA now manages ct:${ctid} with requested state 'started'." echo " Because Proxmox storage configuration is cluster-wide, every cluster node" echo " can use it when that node can reach ${server_ip} and is allowed by ${client_cidr}." return 0