2
0
mirror of https://github.com/xcat2/confluent.git synced 2026-11-15 05:18:04 +00:00

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.
This commit is contained in:
Markus Hilger
2026-11-01 12:01:47 +01:00
parent 9186b6418a
commit 0839299bd4
7 changed files with 14 additions and 7 deletions
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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