feat(hcloud): OSDs on the local system disk, no Hetzner volumes
The project's volume quota is 1024 GB, short of three OSD volumes sized for the restored data. cpx62 carries 640 GB of local NVMe: EPHEMERAL is capped at 100GiB and the OSD takes a raw partition of at least 400GiB on the system disk. The harness creates Hetzner volumes only for raw volumes off the system disk. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+10
-7
@@ -442,7 +442,7 @@ hcloud_volumes_for_node() {
|
||||
gib=${size%GiB}
|
||||
[[ "$gib" =~ ^[0-9]+$ ]] || fail "$patch: cannot read volume size '$size' — state it as <n>GiB"
|
||||
echo $(( (gib * 1074 + 999) / 1000 ))
|
||||
done < <(yq -r 'select(.kind == "RawVolumeConfig") | .provisioning.minSize' "$patch")
|
||||
done < <(yq -r 'select(.kind == "RawVolumeConfig" and .provisioning.diskSelector.match != "system_disk") | .provisioning.minSize' "$patch")
|
||||
}
|
||||
|
||||
# Deletes everything this phase created, and NOTHING else.
|
||||
@@ -795,13 +795,16 @@ if [[ "$PHASE" == "hcloudtest" ]]; then
|
||||
hcloud volume delete "$n-osd" >/dev/null \
|
||||
|| fail "could not delete the previous OSD volume for $n"
|
||||
fi
|
||||
# A raw volume on the system disk needs no Hetzner volume.
|
||||
vol_size=$(hcloud_volumes_for_node "$n")
|
||||
[[ -n "$vol_size" ]] || fail "$n declares no RawVolumeConfig — a node with no OSD device is not this cluster's shape"
|
||||
hcloud volume create --name "$n-osd" --size "$vol_size" --server "$n" \
|
||||
--label "$HCLOUD_LABEL" >/dev/null \
|
||||
|| fail "could not create the OSD volume for $n"
|
||||
|
||||
echo " $n at $addr, with a ${vol_size}GB OSD volume"
|
||||
if [[ -n "$vol_size" ]]; then
|
||||
hcloud volume create --name "$n-osd" --size "$vol_size" --server "$n" \
|
||||
--label "$HCLOUD_LABEL" >/dev/null \
|
||||
|| fail "could not create the OSD volume for $n"
|
||||
echo " $n at $addr, with a ${vol_size}GB OSD volume"
|
||||
else
|
||||
echo " $n at $addr, OSD on the system disk"
|
||||
fi
|
||||
NODE_ADDRS+=("$addr")
|
||||
done
|
||||
ok
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
# underlay network instead of VLANs, because Hetzner networks are layer 3.
|
||||
# Private keys and peers are generated per run by bootstrap.sh hcloudtest.
|
||||
#
|
||||
# enp1s0 is the public NIC, enp7s0 the underlay.
|
||||
# enp1s0 is the public NIC, enp7s0 the underlay. The OSD takes a partition
|
||||
# on the local system disk; EPHEMERAL is capped to leave it room.
|
||||
machine:
|
||||
install:
|
||||
disk: /dev/sda
|
||||
@@ -101,10 +102,17 @@ addresses:
|
||||
- address: fd02:47::11/64
|
||||
---
|
||||
apiVersion: v1alpha1
|
||||
kind: VolumeConfig
|
||||
name: EPHEMERAL
|
||||
provisioning:
|
||||
maxSize: 100GiB
|
||||
grow: false
|
||||
---
|
||||
apiVersion: v1alpha1
|
||||
kind: RawVolumeConfig
|
||||
name: osd-data
|
||||
provisioning:
|
||||
diskSelector:
|
||||
match: '!system_disk'
|
||||
match: system_disk
|
||||
minSize: 400GiB
|
||||
grow: true
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
# underlay network instead of VLANs, because Hetzner networks are layer 3.
|
||||
# Private keys and peers are generated per run by bootstrap.sh hcloudtest.
|
||||
#
|
||||
# enp1s0 is the public NIC, enp7s0 the underlay.
|
||||
# enp1s0 is the public NIC, enp7s0 the underlay. The OSD takes a partition
|
||||
# on the local system disk; EPHEMERAL is capped to leave it room.
|
||||
machine:
|
||||
install:
|
||||
disk: /dev/sda
|
||||
@@ -101,10 +102,17 @@ addresses:
|
||||
- address: fd02:47::12/64
|
||||
---
|
||||
apiVersion: v1alpha1
|
||||
kind: VolumeConfig
|
||||
name: EPHEMERAL
|
||||
provisioning:
|
||||
maxSize: 100GiB
|
||||
grow: false
|
||||
---
|
||||
apiVersion: v1alpha1
|
||||
kind: RawVolumeConfig
|
||||
name: osd-data
|
||||
provisioning:
|
||||
diskSelector:
|
||||
match: '!system_disk'
|
||||
match: system_disk
|
||||
minSize: 400GiB
|
||||
grow: true
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
# underlay network instead of VLANs, because Hetzner networks are layer 3.
|
||||
# Private keys and peers are generated per run by bootstrap.sh hcloudtest.
|
||||
#
|
||||
# enp1s0 is the public NIC, enp7s0 the underlay.
|
||||
# enp1s0 is the public NIC, enp7s0 the underlay. The OSD takes a partition
|
||||
# on the local system disk; EPHEMERAL is capped to leave it room.
|
||||
machine:
|
||||
install:
|
||||
disk: /dev/sda
|
||||
@@ -101,10 +102,17 @@ addresses:
|
||||
- address: fd02:47::13/64
|
||||
---
|
||||
apiVersion: v1alpha1
|
||||
kind: VolumeConfig
|
||||
name: EPHEMERAL
|
||||
provisioning:
|
||||
maxSize: 100GiB
|
||||
grow: false
|
||||
---
|
||||
apiVersion: v1alpha1
|
||||
kind: RawVolumeConfig
|
||||
name: osd-data
|
||||
provisioning:
|
||||
diskSelector:
|
||||
match: '!system_disk'
|
||||
match: system_disk
|
||||
minSize: 400GiB
|
||||
grow: true
|
||||
|
||||
Reference in New Issue
Block a user