Skip to content

The only tool you need to know what is happening and how to fix it.

benchmarks in us with proper network zone

ddux046ead00b358
diff --git a/benchmarks/scripts/hetzner-up.sh b/benchmarks/scripts/hetzner-up.sh
index 8c62ccfe..656e2c33 100755
--- a/benchmarks/scripts/hetzner-up.sh
+++ b/benchmarks/scripts/hetzner-up.sh
@@ -26,11 +26,26 @@ NET_NAME="bench-net-${RUN_ID}"
SUT_NAME="bench-sut-${RUN_ID}"
LOADGEN_NAME="bench-loadgen-${RUN_ID}"
+# Hetzner private networks live in a "network zone" that spans several
+# physical locations. A subnet in one zone cannot host servers from another,
+# so the zone must match the LOCATION the servers will be created in.
+# Reference: https://docs.hetzner.cloud/#network-zones
+case "${LOCATION}" in
+ nbg1|fsn1|hel1) NETWORK_ZONE="eu-central" ;;
+ ash) NETWORK_ZONE="us-east" ;;
+ hil) NETWORK_ZONE="us-west" ;;
+ sin) NETWORK_ZONE="ap-southeast" ;;
+ *)
+ echo "unknown location '${LOCATION}', defaulting network-zone to eu-central — fix me if this is wrong" >&2
+ NETWORK_ZONE="eu-central"
+ ;;
+esac
+
# Create a /24 private network so SUT and loadgen can talk over 10.0.0.x.
if ! hcloud network describe "${NET_NAME}" >/dev/null 2>&1; then
- echo "creating network ${NET_NAME}" >&2
+ echo "creating network ${NET_NAME} in zone ${NETWORK_ZONE}" >&2
hcloud network create --name "${NET_NAME}" --ip-range 10.0.0.0/24 >/dev/null
- hcloud network add-subnet "${NET_NAME}" --network-zone eu-central --type cloud --ip-range 10.0.0.0/24 >/dev/null
+ hcloud network add-subnet "${NET_NAME}" --network-zone "${NETWORK_ZONE}" --type cloud --ip-range 10.0.0.0/24 >/dev/null
fi
NET_ID=$(hcloud network describe "${NET_NAME}" -o format='{{.ID}}')