Compare commits
2 Commits
0cda6573ad
...
e8b9b57d77
| Author | SHA1 | Date |
|---|---|---|
|
|
e8b9b57d77 | |
|
|
d80960fce0 |
14
README.md
14
README.md
|
|
@ -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_GATEWAY=192.168.100.1`, and
|
||||
`LAB_PIMOX_WORKER_DNS_SERVERS="192.168.100.89 1.1.1.1"`.
|
||||
Worker NIC MAC addresses are also auto-generated by Pimox by default. Set
|
||||
`LAB_PIMOX_WORKER_MAC_MODE=deterministic` only when you explicitly need stable
|
||||
MAC addresses derived from VM IDs.
|
||||
Worker NIC MAC addresses default to the VMID-derived deterministic format used
|
||||
by the original working Pimox worker path. Set `LAB_PIMOX_WORKER_MAC_MODE=auto`
|
||||
only when you explicitly want Pimox to generate the MAC.
|
||||
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`.
|
||||
and SSH after an IP appears waits up to `LAB_PIMOX_GUEST_SSH_TIMEOUT_SECONDS=600`.
|
||||
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_REQUIRE_LAN_PROBE=false` only when ICMP is blocked. After
|
||||
qemu-guest-agent reports an IP, Debian must be able to ping the worker before
|
||||
SSH retries continue; set `LAB_PIMOX_WORKER_REQUIRE_HOST_PROBE=false` only when
|
||||
worker ICMP is intentionally blocked.
|
||||
qemu-guest-agent reports an IP, Debian skips the extra ICMP host probe by
|
||||
default and lets SSH be the reachability check. Set
|
||||
`LAB_PIMOX_WORKER_REQUIRE_HOST_PROBE=true` only when you want a faster ICMP gate.
|
||||
`LAB_PIMOX_GUEST_TIMEOUT_SECONDS` remains the broader template-build timeout.
|
||||
|
||||
Long-running `./jeannie up` steps keep compact output by default, but
|
||||
|
|
|
|||
|
|
@ -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_GATEWAY=192.168.100.1`, and
|
||||
`LAB_PIMOX_WORKER_DNS_SERVERS="192.168.100.89 1.1.1.1"`.
|
||||
Worker NIC MAC addresses are also auto-generated by Pimox by default. Set
|
||||
`LAB_PIMOX_WORKER_MAC_MODE=deterministic` only when you explicitly need stable
|
||||
MAC addresses derived from VM IDs.
|
||||
Worker NIC MAC addresses default to the VMID-derived deterministic format used
|
||||
by the original working Pimox worker path. Set `LAB_PIMOX_WORKER_MAC_MODE=auto`
|
||||
only when you explicitly want Pimox to generate the MAC.
|
||||
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`.
|
||||
and SSH after an IP appears waits up to `LAB_PIMOX_GUEST_SSH_TIMEOUT_SECONDS=600`.
|
||||
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_REQUIRE_LAN_PROBE=false` only when ICMP is blocked. After
|
||||
qemu-guest-agent reports an IP, Debian must be able to ping the worker before
|
||||
SSH retries continue; set `LAB_PIMOX_WORKER_REQUIRE_HOST_PROBE=false` only when
|
||||
worker ICMP is intentionally blocked.
|
||||
qemu-guest-agent reports an IP, Debian skips the extra ICMP host probe by
|
||||
default and lets SSH be the reachability check. Set
|
||||
`LAB_PIMOX_WORKER_REQUIRE_HOST_PROBE=true` only when you want a faster ICMP gate.
|
||||
`LAB_PIMOX_GUEST_TIMEOUT_SECONDS` remains the broader template-build timeout.
|
||||
|
||||
Long-running `./{{ main_script }} up` steps keep compact output by default, but
|
||||
|
|
|
|||
|
|
@ -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_GATEWAY=192.168.100.1`, `LAB_PIMOX_WORKER_INTERFACE=enp0s18`,
|
||||
and `LAB_PIMOX_WORKER_DNS_SERVERS="192.168.100.89 1.1.1.1"`.
|
||||
Worker NIC MAC addresses are auto-generated by Pimox by default. Set
|
||||
`LAB_PIMOX_WORKER_MAC_MODE=deterministic` only when VMID-derived MAC addresses
|
||||
are required.
|
||||
Worker NIC MAC addresses default to the VMID-derived deterministic format used
|
||||
by the original working Pimox worker path. Set `LAB_PIMOX_WORKER_MAC_MODE=auto`
|
||||
only when Pimox-generated MAC addresses are preferred.
|
||||
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_SSH_TIMEOUT_SECONDS=600` by default. The broader
|
||||
`LAB_PIMOX_GUEST_TIMEOUT_SECONDS` still controls template preparation.
|
||||
The static network step also checks guest LAN reachability by pinging the
|
||||
gateway and `${LAB_PIMOX_WORKER_LAN_PROBE_HOST:-LAB_DEBIAN_LAN_IP}`. The Debian
|
||||
host then pings the reported worker IP before continuing SSH retries. Disable
|
||||
those checks only for ICMP-blocked networks with
|
||||
`LAB_PIMOX_WORKER_REQUIRE_LAN_PROBE=false` or
|
||||
`LAB_PIMOX_WORKER_REQUIRE_HOST_PROBE=false`.
|
||||
gateway and `${LAB_PIMOX_WORKER_LAN_PROBE_HOST:-LAB_DEBIAN_LAN_IP}`. After
|
||||
qemu-guest-agent reports an IP, Debian skips the extra host-side ICMP probe by
|
||||
default and lets SSH be the reachability check. Disable the static LAN probe
|
||||
with `LAB_PIMOX_WORKER_REQUIRE_LAN_PROBE=false`; enable the host-side ICMP gate
|
||||
with `LAB_PIMOX_WORKER_REQUIRE_HOST_PROBE=true`.
|
||||
|
||||
Worker indexes are stable: index `1` maps to VMID `9010`,
|
||||
`pimox-worker-01`, and worker key `pimox01`; index `2` maps to VMID `9011`,
|
||||
|
|
|
|||
|
|
@ -548,8 +548,9 @@ state.
|
|||
Jeannie should configure guest static IPs through qemu-guest-agent.
|
||||
|
||||
`LAB_PIMOX_WORKER_MAC_MODE`
|
||||
: Worker NIC MAC mode. Defaults to `auto`, letting Pimox generate the MAC. Set
|
||||
to `deterministic` to derive MAC addresses from VM IDs.
|
||||
: Worker NIC MAC mode. Defaults to `deterministic`, deriving MAC addresses from
|
||||
VM IDs to match the original working Pimox worker path. Set to `auto` to let
|
||||
Pimox generate the MAC.
|
||||
|
||||
`LAB_PIMOX_WORKER_REQUIRE_LAN_PROBE`
|
||||
: Require the worker guest to ping the LAN gateway and probe host after static
|
||||
|
|
@ -557,7 +558,7 @@ IP assignment. Defaults to `true`.
|
|||
|
||||
`LAB_PIMOX_WORKER_REQUIRE_HOST_PROBE`
|
||||
: Require the Debian host to ping the worker IP before waiting for SSH. Defaults
|
||||
to `true`.
|
||||
to `false`; SSH is the default reachability check.
|
||||
|
||||
`LAB_SKIP_PREFLIGHT=true`
|
||||
: Skip preflight checks. Use only for targeted troubleshooting.
|
||||
|
|
|
|||
35
jeannie
35
jeannie
|
|
@ -823,13 +823,8 @@ jeannie_step_progress() {
|
|||
local description="$1"
|
||||
local step_log="$2"
|
||||
local started_at="$3"
|
||||
local last_line="${4:-}"
|
||||
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'
|
||||
jeannie_step_prefix "${description}"
|
||||
|
|
@ -841,6 +836,17 @@ jeannie_step_progress() {
|
|||
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() {
|
||||
sed -E \
|
||||
-e 's/(GITEA_BOOTSTRAP_PASSWORD=)["'\'']?[^"'\''[:space:]]+["'\'']?/\1[REDACTED]/g' \
|
||||
|
|
@ -862,6 +868,9 @@ run_step() {
|
|||
local progress_pid
|
||||
local progress_interval="${JEANNIE_PROGRESS_INTERVAL_SECONDS:-10}"
|
||||
local started_at
|
||||
local current_progress_line=""
|
||||
local last_progress_line=""
|
||||
local last_progress_rendered_at=0
|
||||
shift
|
||||
|
||||
JEANNIE_STEP_INDEX=$((JEANNIE_STEP_INDEX + 1))
|
||||
|
|
@ -894,7 +903,13 @@ run_step() {
|
|||
while kill -0 "${progress_pid}" >/dev/null 2>&1; do
|
||||
sleep "${progress_interval}"
|
||||
if kill -0 "${progress_pid}" >/dev/null 2>&1; then
|
||||
jeannie_step_progress "${description}" "${step_log}" "${started_at}"
|
||||
current_progress_line="$(jeannie_step_latest_progress_line "${step_log}")"
|
||||
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
|
||||
done
|
||||
wait "${progress_pid}" || true
|
||||
|
|
@ -1090,11 +1105,11 @@ wait_for_pimox_guest_ssh() {
|
|||
local last_ssh_output=""
|
||||
local last_host_probe_output=""
|
||||
local host_probe_failures=0
|
||||
local require_host_probe="${LAB_PIMOX_WORKER_REQUIRE_HOST_PROBE:-true}"
|
||||
local require_host_probe="${LAB_PIMOX_WORKER_REQUIRE_HOST_PROBE:-false}"
|
||||
local next_log
|
||||
local ssh_deadline=0
|
||||
local ssh_output
|
||||
local ssh_timeout_seconds="${LAB_PIMOX_GUEST_SSH_TIMEOUT_SECONDS:-180}"
|
||||
local ssh_timeout_seconds="${LAB_PIMOX_GUEST_SSH_TIMEOUT_SECONDS:-600}"
|
||||
|
||||
ip_filter_description="matching prefix ${ip_prefix}"
|
||||
if [[ -z "${ip_prefix}" ]]; then
|
||||
|
|
@ -1215,7 +1230,7 @@ pimox_worker_static_ip() {
|
|||
pimox_worker_net0_config() {
|
||||
local vmid="$1"
|
||||
local bridge="$2"
|
||||
local mac_mode="${LAB_PIMOX_WORKER_MAC_MODE:-auto}"
|
||||
local mac_mode="${LAB_PIMOX_WORKER_MAC_MODE:-deterministic}"
|
||||
local mac
|
||||
|
||||
case "${mac_mode}" in
|
||||
|
|
|
|||
|
|
@ -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'
|
||||
}
|
||||
|
||||
test_pimox_worker_net0_config_defaults_to_auto_mac() {
|
||||
test_pimox_worker_net0_config_defaults_to_deterministic_mac() {
|
||||
unset LAB_PIMOX_WORKER_MAC_MODE
|
||||
assert_eq "pimox worker net0 defaults to auto MAC" "virtio,bridge=vmbr0" "$(pimox_worker_net0_config 9010 vmbr0)"
|
||||
LAB_PIMOX_WORKER_MAC_MODE=deterministic
|
||||
assert_eq "pimox worker net0 deterministic MAC opt-in" "virtio=02:68:10:00:23:32,bridge=vmbr0" "$(pimox_worker_net0_config 9010 vmbr0)"
|
||||
assert_eq "pimox worker net0 defaults to deterministic MAC" "virtio=02:68:10:00:23:32,bridge=vmbr0" "$(pimox_worker_net0_config 9010 vmbr0)"
|
||||
LAB_PIMOX_WORKER_MAC_MODE=auto
|
||||
assert_eq "pimox worker net0 auto MAC opt-in" "virtio,bridge=vmbr0" "$(pimox_worker_net0_config 9010 vmbr0)"
|
||||
unset LAB_PIMOX_WORKER_MAC_MODE
|
||||
}
|
||||
|
||||
|
|
@ -358,7 +358,7 @@ test_inventory_validator_rejects_ip_drift
|
|||
test_heal_cooldown_escalates_to_diagnostics
|
||||
test_pimox_worker_static_ip_selection
|
||||
test_pimox_guest_exec_exitcode_parser
|
||||
test_pimox_worker_net0_config_defaults_to_auto_mac
|
||||
test_pimox_worker_net0_config_defaults_to_deterministic_mac
|
||||
|
||||
if ((FAILURES > 0)); then
|
||||
printf '\n%s unit test(s) failed.\n' "${FAILURES}" >&2
|
||||
|
|
|
|||
Loading…
Reference in New Issue