From dca90ad3aa0b3edc5c80f73dee25af2dffb993c0 Mon Sep 17 00:00:00 2001 From: juvdiaz Date: Wed, 1 Jul 2026 09:09:39 -0600 Subject: [PATCH] Fail Pimox worker creation faster --- README.md | 5 +++++ README.md.tmpl | 5 +++++ bootstrap/provisioning/README.md | 5 +++++ jeannie | 15 ++++++++++++--- 4 files changed, 27 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ab86524..3276908 100644 --- a/README.md +++ b/README.md @@ -735,6 +735,11 @@ Defaults are `LAB_PIMOX_WORKER_NETWORK_MODE=static`, `LAB_PIMOX_WORKER_GATEWAY=192.168.100.1`, and `LAB_PIMOX_WORKER_DNS_SERVERS="192.168.100.89 1.1.1.1"`. Set `LAB_PIMOX_WORKER_NETWORK_MODE=dhcp` to restore the old DHCP-only behavior. +Worker creation fails faster than template creation: static guest-network +configuration waits up to `LAB_PIMOX_GUEST_AGENT_CONFIG_TIMEOUT_SECONDS=120`, +worker IP/SSH readiness waits up to `LAB_PIMOX_WORKER_WAIT_TIMEOUT_SECONDS=600`, +and SSH after an IP appears waits up to `LAB_PIMOX_GUEST_SSH_TIMEOUT_SECONDS=180`. +`LAB_PIMOX_GUEST_TIMEOUT_SECONDS` remains the broader template-build timeout. Long-running `./jeannie up` steps keep compact output by default, but the active step line refreshes with elapsed time and the latest log line. Set diff --git a/README.md.tmpl b/README.md.tmpl index cc85c7b..a2bf82d 100644 --- a/README.md.tmpl +++ b/README.md.tmpl @@ -735,6 +735,11 @@ Defaults are `LAB_PIMOX_WORKER_NETWORK_MODE=static`, `LAB_PIMOX_WORKER_GATEWAY=192.168.100.1`, and `LAB_PIMOX_WORKER_DNS_SERVERS="192.168.100.89 1.1.1.1"`. Set `LAB_PIMOX_WORKER_NETWORK_MODE=dhcp` to restore the old DHCP-only behavior. +Worker creation fails faster than template creation: static guest-network +configuration waits up to `LAB_PIMOX_GUEST_AGENT_CONFIG_TIMEOUT_SECONDS=120`, +worker IP/SSH readiness waits up to `LAB_PIMOX_WORKER_WAIT_TIMEOUT_SECONDS=600`, +and SSH after an IP appears waits up to `LAB_PIMOX_GUEST_SSH_TIMEOUT_SECONDS=180`. +`LAB_PIMOX_GUEST_TIMEOUT_SECONDS` remains the broader template-build timeout. Long-running `./{{ main_script }} up` steps keep compact output by default, but the active step line refreshes with elapsed time and the latest log line. Set diff --git a/bootstrap/provisioning/README.md b/bootstrap/provisioning/README.md index c2fd546..ea0a1f7 100644 --- a/bootstrap/provisioning/README.md +++ b/bootstrap/provisioning/README.md @@ -150,6 +150,11 @@ through qemu-guest-agent after clone/start and before SSH wait: and `LAB_PIMOX_WORKER_DNS_SERVERS="192.168.100.89 1.1.1.1"`. Use `LAB_PIMOX_WORKER_NETWORK_MODE=dhcp` only when DHCP reservations are known to be stable. +Worker clone failures are intentionally faster than template build failures: +`LAB_PIMOX_GUEST_AGENT_CONFIG_TIMEOUT_SECONDS=120`, +`LAB_PIMOX_WORKER_WAIT_TIMEOUT_SECONDS=600`, and +`LAB_PIMOX_GUEST_SSH_TIMEOUT_SECONDS=180` by default. The broader +`LAB_PIMOX_GUEST_TIMEOUT_SECONDS` still controls template preparation. Worker indexes are stable: index `1` maps to VMID `9010`, `pimox-worker-01`, and worker key `pimox01`; index `2` maps to VMID `9011`, diff --git a/jeannie b/jeannie index 2eb00e0..f7102e4 100755 --- a/jeannie +++ b/jeannie @@ -1072,7 +1072,7 @@ wait_for_pimox_guest_ssh() { local next_log local ssh_deadline=0 local ssh_output - local ssh_timeout_seconds="${LAB_PIMOX_GUEST_SSH_TIMEOUT_SECONDS:-600}" + local ssh_timeout_seconds="${LAB_PIMOX_GUEST_SSH_TIMEOUT_SECONDS:-180}" ip_filter_description="matching prefix ${ip_prefix}" if [[ -z "${ip_prefix}" ]]; then @@ -1179,7 +1179,7 @@ configure_pimox_worker_guest_network() { local gateway="$7" local dns_servers="$8" local interface_name="$9" - local timeout_seconds="${LAB_PIMOX_GUEST_AGENT_CONFIG_TIMEOUT_SECONDS:-300}" + local timeout_seconds="${LAB_PIMOX_GUEST_AGENT_CONFIG_TIMEOUT_SECONDS:-120}" local deadline local script local encoded_script @@ -1917,6 +1917,7 @@ run_pimox_pipeline() { local worker_key_path="${LAB_PIMOX_WORKER_SSH_KEY_PATH:-/home/jv/.ssh/id_ed25519}" local ip_prefix="${LAB_PIMOX_GUEST_IP_PREFIX:-192.168.100.}" local timeout_seconds="${LAB_PIMOX_GUEST_TIMEOUT_SECONDS:-3600}" + local worker_wait_timeout_seconds="${LAB_PIMOX_WORKER_WAIT_TIMEOUT_SECONDS:-600}" local spec_file="${REPO_ROOT}/.lab/pimox-workers.tsv" local var_file="${REPO_ROOT}/.lab/cluster-workers.auto.tfvars.json" local index @@ -1948,6 +1949,14 @@ run_pimox_pipeline() { echo "Pimox template and worker CPU and memory values must be greater than zero." >&2 exit 1 fi + if ! [[ "${timeout_seconds}" =~ ^[0-9]+$ && "${timeout_seconds}" -gt 0 ]]; then + echo "LAB_PIMOX_GUEST_TIMEOUT_SECONDS must be a positive integer." >&2 + exit 1 + fi + if ! [[ "${worker_wait_timeout_seconds}" =~ ^[0-9]+$ && "${worker_wait_timeout_seconds}" -gt 0 ]]; then + echo "LAB_PIMOX_WORKER_WAIT_TIMEOUT_SECONDS must be a positive integer." >&2 + exit 1 + fi if ! truthy "${worker_replace_existing}" && ! disabled_value "${worker_replace_existing}"; then echo "LAB_PIMOX_WORKER_REPLACE_EXISTING must be true or false." >&2 exit 1 @@ -2065,7 +2074,7 @@ fi" 2>&1)" "${worker_user}" \ "${worker_key_path}" \ "${ip_prefix}" \ - "${timeout_seconds}" \ + "${worker_wait_timeout_seconds}" \ "${qm_bin}" \ "${worker_storage}" \ "${worker_replace_existing}" \