From 7a985791594a31520553da67a7d18bccb4bcc425 Mon Sep 17 00:00:00 2001 From: Leonhardt Wille Date: Mon, 16 Nov 2026 13:59:01 +0100 Subject: [PATCH 1/3] chore(changelog) --- changelog.d/5-bug-fixes/fix-unavailable-server-types | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/5-bug-fixes/fix-unavailable-server-types diff --git a/changelog.d/5-bug-fixes/fix-unavailable-server-types b/changelog.d/5-bug-fixes/fix-unavailable-server-types new file mode 100644 index 000000000..0f6a76938 --- /dev/null +++ b/changelog.d/5-bug-fixes/fix-unavailable-server-types @@ -0,0 +1 @@ +Fixed: subsequent provisioning retries with changed server_type will not automatically tear down already deployed machines From f57ebf130dd67023ef6804d0b7154369f2436dea Mon Sep 17 00:00:00 2001 From: Leonhardt Wille Date: Mon, 16 Nov 2026 16:47:39 +0100 Subject: [PATCH 2/3] fix(CO-67): retry Hetzner VMs without tearing down the location cx* server types are no longer offered in any EU location, and hel1 lacks cpx52/62. Use the same matrix in cd.sh and cd_staging.sh with cpx types first and dedicated ccx types as fallback, and restore LOCATIONS in cd.sh. Only run terraform destroy once all server type pairs of a location are exhausted. Within a location, already provisioned servers are kept (server_type is ignored on them) and only missing ones are created with the next pair. Also add the missing ignore_changes on the staging datanode. --- changelog.d/5-bug-fixes/hetzner-retry-matrix | 1 + offline/cd.sh | 22 +++++++++++++------ offline/cd_staging.sh | 18 ++++++++++----- .../examples/wiab-staging-hetzner/main.tf | 3 +++ 4 files changed, 32 insertions(+), 12 deletions(-) create mode 100644 changelog.d/5-bug-fixes/hetzner-retry-matrix diff --git a/changelog.d/5-bug-fixes/hetzner-retry-matrix b/changelog.d/5-bug-fixes/hetzner-retry-matrix new file mode 100644 index 000000000..47942afc7 --- /dev/null +++ b/changelog.d/5-bug-fixes/hetzner-retry-matrix @@ -0,0 +1 @@ +Fixed: Hetzner CD retry matrix only uses server types offered in EU locations (ccx as fallback) and only tears down provisioned machines when moving on to the next location diff --git a/offline/cd.sh b/offline/cd.sh index a67e9f211..0d5822f30 100755 --- a/offline/cd.sh +++ b/offline/cd.sh @@ -11,11 +11,15 @@ COMMIT_HASH="${GITHUB_SHA}" ARTIFACT="wire-server-deploy-static-${COMMIT_HASH}" # Retry matrix -# Locations are tried in order and exhaust all server types before moving on. +# Locations are tried in order and exhaust all server type pairs before moving on. # Prefer hel1: German locations rarely have capacity. -LOCATIONS=("hel1" "fsn1" "nbg1") -SMALL_SERVER_TYPES=("cx23" "cx33" "cpx22") -MEDIUM_SERVER_TYPES=("cx33" "cx43" "cpx32") +# Pairs (small/medium) are matched by index. cx* types are currently not offered +# in any EU location, so dedicated ccx types serve as fallback. +# Servers use lifecycle.ignore_changes = [server_type], so on retry only servers +# that failed to be created pick up the next pair; existing ones are kept. +LOCATIONS=("hel1" "nbg1" "fsn1") +SMALL_SERVER_TYPES=("cpx22" "cpx32" "ccx13" "ccx23") +MEDIUM_SERVER_TYPES=("cpx42" "cpx42" "ccx23" "ccx33") # Retry configuration RETRY_DELAY=30 @@ -100,8 +104,12 @@ for location_index in $(seq 0 $((location_count - 1))); do if [[ $attempt -lt $MAX_RETRIES ]]; then echo "Will retry with the next location and server type combination..." - echo "Cleaning up partial deployment..." - terraform destroy -auto-approve || true + # Keep already provisioned servers while retrying within a location; + # only tear down when moving on to the next location. + if [[ $server_type_index -eq $((server_type_count - 1)) ]]; then + echo "Location ${attempt_location} exhausted, cleaning up partial deployment..." + terraform destroy -auto-approve || true + fi echo "Waiting ${RETRY_DELAY}s for resources to become available..." sleep $RETRY_DELAY @@ -143,7 +151,7 @@ rm -f ssh_private_key || true echo "$ssh_private_key" > ssh_private_key chmod 400 ssh_private_key -# TO-DO: make changes to test the deployment with demo user in +# TO-DO: make changes to test the deployment with demo user in terraform output -json static-inventory > inventory.json yq eval -o=yaml '.' inventory.json > inventory.yml diff --git a/offline/cd_staging.sh b/offline/cd_staging.sh index dc344a4db..d8ddb77a8 100755 --- a/offline/cd_staging.sh +++ b/offline/cd_staging.sh @@ -10,11 +10,15 @@ COMMIT_HASH="${GITHUB_SHA}" ARTIFACT="wire-server-deploy-static-${COMMIT_HASH}" # Retry matrix -# Locations are tried in order and exhaust all server types before moving on. +# Locations are tried in order and exhaust all server type pairs before moving on. # Prefer hel1: German locations rarely have capacity. +# Pairs (small/medium) are matched by index. cx* types are currently not offered +# in any EU location, so dedicated ccx types serve as fallback. +# Servers use lifecycle.ignore_changes = [server_type], so on retry only servers +# that failed to be created pick up the next pair; existing ones are kept. LOCATIONS=("hel1" "nbg1" "fsn1") -SMALL_SERVER_TYPES=("cpx22" "cpx32" "cpx42") -MEDIUM_SERVER_TYPES=("cpx42" "cpx52" "cpx62") +SMALL_SERVER_TYPES=("cpx22" "cpx32" "ccx13" "ccx23") +MEDIUM_SERVER_TYPES=("cpx42" "cpx42" "ccx23" "ccx33") # Retry configuration RETRY_DELAY=30 @@ -100,8 +104,12 @@ for location_index in $(seq 0 $((location_count - 1))); do if [[ $attempt -lt $MAX_RETRIES ]]; then echo "Will retry with the next location and server type combination..." - echo "Cleaning up partial deployment..." - terraform destroy -auto-approve || true + # Keep already provisioned servers while retrying within a location; + # only tear down when moving on to the next location. + if [[ $server_type_index -eq $((server_type_count - 1)) ]]; then + echo "Location ${attempt_location} exhausted, cleaning up partial deployment..." + terraform destroy -auto-approve || true + fi echo "Waiting ${RETRY_DELAY}s for resources to become available..." sleep $RETRY_DELAY diff --git a/terraform/examples/wiab-staging-hetzner/main.tf b/terraform/examples/wiab-staging-hetzner/main.tf index 5b4f1688a..01094e2eb 100644 --- a/terraform/examples/wiab-staging-hetzner/main.tf +++ b/terraform/examples/wiab-staging-hetzner/main.tf @@ -221,4 +221,7 @@ resource "hcloud_server" "datanode" { network_id = hcloud_network.main.id ip = "" } + lifecycle { + ignore_changes = [server_type] + } } From 529ec0d51fc5163cde83fff13797b4a13c186b67 Mon Sep 17 00:00:00 2001 From: Leonhardt Wille Date: Mon, 16 Nov 2026 16:48:35 +0100 Subject: [PATCH 3/3] fix(CO-67): apply Hetzner retry fixes to demo CD cx53 is not offered in any EU location and hel1 lacks cpx62. Use cpx62 with the dedicated ccx43 (same 16 vCPU) as fallback, align the location order with the other CD scripts, and only destroy once a location is exhausted. --- offline/cd_demo.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/offline/cd_demo.sh b/offline/cd_demo.sh index 2ce41674a..297299316 100755 --- a/offline/cd_demo.sh +++ b/offline/cd_demo.sh @@ -18,8 +18,10 @@ COMMIT_HASH="${GITHUB_SHA}" # Retry matrix # Locations are tried in order and exhaust all server types before moving on. # Prefer hel1: German locations rarely have capacity. -LOCATIONS=("hel1" "fsn1" "nbg1") -SERVER_TYPES=("cx53" "cpx62") +# cx* types are currently not offered in any EU location and hel1 lacks cpx62, +# so the dedicated ccx43 (16 vCPU) serves as fallback. +LOCATIONS=("hel1" "nbg1" "fsn1") +SERVER_TYPES=("cpx62" "ccx43") # Retry configuration RETRY_DELAY=30 @@ -89,8 +91,12 @@ for location_index in $(seq 0 $((location_count - 1))); do fi if [[ $attempt -lt $MAX_RETRIES ]]; then - echo "Cleaning up partial deployment..." - terraform destroy -auto-approve || true + # Keep already provisioned resources while retrying within a location; + # only tear down when moving on to the next location. + if [[ $server_type_index -eq $((server_type_count - 1)) ]]; then + echo "Location ${attempt_location} exhausted, cleaning up partial deployment..." + terraform destroy -auto-approve || true + fi echo "Waiting ${RETRY_DELAY}s for resources to become available..." sleep $RETRY_DELAY