Skip to content

Commit bcd4209

Browse files
committed
guestfs: increase SSH config timeout for Fedora on Debian hosts
Fedora guests running on Debian hosts timeout after 60 seconds while waiting for network configuration during first boot. The 60-second timeout is insufficient due to slower boot times caused by SELinux permissive mode initialization on non-SELinux hosts. Increase the default timeout from 60 to 180 seconds to accommodate Fedora boot times. Make the timeout configurable via KDEVOPS_SSH_CONFIG_TIMEOUT environment variable for flexibility in different environments. Improve the error message to include the configured timeout value and suggest using 'virsh console' for boot diagnostics. Generated-by: Claude AI Signed-off-by: Daniel Gomez <[email protected]>
1 parent 2de515b commit bcd4209

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

scripts/update_ssh_config_guestfs.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,15 @@
3333

3434
# We take the first IPv4 address on the first non-loopback interface.
3535
def get_addr(name):
36+
# Timeout increased to 180s to account for slower boot times with Fedora guests
37+
# on Debian hosts (SELinux permissive mode initialization takes longer).
38+
timeout_seconds = int(os.environ.get("KDEVOPS_SSH_CONFIG_TIMEOUT", "180"))
3639
attempt = 0
3740
while True:
3841
attempt += 1
39-
if attempt > 60:
40-
raise Exception(f"Unable to get an address for {name} after 60s")
42+
if attempt > timeout_seconds:
43+
raise Exception(f"Unable to get an address for {name} after {timeout_seconds}s. "
44+
f"VM may be taking longer to boot. Check 'virsh console {name}' for boot status.")
4145

4246
result = subprocess.run(
4347
[

0 commit comments

Comments
 (0)