Fail Pimox worker creation faster

This commit is contained in:
juvdiaz 2026-07-01 09:09:39 -06:00
parent e062de2413
commit dca90ad3aa
4 changed files with 27 additions and 3 deletions

View File

@ -735,6 +735,11 @@ Defaults are `LAB_PIMOX_WORKER_NETWORK_MODE=static`,
`LAB_PIMOX_WORKER_GATEWAY=192.168.100.1`, and `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_DNS_SERVERS="192.168.100.89 1.1.1.1"`. Set
`LAB_PIMOX_WORKER_NETWORK_MODE=dhcp` to restore the old DHCP-only behavior. `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 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 the active step line refreshes with elapsed time and the latest log line. Set

View File

@ -735,6 +735,11 @@ Defaults are `LAB_PIMOX_WORKER_NETWORK_MODE=static`,
`LAB_PIMOX_WORKER_GATEWAY=192.168.100.1`, and `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_DNS_SERVERS="192.168.100.89 1.1.1.1"`. Set
`LAB_PIMOX_WORKER_NETWORK_MODE=dhcp` to restore the old DHCP-only behavior. `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 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 the active step line refreshes with elapsed time and the latest log line. Set

View File

@ -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 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 `LAB_PIMOX_WORKER_NETWORK_MODE=dhcp` only when DHCP reservations are known to be
stable. 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`, Worker indexes are stable: index `1` maps to VMID `9010`,
`pimox-worker-01`, and worker key `pimox01`; index `2` maps to VMID `9011`, `pimox-worker-01`, and worker key `pimox01`; index `2` maps to VMID `9011`,

15
jeannie
View File

@ -1072,7 +1072,7 @@ wait_for_pimox_guest_ssh() {
local next_log local next_log
local ssh_deadline=0 local ssh_deadline=0
local ssh_output 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}" ip_filter_description="matching prefix ${ip_prefix}"
if [[ -z "${ip_prefix}" ]]; then if [[ -z "${ip_prefix}" ]]; then
@ -1179,7 +1179,7 @@ configure_pimox_worker_guest_network() {
local gateway="$7" local gateway="$7"
local dns_servers="$8" local dns_servers="$8"
local interface_name="$9" 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 deadline
local script local script
local encoded_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 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 ip_prefix="${LAB_PIMOX_GUEST_IP_PREFIX:-192.168.100.}"
local timeout_seconds="${LAB_PIMOX_GUEST_TIMEOUT_SECONDS:-3600}" 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 spec_file="${REPO_ROOT}/.lab/pimox-workers.tsv"
local var_file="${REPO_ROOT}/.lab/cluster-workers.auto.tfvars.json" local var_file="${REPO_ROOT}/.lab/cluster-workers.auto.tfvars.json"
local index local index
@ -1948,6 +1949,14 @@ run_pimox_pipeline() {
echo "Pimox template and worker CPU and memory values must be greater than zero." >&2 echo "Pimox template and worker CPU and memory values must be greater than zero." >&2
exit 1 exit 1
fi 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 if ! truthy "${worker_replace_existing}" && ! disabled_value "${worker_replace_existing}"; then
echo "LAB_PIMOX_WORKER_REPLACE_EXISTING must be true or false." >&2 echo "LAB_PIMOX_WORKER_REPLACE_EXISTING must be true or false." >&2
exit 1 exit 1
@ -2065,7 +2074,7 @@ fi" 2>&1)"
"${worker_user}" \ "${worker_user}" \
"${worker_key_path}" \ "${worker_key_path}" \
"${ip_prefix}" \ "${ip_prefix}" \
"${timeout_seconds}" \ "${worker_wait_timeout_seconds}" \
"${qm_bin}" \ "${qm_bin}" \
"${worker_storage}" \ "${worker_storage}" \
"${worker_replace_existing}" \ "${worker_replace_existing}" \