Compare commits

..

No commits in common. "e8b9b57d77856326335bdccc46e147304102d37c" and "0cda6573ad9f74e3a7dafdadeed88e9366619a6f" have entirely different histories.

6 changed files with 41 additions and 57 deletions

View File

@ -734,19 +734,19 @@ qemu-guest-agent. Static mode uses
`LAB_PIMOX_WORKER_STATIC_IPS="192.168.100.66 192.168.100.67 192.168.100.76"`, `LAB_PIMOX_WORKER_STATIC_IPS="192.168.100.66 192.168.100.67 192.168.100.76"`,
`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"`. `LAB_PIMOX_WORKER_DNS_SERVERS="192.168.100.89 1.1.1.1"`.
Worker NIC MAC addresses default to the VMID-derived deterministic format used Worker NIC MAC addresses are also auto-generated by Pimox by default. Set
by the original working Pimox worker path. Set `LAB_PIMOX_WORKER_MAC_MODE=auto` `LAB_PIMOX_WORKER_MAC_MODE=deterministic` only when you explicitly need stable
only when you explicitly want Pimox to generate the MAC. MAC addresses derived from VM IDs.
Worker creation fails faster than template creation: static guest-network Worker creation fails faster than template creation: static guest-network
configuration waits up to `LAB_PIMOX_GUEST_AGENT_CONFIG_TIMEOUT_SECONDS=120`, 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`, 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=600`. and SSH after an IP appears waits up to `LAB_PIMOX_GUEST_SSH_TIMEOUT_SECONDS=180`.
After static network assignment, the guest must ping the gateway and After static network assignment, the guest must ping the gateway and
`${LAB_PIMOX_WORKER_LAN_PROBE_HOST:-LAB_DEBIAN_LAN_IP}`; set `${LAB_PIMOX_WORKER_LAN_PROBE_HOST:-LAB_DEBIAN_LAN_IP}`; set
`LAB_PIMOX_WORKER_REQUIRE_LAN_PROBE=false` only when ICMP is blocked. After `LAB_PIMOX_WORKER_REQUIRE_LAN_PROBE=false` only when ICMP is blocked. After
qemu-guest-agent reports an IP, Debian skips the extra ICMP host probe by qemu-guest-agent reports an IP, Debian must be able to ping the worker before
default and lets SSH be the reachability check. Set SSH retries continue; set `LAB_PIMOX_WORKER_REQUIRE_HOST_PROBE=false` only when
`LAB_PIMOX_WORKER_REQUIRE_HOST_PROBE=true` only when you want a faster ICMP gate. worker ICMP is intentionally blocked.
`LAB_PIMOX_GUEST_TIMEOUT_SECONDS` remains the broader template-build timeout. `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

View File

@ -734,19 +734,19 @@ qemu-guest-agent. Static mode uses
`LAB_PIMOX_WORKER_STATIC_IPS="192.168.100.66 192.168.100.67 192.168.100.76"`, `LAB_PIMOX_WORKER_STATIC_IPS="192.168.100.66 192.168.100.67 192.168.100.76"`,
`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"`. `LAB_PIMOX_WORKER_DNS_SERVERS="192.168.100.89 1.1.1.1"`.
Worker NIC MAC addresses default to the VMID-derived deterministic format used Worker NIC MAC addresses are also auto-generated by Pimox by default. Set
by the original working Pimox worker path. Set `LAB_PIMOX_WORKER_MAC_MODE=auto` `LAB_PIMOX_WORKER_MAC_MODE=deterministic` only when you explicitly need stable
only when you explicitly want Pimox to generate the MAC. MAC addresses derived from VM IDs.
Worker creation fails faster than template creation: static guest-network Worker creation fails faster than template creation: static guest-network
configuration waits up to `LAB_PIMOX_GUEST_AGENT_CONFIG_TIMEOUT_SECONDS=120`, 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`, 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=600`. and SSH after an IP appears waits up to `LAB_PIMOX_GUEST_SSH_TIMEOUT_SECONDS=180`.
After static network assignment, the guest must ping the gateway and After static network assignment, the guest must ping the gateway and
`${LAB_PIMOX_WORKER_LAN_PROBE_HOST:-LAB_DEBIAN_LAN_IP}`; set `${LAB_PIMOX_WORKER_LAN_PROBE_HOST:-LAB_DEBIAN_LAN_IP}`; set
`LAB_PIMOX_WORKER_REQUIRE_LAN_PROBE=false` only when ICMP is blocked. After `LAB_PIMOX_WORKER_REQUIRE_LAN_PROBE=false` only when ICMP is blocked. After
qemu-guest-agent reports an IP, Debian skips the extra ICMP host probe by qemu-guest-agent reports an IP, Debian must be able to ping the worker before
default and lets SSH be the reachability check. Set SSH retries continue; set `LAB_PIMOX_WORKER_REQUIRE_HOST_PROBE=false` only when
`LAB_PIMOX_WORKER_REQUIRE_HOST_PROBE=true` only when you want a faster ICMP gate. worker ICMP is intentionally blocked.
`LAB_PIMOX_GUEST_TIMEOUT_SECONDS` remains the broader template-build timeout. `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

View File

@ -148,20 +148,20 @@ reservations are not available: set `LAB_PIMOX_WORKER_NETWORK_MODE=static`,
`LAB_PIMOX_WORKER_STATIC_IPS="192.168.100.66 192.168.100.67 192.168.100.76"`, `LAB_PIMOX_WORKER_STATIC_IPS="192.168.100.66 192.168.100.67 192.168.100.76"`,
`LAB_PIMOX_WORKER_GATEWAY=192.168.100.1`, `LAB_PIMOX_WORKER_INTERFACE=enp0s18`, `LAB_PIMOX_WORKER_GATEWAY=192.168.100.1`, `LAB_PIMOX_WORKER_INTERFACE=enp0s18`,
and `LAB_PIMOX_WORKER_DNS_SERVERS="192.168.100.89 1.1.1.1"`. and `LAB_PIMOX_WORKER_DNS_SERVERS="192.168.100.89 1.1.1.1"`.
Worker NIC MAC addresses default to the VMID-derived deterministic format used Worker NIC MAC addresses are auto-generated by Pimox by default. Set
by the original working Pimox worker path. Set `LAB_PIMOX_WORKER_MAC_MODE=auto` `LAB_PIMOX_WORKER_MAC_MODE=deterministic` only when VMID-derived MAC addresses
only when Pimox-generated MAC addresses are preferred. are required.
Worker clone failures are intentionally faster than template build failures: Worker clone failures are intentionally faster than template build failures:
`LAB_PIMOX_GUEST_AGENT_CONFIG_TIMEOUT_SECONDS=120`, `LAB_PIMOX_GUEST_AGENT_CONFIG_TIMEOUT_SECONDS=120`,
`LAB_PIMOX_WORKER_WAIT_TIMEOUT_SECONDS=600`, and `LAB_PIMOX_WORKER_WAIT_TIMEOUT_SECONDS=600`, and
`LAB_PIMOX_GUEST_SSH_TIMEOUT_SECONDS=600` by default. The broader `LAB_PIMOX_GUEST_SSH_TIMEOUT_SECONDS=180` by default. The broader
`LAB_PIMOX_GUEST_TIMEOUT_SECONDS` still controls template preparation. `LAB_PIMOX_GUEST_TIMEOUT_SECONDS` still controls template preparation.
The static network step also checks guest LAN reachability by pinging the The static network step also checks guest LAN reachability by pinging the
gateway and `${LAB_PIMOX_WORKER_LAN_PROBE_HOST:-LAB_DEBIAN_LAN_IP}`. After gateway and `${LAB_PIMOX_WORKER_LAN_PROBE_HOST:-LAB_DEBIAN_LAN_IP}`. The Debian
qemu-guest-agent reports an IP, Debian skips the extra host-side ICMP probe by host then pings the reported worker IP before continuing SSH retries. Disable
default and lets SSH be the reachability check. Disable the static LAN probe those checks only for ICMP-blocked networks with
with `LAB_PIMOX_WORKER_REQUIRE_LAN_PROBE=false`; enable the host-side ICMP gate `LAB_PIMOX_WORKER_REQUIRE_LAN_PROBE=false` or
with `LAB_PIMOX_WORKER_REQUIRE_HOST_PROBE=true`. `LAB_PIMOX_WORKER_REQUIRE_HOST_PROBE=false`.
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`,

View File

@ -548,9 +548,8 @@ state.
Jeannie should configure guest static IPs through qemu-guest-agent. Jeannie should configure guest static IPs through qemu-guest-agent.
`LAB_PIMOX_WORKER_MAC_MODE` `LAB_PIMOX_WORKER_MAC_MODE`
: Worker NIC MAC mode. Defaults to `deterministic`, deriving MAC addresses from : Worker NIC MAC mode. Defaults to `auto`, letting Pimox generate the MAC. Set
VM IDs to match the original working Pimox worker path. Set to `auto` to let to `deterministic` to derive MAC addresses from VM IDs.
Pimox generate the MAC.
`LAB_PIMOX_WORKER_REQUIRE_LAN_PROBE` `LAB_PIMOX_WORKER_REQUIRE_LAN_PROBE`
: Require the worker guest to ping the LAN gateway and probe host after static : Require the worker guest to ping the LAN gateway and probe host after static
@ -558,7 +557,7 @@ IP assignment. Defaults to `true`.
`LAB_PIMOX_WORKER_REQUIRE_HOST_PROBE` `LAB_PIMOX_WORKER_REQUIRE_HOST_PROBE`
: Require the Debian host to ping the worker IP before waiting for SSH. Defaults : Require the Debian host to ping the worker IP before waiting for SSH. Defaults
to `false`; SSH is the default reachability check. to `true`.
`LAB_SKIP_PREFLIGHT=true` `LAB_SKIP_PREFLIGHT=true`
: Skip preflight checks. Use only for targeted troubleshooting. : Skip preflight checks. Use only for targeted troubleshooting.

35
jeannie
View File

@ -823,8 +823,13 @@ jeannie_step_progress() {
local description="$1" local description="$1"
local step_log="$2" local step_log="$2"
local started_at="$3" local started_at="$3"
local last_line="${4:-}"
local elapsed=$((SECONDS - started_at)) local elapsed=$((SECONDS - started_at))
local last_line=""
if [[ -s "${step_log}" ]]; then
last_line="$(tail -n 1 "${step_log}" 2>/dev/null || true)"
last_line="$(jeannie_compact_text "${last_line}" 88)"
fi
printf '\r' printf '\r'
jeannie_step_prefix "${description}" jeannie_step_prefix "${description}"
@ -836,17 +841,6 @@ jeannie_step_progress() {
printf '\033[K' printf '\033[K'
} }
jeannie_step_latest_progress_line() {
local step_log="$1"
local last_line=""
if [[ -s "${step_log}" ]]; then
last_line="$(tail -n 1 "${step_log}" 2>/dev/null || true)"
last_line="$(jeannie_compact_text "${last_line}" 88)"
fi
printf '%s' "${last_line}"
}
redact_sensitive_output() { redact_sensitive_output() {
sed -E \ sed -E \
-e 's/(GITEA_BOOTSTRAP_PASSWORD=)["'\'']?[^"'\''[:space:]]+["'\'']?/\1[REDACTED]/g' \ -e 's/(GITEA_BOOTSTRAP_PASSWORD=)["'\'']?[^"'\''[:space:]]+["'\'']?/\1[REDACTED]/g' \
@ -868,9 +862,6 @@ run_step() {
local progress_pid local progress_pid
local progress_interval="${JEANNIE_PROGRESS_INTERVAL_SECONDS:-10}" local progress_interval="${JEANNIE_PROGRESS_INTERVAL_SECONDS:-10}"
local started_at local started_at
local current_progress_line=""
local last_progress_line=""
local last_progress_rendered_at=0
shift shift
JEANNIE_STEP_INDEX=$((JEANNIE_STEP_INDEX + 1)) JEANNIE_STEP_INDEX=$((JEANNIE_STEP_INDEX + 1))
@ -903,13 +894,7 @@ run_step() {
while kill -0 "${progress_pid}" >/dev/null 2>&1; do while kill -0 "${progress_pid}" >/dev/null 2>&1; do
sleep "${progress_interval}" sleep "${progress_interval}"
if kill -0 "${progress_pid}" >/dev/null 2>&1; then if kill -0 "${progress_pid}" >/dev/null 2>&1; then
current_progress_line="$(jeannie_step_latest_progress_line "${step_log}")" jeannie_step_progress "${description}" "${step_log}" "${started_at}"
if [[ "${current_progress_line}" != "${last_progress_line}" ]] ||
((SECONDS - last_progress_rendered_at >= 60)); then
jeannie_step_progress "${description}" "${step_log}" "${started_at}" "${current_progress_line}"
last_progress_line="${current_progress_line}"
last_progress_rendered_at="${SECONDS}"
fi
fi fi
done done
wait "${progress_pid}" || true wait "${progress_pid}" || true
@ -1105,11 +1090,11 @@ wait_for_pimox_guest_ssh() {
local last_ssh_output="" local last_ssh_output=""
local last_host_probe_output="" local last_host_probe_output=""
local host_probe_failures=0 local host_probe_failures=0
local require_host_probe="${LAB_PIMOX_WORKER_REQUIRE_HOST_PROBE:-false}" local require_host_probe="${LAB_PIMOX_WORKER_REQUIRE_HOST_PROBE:-true}"
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
@ -1230,7 +1215,7 @@ pimox_worker_static_ip() {
pimox_worker_net0_config() { pimox_worker_net0_config() {
local vmid="$1" local vmid="$1"
local bridge="$2" local bridge="$2"
local mac_mode="${LAB_PIMOX_WORKER_MAC_MODE:-deterministic}" local mac_mode="${LAB_PIMOX_WORKER_MAC_MODE:-auto}"
local mac local mac
case "${mac_mode}" in case "${mac_mode}" in

View File

@ -336,11 +336,11 @@ test_pimox_guest_exec_exitcode_parser() {
assert_command_failure_contains "pimox guest exec rejects invalid JSON" "" pimox_guest_exec_exitcode 'not json' assert_command_failure_contains "pimox guest exec rejects invalid JSON" "" pimox_guest_exec_exitcode 'not json'
} }
test_pimox_worker_net0_config_defaults_to_deterministic_mac() { test_pimox_worker_net0_config_defaults_to_auto_mac() {
unset LAB_PIMOX_WORKER_MAC_MODE unset LAB_PIMOX_WORKER_MAC_MODE
assert_eq "pimox worker net0 defaults to deterministic MAC" "virtio=02:68:10:00:23:32,bridge=vmbr0" "$(pimox_worker_net0_config 9010 vmbr0)" assert_eq "pimox worker net0 defaults to auto MAC" "virtio,bridge=vmbr0" "$(pimox_worker_net0_config 9010 vmbr0)"
LAB_PIMOX_WORKER_MAC_MODE=auto LAB_PIMOX_WORKER_MAC_MODE=deterministic
assert_eq "pimox worker net0 auto MAC opt-in" "virtio,bridge=vmbr0" "$(pimox_worker_net0_config 9010 vmbr0)" assert_eq "pimox worker net0 deterministic MAC opt-in" "virtio=02:68:10:00:23:32,bridge=vmbr0" "$(pimox_worker_net0_config 9010 vmbr0)"
unset LAB_PIMOX_WORKER_MAC_MODE unset LAB_PIMOX_WORKER_MAC_MODE
} }
@ -358,7 +358,7 @@ test_inventory_validator_rejects_ip_drift
test_heal_cooldown_escalates_to_diagnostics test_heal_cooldown_escalates_to_diagnostics
test_pimox_worker_static_ip_selection test_pimox_worker_static_ip_selection
test_pimox_guest_exec_exitcode_parser test_pimox_guest_exec_exitcode_parser
test_pimox_worker_net0_config_defaults_to_deterministic_mac test_pimox_worker_net0_config_defaults_to_auto_mac
if ((FAILURES > 0)); then if ((FAILURES > 0)); then
printf '\n%s unit test(s) failed.\n' "${FAILURES}" >&2 printf '\n%s unit test(s) failed.\n' "${FAILURES}" >&2