Repository navigation
fix(orchestrator): pin etcd disk by serial on diskless control planes - #5805
Open
SOWJANYAJAGADISH123 wants to merge 6 commits into
Open
SOWJANYAJAGADISH123 wants to merge 6 commits into
SOWJANYAJAGADISH123 wants to merge 6 commits into
Conversation
- Updated build_stream_image_tag from 1.2 to 1.3 in deploy_bsm/vars/main.yml - Updated documentation references in docs/architecture.md and docs/contracts/output-contract.md - Built and pushed omnia_build_stream:1.3 to Docker Hub Signed-off-by: SOWJANYAJAGADISH123 <sowjanya.jagadish@dell.com>
On diskless PXE control planes the kernel reorders sdX names across reboots. The etcd mount/prepare scripts selected the disk by device-name scan, so /var/lib/etcd could land on a different physical disk each boot. When the orchestrator is re-run and the node is re-PXE'd, the PKI on NFS is regenerated (new CA) while a stale etcd disk (old CA generation) gets mounted, leaving kube-proxy and Calico unable to verify the API server cert (x509: signed by unknown authority) and the control plane NotReady. Fix: select the etcd disk by its stable serial, recorded in a per-node NFS pin (<mount>/<node_ip>/etcd/etcd-disk.conf): - etcd-disk-setup.sh (prepare, cluster-init only): reuse the pinned serial if present, strip the etcd_data label from any other disk, and write the pin (serial+UUID) after formatting so a fresh etcd always matches the freshly generated CA. - etcd-fstab-update.sh (mount, every boot): mount by pinned serial; drop the device-name scan. Without a pin, adopt the already-mounted or the single etcd_data disk and persist the pin (self-heals existing clusters); refuse to guess when ambiguous. - Identify the partition from the partition table, not an sdX name guess. - Resolve NFS paths from jinja vars instead of a hardcoded server IP. Signed-off-by: SOWJANYAJAGADISH123 <sowjanya.jagadish@dell.com>
SOWJANYAJAGADISH123
requested review from
RvishankarOMnia,
VenkateswaraVatam,
abhishek-sa1,
snarthan and
sujit-jadhav
as code owners
November 13, 2026 12:01
Prevent disk preparation from falling back to device-order scanning when an existing pin is invalid or cannot be resolved. Stop provisioning when the selected disk identity cannot be persisted to NFS, ensuring later boots never continue without a stable pin. Signed-off-by: SOWJANYAJAGADISH123 <sowjanya.jagadish@dell.com>
Add a defensive check before kubeadm init on the control-plane first-boot path. kubeadm init generates a new cluster CA, so etcd must be empty at that point. The init path already reformats the etcd disk and purges state, so this never triggers on a healthy boot and is not reached on reboot. It makes the CA/etcd coupling invariant explicit and fails loudly if a future change ever leaves stale etcd data before init, preventing kube-proxy/calico CA mismatches. Signed-off-by: SOWJANYAJAGADISH123 <sowjanya.jagadish@dell.com>
The adopt-mode branch counted labelled partitions with a bash array-length expansion whose brace-hash sequence is parsed by Jinja as a comment start, breaking rendering of the control-plane metadata template (first-boot) with "Missing end of comment tag". Count the partitions with grep instead so the script templates cleanly. Signed-off-by: SOWJANYAJAGADISH123 <sowjanya.jagadish@dell.com>
Collaborator
Technical review: approveRoot cause confirmed. The etcd disk was chosen by What the PR does
Verified
Before merge (process items)
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On diskless PXE-booted Kubernetes control planes with
etcd_on_local_disk: true, the kernel reorders/dev/sdXnames across reboots. The etcd mount and prepare scripts selected the etcd disk by a device-name scan, so/var/lib/etcdcould land on a different physical disk on each boot.When the orchestrator was re-run and the node re-PXE'd, the PKI on the NFS share was regenerated (new cluster CA) while a stale etcd disk (from an older CA generation) could be mounted. kube-proxy and Calico then failed to verify the API server certificate:
This left the control plane
NotReady, with Calico and CoreDNS stuck inContainerCreating/Init:CrashLoopBackOff. A plain reboot was unaffected because it regenerated neither the CA nor etcd; only an orchestrator re-run exposed the mismatch.Root cause
/dev/sdXordering, not by a stable identifier.etcd-fstab-update.sh, every boot) and the prepare script (etcd-disk-setup.sh, cluster-init) used independent selection logic and could choose different disks.etcd_datalabel, making label- and scan-based selection ambiguous.The certificate error was a downstream symptom of mounting the wrong (stale) etcd disk, not a PKI defect.
Fix
Pin the etcd disk by its stable hardware serial, recorded in a per-node pin file on the NFS share (
<k8s_client_mount_path>/<node_ip>/etcd/etcd-disk.conf, containingETCD_DISK_SERIALandETCD_UUID). Every later boot resolves the same physical disk by serial regardless of how the kernel names it.etcd-disk-setup.sh.j2(prepare, cluster-init path only)/dev/sdXnaming.etcd_datalabel from any other disk so only one etcd disk exists.etcd-fstab-update.sh.j2(mount, every boot)etcd_datapartition), then persist the pin to self-heal clusters provisioned before serial pinning existed. Refuse to guess when the choice is ambiguous.ms-group-service_kube_control_plane_first_x86_64.yaml.j2(control-plane first boot)kubeadm init: refuse to initialize when/var/lib/etcd/memberstill exists.kubeadm initgenerates a new cluster CA, so etcd must be empty at that point. The init path already reformats the disk and purges state, so this never triggers on a healthy boot and is not reached on reboot. It makes the "new CA implies fresh etcd" invariant explicit and fails loudly if a future change ever regresses it.Behavior by scenario
kubeadm initcreates matching CA + etcdsdXreorderWhy this does not break existing paths
kubeadm initguard only runs on the first-boot path, where etcd is already formatted and purged, so it passes; it is never reached on reboot.Test plan
bash -n.sdaandsdb.git diff --check(no whitespace errors).Ready.findmnt /var/lib/etcdserial matches the pin even whensdXnames change.Ready.lsblk -dno SERIALreturns a non-empty, unique value for each etcd disk on the target nodes.Notes / follow-ups