Compare commits

..

No commits in common. "cb6e92aa92fc8b917c2f4b1a60331185bcb1ed1b" and "2cfe54e03ad9e00afa0ff288ddbe125d722c60ca" have entirely different histories.

View file

@ -69,21 +69,22 @@ echo "==> node=$NODE sha=$SHORT_SHA iso=$(basename "$ISO_PATH")"
ISO_NAME="furtka-${SHORT_SHA}.iso" ISO_NAME="furtka-${SHORT_SHA}.iso"
VOLID="${ISO_STORAGE}:iso/${ISO_NAME}" VOLID="${ISO_STORAGE}:iso/${ISO_NAME}"
# --- Step 1: upload ISO (or reuse if same SHA already on PVE) --------------- # --- Step 1: upload ISO ----------------------------------------------------
# For a given commit SHA the ISO bytes are reproducible, so if furtka-<sha>.iso # PVE's upload endpoint errors if the file exists. Delete first so re-runs
# is already in PVE storage from a prior smoke run we reuse it and skip the # on the same SHA (e.g. workflow re-dispatch) work.
# upload. Avoids DELETE-permission friction and shaves ~2 min off re-runs.
if api "$API/nodes/$NODE/storage/$ISO_STORAGE/content/$VOLID" \ if api "$API/nodes/$NODE/storage/$ISO_STORAGE/content/$VOLID" \
--output /dev/null 2>/dev/null; then --output /dev/null 2>/dev/null; then
echo "==> reusing existing ISO $VOLID" echo "==> removing stale ISO $VOLID"
else api --request DELETE "$API/nodes/$NODE/storage/$ISO_STORAGE/content/$VOLID" \
echo "==> uploading ISO as $ISO_NAME" --output /dev/null
api --request POST "$API/nodes/$NODE/storage/$ISO_STORAGE/upload" \
--form "content=iso" \
--form "filename=@${ISO_PATH};filename=${ISO_NAME}" \
> /dev/null
fi fi
echo "==> uploading ISO as $ISO_NAME"
api --request POST "$API/nodes/$NODE/storage/$ISO_STORAGE/upload" \
--form "content=iso" \
--form "filename=@${ISO_PATH};filename=${ISO_NAME}" \
> /dev/null
# --- Step 2: pick a free VMID in the reserved range ------------------------ # --- Step 2: pick a free VMID in the reserved range ------------------------
# List VMs on the node, filter by range, pick the lowest integer not in use. # List VMs on the node, filter by range, pick the lowest integer not in use.
USED="$(api "$API/nodes/$NODE/qemu" | python3 -c ' USED="$(api "$API/nodes/$NODE/qemu" | python3 -c '