From 0839299bd493b68b0630221cf258a55da7bc7676 Mon Sep 17 00:00:00 2001 From: Markus Hilger Date: Sun, 1 Nov 2026 12:01:47 +0100 Subject: [PATCH] Fall back to other managers for untethered images An untethered or uncompressed diskless boot downloaded the root image only from the deployment server and retried it forever when that server failed. Try the other managers that answered discovery as well, as the tethered urlmount already does. urlmount limits each small range request to 10 seconds, but the single whole-image download cannot take a total limit. Give up on a connect after 10 seconds and on a transfer that stalls for 30 seconds instead, so a hung server moves on to the next one. --- .../el10-diskless/profiles/default/scripts/imageboot.sh | 3 ++- .../el7-diskless/profiles/default/scripts/imageboot.sh | 3 ++- .../el8-diskless/profiles/default/scripts/imageboot.sh | 3 ++- .../el9-diskless/profiles/default/scripts/imageboot.sh | 3 ++- .../suse15-diskless/profiles/default/scripts/imageboot.sh | 3 ++- .../suse16-diskless/profiles/default/scripts/imageboot.sh | 3 ++- .../ubuntu20.04-diskless/profiles/default/scripts/imageboot.sh | 3 ++- 7 files changed, 14 insertions(+), 7 deletions(-) diff --git a/confluent_osdeploy/el10-diskless/profiles/default/scripts/imageboot.sh b/confluent_osdeploy/el10-diskless/profiles/default/scripts/imageboot.sh index 988cc9f8..7c28ef55 100644 --- a/confluent_osdeploy/el10-diskless/profiles/default/scripts/imageboot.sh +++ b/confluent_osdeploy/el10-diskless/profiles/default/scripts/imageboot.sh @@ -13,7 +13,8 @@ fi set_selinux_context system_u:object_r:bin_t:s0 /opt/confluent/bin/urlmount if [ "untethered" = "$imagemethod" -o "uncompressed" = "$imagemethod" ]; then mount -t tmpfs untethered /mnt/remoteimg - while ! curl -f https://$confluent_whost/confluent-public/os/$confluent_profile/rootimg.sfs -o /mnt/remoteimg/rootimg.sfs; do + # Fall back to the other managers when the deployment server fails + while ! for url in https://$confluent_whost/confluent-public/os/$confluent_profile/rootimg.sfs $confluent_urls; do curl -f --connect-timeout 10 --speed-limit 1 --speed-time 30 $url -o /mnt/remoteimg/rootimg.sfs && break; done; do echo "Failed downloading image, retrying..." sleep $((RANDOM%3)).$((RANDOM)) done diff --git a/confluent_osdeploy/el7-diskless/profiles/default/scripts/imageboot.sh b/confluent_osdeploy/el7-diskless/profiles/default/scripts/imageboot.sh index ff254d2c..b387aad5 100644 --- a/confluent_osdeploy/el7-diskless/profiles/default/scripts/imageboot.sh +++ b/confluent_osdeploy/el7-diskless/profiles/default/scripts/imageboot.sh @@ -2,7 +2,8 @@ mkdir -p /mnt/remoteimg /mnt/remote /mnt/overlay if [ "untethered" = "$(getarg confluent_imagemethod)" ]; then mount -t tmpfs untethered /mnt/remoteimg - while ! curl -f https://$confluent_mgr/confluent-public/os/$confluent_profile/rootimg.sfs -o /mnt/remoteimg/rootimg.sfs; do + # Fall back to the other managers when the deployment server fails + while ! for url in https://$confluent_mgr/confluent-public/os/$confluent_profile/rootimg.sfs $confluent_urls; do curl -f --connect-timeout 10 --speed-limit 1 --speed-time 30 $url -o /mnt/remoteimg/rootimg.sfs && break; done; do echo "Failed downloading image, retrying..." sleep $((RANDOM%3)).$((RANDOM)) done diff --git a/confluent_osdeploy/el8-diskless/profiles/default/scripts/imageboot.sh b/confluent_osdeploy/el8-diskless/profiles/default/scripts/imageboot.sh index 481edf80..d9898e80 100644 --- a/confluent_osdeploy/el8-diskless/profiles/default/scripts/imageboot.sh +++ b/confluent_osdeploy/el8-diskless/profiles/default/scripts/imageboot.sh @@ -7,7 +7,8 @@ mkdir -p /mnt/remoteimg /mnt/remote /mnt/overlay TETHERED=0 if [ "untethered" = "$(getarg confluent_imagemethod)" ]; then mount -t tmpfs untethered /mnt/remoteimg - while ! curl -f https://$confluent_whost/confluent-public/os/$confluent_profile/rootimg.sfs -o /mnt/remoteimg/rootimg.sfs; do + # Fall back to the other managers when the deployment server fails + while ! for url in https://$confluent_whost/confluent-public/os/$confluent_profile/rootimg.sfs $confluent_urls; do curl -f --connect-timeout 10 --speed-limit 1 --speed-time 30 $url -o /mnt/remoteimg/rootimg.sfs && break; done; do echo "Failed downloading image, retrying..." sleep $((RANDOM%3)).$((RANDOM)) done diff --git a/confluent_osdeploy/el9-diskless/profiles/default/scripts/imageboot.sh b/confluent_osdeploy/el9-diskless/profiles/default/scripts/imageboot.sh index 7900cd96..dba2a17d 100644 --- a/confluent_osdeploy/el9-diskless/profiles/default/scripts/imageboot.sh +++ b/confluent_osdeploy/el9-diskless/profiles/default/scripts/imageboot.sh @@ -12,7 +12,8 @@ if grep installtodisk /proc/cmdline > /dev/null; then fi if [ "untethered" = "$imagemethod" -o "uncompressed" = "$imagemethod" ]; then mount -t tmpfs untethered /mnt/remoteimg - while ! curl -f https://$confluent_whost/confluent-public/os/$confluent_profile/rootimg.sfs -o /mnt/remoteimg/rootimg.sfs; do + # Fall back to the other managers when the deployment server fails + while ! for url in https://$confluent_whost/confluent-public/os/$confluent_profile/rootimg.sfs $confluent_urls; do curl -f --connect-timeout 10 --speed-limit 1 --speed-time 30 $url -o /mnt/remoteimg/rootimg.sfs && break; done; do echo "Failed downloading image, retrying..." sleep $((RANDOM%3)).$((RANDOM)) done diff --git a/confluent_osdeploy/suse15-diskless/profiles/default/scripts/imageboot.sh b/confluent_osdeploy/suse15-diskless/profiles/default/scripts/imageboot.sh index 79fc55e5..7be5223b 100644 --- a/confluent_osdeploy/suse15-diskless/profiles/default/scripts/imageboot.sh +++ b/confluent_osdeploy/suse15-diskless/profiles/default/scripts/imageboot.sh @@ -2,7 +2,8 @@ mkdir -p /mnt/remoteimg /mnt/remote /mnt/overlay if [ "untethered" = "$(getarg confluent_imagemethod)" ]; then mount -t tmpfs untethered /mnt/remoteimg - while ! curl -f https://$confluent_mgr/confluent-public/os/$confluent_profile/rootimg.sfs -o /mnt/remoteimg/rootimg.sfs; do + # Fall back to the other managers when the deployment server fails + while ! for url in https://$confluent_mgr/confluent-public/os/$confluent_profile/rootimg.sfs $confluent_urls; do curl -f --connect-timeout 10 --speed-limit 1 --speed-time 30 $url -o /mnt/remoteimg/rootimg.sfs && break; done; do echo "Failed downloading image, retrying..." sleep $((RANDOM%3)).$((RANDOM)) done diff --git a/confluent_osdeploy/suse16-diskless/profiles/default/scripts/imageboot.sh b/confluent_osdeploy/suse16-diskless/profiles/default/scripts/imageboot.sh index 7add1718..774d345b 100644 --- a/confluent_osdeploy/suse16-diskless/profiles/default/scripts/imageboot.sh +++ b/confluent_osdeploy/suse16-diskless/profiles/default/scripts/imageboot.sh @@ -2,7 +2,8 @@ mkdir -p /mnt/remoteimg /mnt/remote /mnt/overlay if [ "untethered" = "$(getarg confluent_imagemethod)" ]; then mount -t tmpfs untethered /mnt/remoteimg - while ! curl -f https://$confluent_mgr/confluent-public/os/$confluent_profile/rootimg.sfs -o /mnt/remoteimg/rootimg.sfs; do + # Fall back to the other managers when the deployment server fails + while ! for url in https://$confluent_mgr/confluent-public/os/$confluent_profile/rootimg.sfs $confluent_urls; do curl -f --connect-timeout 10 --speed-limit 1 --speed-time 30 $url -o /mnt/remoteimg/rootimg.sfs && break; done; do echo "Failed downloading image, retrying..." sleep $((RANDOM%3)).$((RANDOM)) done diff --git a/confluent_osdeploy/ubuntu20.04-diskless/profiles/default/scripts/imageboot.sh b/confluent_osdeploy/ubuntu20.04-diskless/profiles/default/scripts/imageboot.sh index 8efdef16..f5002eb0 100644 --- a/confluent_osdeploy/ubuntu20.04-diskless/profiles/default/scripts/imageboot.sh +++ b/confluent_osdeploy/ubuntu20.04-diskless/profiles/default/scripts/imageboot.sh @@ -34,7 +34,8 @@ TETHERED=1 if [ "$imagemethod" != tethered ]; then TETHERED=0 mount -t tmpfs untethered /mnt/remoteimg - while ! curl -f https://$confluent_mgr/confluent-public/os/$confluent_profile/rootimg.sfs -o /mnt/remoteimg/rootimg.sfs; do + # Fall back to the other managers when the deployment server fails + while ! for url in https://$confluent_mgr/confluent-public/os/$confluent_profile/rootimg.sfs $confluent_urls; do curl -f --connect-timeout 10 --speed-limit 1 --speed-time 30 $url -o /mnt/remoteimg/rootimg.sfs && break; done; do echo "Failed downloading image, retrying..." sleep $((RANDOM%3)).$((RANDOM)) done