diff --git a/scripts/proxmox/create-proxmox-resource.sh b/scripts/proxmox/create-proxmox-resource.sh index 6c9ce4e..34d99e6 100755 --- a/scripts/proxmox/create-proxmox-resource.sh +++ b/scripts/proxmox/create-proxmox-resource.sh @@ -302,6 +302,12 @@ platform_prefix="lxc" [[ -z "$cores" ]] && cores="$PROXMOX_DEFAULT_CORES" [[ -z "$memory" ]] && memory="$PROXMOX_DEFAULT_MEMORY_MB" +if [[ "$type" == "vm" && -n "$disk_size" ]]; then + echo "WARNING: --disk-size is LXC-only for create mode and is ignored for VMs." >&2 + echo " VM disk size comes from proxmoxImageSize in variables.nix (currently ${disk_size}G was requested)." >&2 + echo " To expand after creation, use: --modify --vmid --grow-disk " >&2 +fi + # --- discover / resolve the flake target from --host -------------------- # Emits "\t" pairs for every ${platform_prefix}-* flake # target -- the one source both --list and the --host lookup below read @@ -896,7 +902,7 @@ else else importdisk_output="$(ssh "$ssh_target" "${sudo_prefix} qm importdisk ${vmid} ${remote_path} ${storage}")" echo "$importdisk_output" - disk_id="$(echo "$importdisk_output" | grep -oP "(?<=Successfully imported disk as ')[^']+" | sed 's/^unused[0-9]*://')" + disk_id="$(echo "$importdisk_output" | grep -ioP "(?<=successfully imported disk as ')[^']+" | sed 's/^unused[0-9]*://')" if [[ -z "$disk_id" ]]; then echo "ERROR: couldn't parse the imported disk identifier from qm importdisk's output above." >&2 echo "The VM shell (${vmid}) and imported disk both exist -- finish attaching it by hand:" >&2