ci: nested PVE guests land in the ci pool with VMIDs 5081-5092

The runner token is pool-scoped (PVEVMAdmin on /pool/ci only), so VM.Allocate
succeeds only with pool_id set; VMIDs move into the 5000-5999 CI range.
This commit is contained in:
Clint Branham
2026-08-23 09:05:48 -05:00
parent c7eff18899
commit d3f05187dd
5 changed files with 15 additions and 6 deletions
+2
View File
@@ -137,6 +137,7 @@ jobs:
TF_VAR_disk_storage: ${{ vars.DISK_STORAGE }}
TF_VAR_iso_storage: ${{ vars.ISO_STORAGE }}
TF_VAR_network_bridge: ${{ vars.NETWORK_BRIDGE }}
TF_VAR_pool_id: ${{ vars.POOL_ID }}
run: bash ${SCRIPTS_DIR}/run-integration.sh provision
# ── Integration tests (self-hosted, per PVE version) ────────────────
@@ -215,6 +216,7 @@ jobs:
TF_VAR_disk_storage: ${{ vars.DISK_STORAGE }}
TF_VAR_iso_storage: ${{ vars.ISO_STORAGE }}
TF_VAR_network_bridge: ${{ vars.NETWORK_BRIDGE }}
TF_VAR_pool_id: ${{ vars.POOL_ID }}
# Always use force-cleanup in CI — handles corrupted state from
# cancelled runs, timeouts, or partial provisioning failures.
run: bash ${SCRIPTS_DIR}/run-integration.sh force-cleanup
+4 -4
View File
@@ -22,7 +22,7 @@ PVE_PASSWORD=<root-password-for-nested-pve>
# PVE_VERSIONS=9 8
#
# ── VMID overrides ───────────────────────────────────────────────────
# PVE9A_VMID=99091
# PVE9B_VMID=99092
# PVE8A_VMID=99081
# PVE8B_VMID=99082
# PVE9A_VMID=5091
# PVE9B_VMID=5092
# PVE8A_VMID=5081
# PVE8B_VMID=5082
+1
View File
@@ -42,6 +42,7 @@ resource "proxmox_virtual_environment_vm" "nested_pve" {
name = each.value.vm_name
node_name = var.target_node
vm_id = each.value.vm_id
pool_id = var.pool_id
machine = "q35"
bios = "ovmf"
@@ -75,8 +75,8 @@ pve_iso() {
pve_vmid() {
case "$1" in
9a) echo "${PVE9A_VMID:-99091}" ;; 9b) echo "${PVE9B_VMID:-99092}" ;;
8a) echo "${PVE8A_VMID:-99081}" ;; 8b) echo "${PVE8B_VMID:-99082}" ;;
9a) echo "${PVE9A_VMID:-5091}" ;; 9b) echo "${PVE9B_VMID:-5092}" ;;
8a) echo "${PVE8A_VMID:-5081}" ;; 8b) echo "${PVE8B_VMID:-5082}" ;;
*) echo "ERROR: unknown node '$1'" >&2; exit 1 ;;
esac
}
+6
View File
@@ -100,3 +100,9 @@ variable "answer_server_dir" {
type = string
}
variable "pool_id" {
description = "Resource pool the nested VMs are created in (a pool-scoped API token can only allocate here)"
type = string
default = null
}