From 4a21c626c374bc283d05b661df94bff9f6fb691c Mon Sep 17 00:00:00 2001 From: Andrei Kvapil Date: Mon, 16 Nov 2026 03:31:04 -0500 Subject: [PATCH 1/2] fix(linstor-migrate): name every fresh-port warning "no DRBD port" A replica missing from the port map, and a map whose node names match no replica, end in the same one-time fresh port as a definition with no port at all, and spec.drbdPort cannot be changed after apply. The runbooks tell the operator to resolve every "no DRBD port" line, but these two warnings did not carry the phrase, so an operator working from that list could apply with them unresolved. Assisted-by: LLM Signed-off-by: Andrei Kvapil --- docs/linstor-migration.md | 2 +- pkg/linstormigrate/convert.go | 4 ++-- pkg/linstormigrate/convert_test.go | 4 ++-- site/content/en/docs/migration.md | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/linstor-migration.md b/docs/linstor-migration.md index 29279531..96685a09 100644 --- a/docs/linstor-migration.md +++ b/docs/linstor-migration.md @@ -93,7 +93,7 @@ Migrated: nodes, storage pools, resource groups, resource definitions (+ volume linstor-migrate -in ./dump -drbd-ports ./drbd-ports.txt -out ./blockstor-manifests.yaml ``` -Read the report on stderr end to end. Every `warning:` line is a thing the converter refused to guess — decide per line whether it matters for your data before continuing. In particular resolve every `LUKS key NOT migrated` and every `no DRBD port` line (the latter should be empty if the port capture was complete). +Read the report on stderr end to end. Every `warning:` line is a thing the converter refused to guess — decide per line whether it matters for your data before continuing. In particular resolve every `LUKS key NOT migrated` and every `no DRBD port` line, whether it names a definition, one replica, or a map whose node names match no replica. The latter should be empty if the port capture was complete: each replica it names gets a fresh port and reconnects on adoption, and `spec.drbdPort` cannot be changed after apply. ## Cutover diff --git a/pkg/linstormigrate/convert.go b/pkg/linstormigrate/convert.go index 8a351c78..59a898ef 100644 --- a/pkg/linstormigrate/convert.go +++ b/pkg/linstormigrate/convert.go @@ -2175,7 +2175,7 @@ func (c *converter) reportUnmatchedPortNodes() { rdDsp := c.displayRD(row.ResourceName) if len(unmatched) == len(perReplica) { - c.warnf("resource definition %s: no node in the live port map (%s) hosts a replica of it — check that the map uses LINSTOR's node names; every replica will get a fresh port and reconnect on adoption", + c.warnf("resource definition %s: no DRBD port for any replica: no node in the live port map (%s) hosts a replica of it — check that the map uses LINSTOR's node names; every replica will get a fresh port and reconnect on adoption", rdDsp, strings.Join(unmatched, ", ")) continue @@ -2236,7 +2236,7 @@ func (c *converter) resolveReplicaDRBDPort(row *ResourceRow, dumpPort *int32, rd } c.warnOncef("drbdport:"+row.ResourceName+":"+row.NodeName, - "resource %s.%s: the live map has ports for the other replicas of %s but none for this one — blockstor will allocate a fresh port for it, and this replica will reconnect on adoption", + "resource %s.%s: no DRBD port for this replica in the live map, which has ports for the other replicas of %s — blockstor will allocate a fresh port for it, and this replica will reconnect on adoption", rdDsp, nodeDsp, rdDsp) return nil diff --git a/pkg/linstormigrate/convert_test.go b/pkg/linstormigrate/convert_test.go index 42e9495e..70786b2f 100644 --- a/pkg/linstormigrate/convert_test.go +++ b/pkg/linstormigrate/convert_test.go @@ -499,7 +499,7 @@ func TestAReplicaMissingFromThePerReplicaMapIsReported(t *testing.T) { t.Errorf("pvc-vol5.node-b DRBDPort = %d, want none", *got) } - if !hasWarning(res, "pvc-vol5.node-b: the live map has ports for the other replicas") { + if !hasWarning(res, "pvc-vol5.node-b: no DRBD port for this replica in the live map") { t.Errorf("missing replica port not reported; warnings %v", res.Warnings) } @@ -583,7 +583,7 @@ func TestPortMapNodesWithoutAReplicaAreReported(t *testing.T) { t.Errorf("stray node entry not reported; warnings %v", res.Warnings) } - if !hasWarning(res, "pvc-vol3: no node in the live port map (k8s-a, k8s-b) hosts a replica of it") { + if !hasWarning(res, "pvc-vol3: no DRBD port for any replica: no node in the live port map (k8s-a, k8s-b) hosts a replica of it") { t.Errorf("fully unmatched map not reported; warnings %v", res.Warnings) } diff --git a/site/content/en/docs/migration.md b/site/content/en/docs/migration.md index c88afc4c..999e45da 100644 --- a/site/content/en/docs/migration.md +++ b/site/content/en/docs/migration.md @@ -78,7 +78,7 @@ Read the whole report it prints. Each `warning:` line is something the tool refu - `LUKS passphrase NOT migrated`. - `keeps its DRBD metadata on a separate volume`, or `would put its DRBD metadata on a separate volume` for a replica the dump has no layer chain for. The definition is skipped with its replicas: blockstor keeps DRBD metadata on the data device, and adopted as it is the replica would get new metadata over the end of its data. Changing the property does not move existing metadata. For a replica without a chain, check in LINSTOR where its metadata is first. If it is on the data device, remove the property and convert again. Otherwise, copy the data to a volume with internal metadata in LINSTOR and convert that one. - `keep their DRBD metadata on the data device, though StorPoolNameDrbdMeta ... is set`. Nothing to do: the metadata is internal, because LINSTOR applies the property only to replicas created after it was set, and `.internal` asks for internal metadata. The definition converts, and the property is not carried over to the definition or its replicas, so blockstor does not look for a separate metadata volume. -- `no DRBD port`. +- `no DRBD port`, for a definition, for one replica, or for every replica when no node in the port map hosts one. Each replica it names gets a fresh port and reconnects on adoption, and `spec.drbdPort` cannot be changed after apply. Capture the missing ports, or fix the node names in the map, and convert again. - `skipped with its replicas`. The definition's replicas cannot be adopted under one layer stack: they were built two ways, a diskful replica has no layer chain in the dump, or a replica was built otherwise than the stack the definition names. The reason in the line says which. An unreadable `layer_stack` column counts as no stack, and the line names its value. Adopted as it is, such a replica would come up under a stack it was not built with, which for a LUKS volume writes DRBD metadata over its ciphertext. Settle the stack in LINSTOR and convert again. - `unreadable layer_stack`. The definition's `layer_stack` column is not a list the converter can read. When its replicas agree, it takes the stack they were built with and the line names it; check that this is the stack you expect. With no diskful replica the stack is left unset and the controller pins one; see [How the stack is pinned](../layer-stack/#how-the-stack-is-pinned). From 44acdb27eccee58c299e38f3be8fc3b192b9482d Mon Sep 17 00:00:00 2001 From: Andrei Kvapil Date: Mon, 16 Nov 2026 09:50:26 -0500 Subject: [PATCH 2/2] fix(linstor-migrate): report no port to capture for a skipped definition A definition that did not convert, or has no replica that converts, gets no port at all, yet a port-map entry for it was reported as a "no DRBD port" line the operator is told to resolve and cannot. Assisted-by: LLM Signed-off-by: Andrei Kvapil --- pkg/linstormigrate/convert.go | 9 ++++++++- pkg/linstormigrate/convert_test.go | 5 +++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/pkg/linstormigrate/convert.go b/pkg/linstormigrate/convert.go index 0ba6bfd1..83aa8354 100644 --- a/pkg/linstormigrate/convert.go +++ b/pkg/linstormigrate/convert.go @@ -2173,8 +2173,15 @@ func (c *converter) reportUnmatchedPortNodes() { continue } + // A definition that did not convert, or has no replica that + // does, gets no port at all: nothing for the operator to fix. + replicas := c.liveReplicas(row.ResourceName) + if !c.convertedRD[row.ResourceName] || len(replicas) == 0 { + continue + } + known := map[string]bool{} - for _, replica := range c.liveReplicas(row.ResourceName) { + for _, replica := range replicas { known[strings.ToLower(replica.NodeName)] = true known[strings.ToLower(c.displayNode(replica.NodeName))] = true } diff --git a/pkg/linstormigrate/convert_test.go b/pkg/linstormigrate/convert_test.go index 31d0de3b..384e4e79 100644 --- a/pkg/linstormigrate/convert_test.go +++ b/pkg/linstormigrate/convert_test.go @@ -590,6 +590,7 @@ func TestPortMapNodesWithoutAReplicaAreReported(t *testing.T) { ReplicaDRBDPorts: map[string]map[string]int32{ "pvc-vol5": {"node-a": 7042, "node-b": 7051, "node-c": 7060}, "pvc-vol3": {"k8s-a": 7070, "k8s-b": 7071}, + "pvc-vol4": {"node-b": 7080}, }, }) if err != nil { @@ -604,6 +605,10 @@ func TestPortMapNodesWithoutAReplicaAreReported(t *testing.T) { t.Errorf("fully unmatched map not reported; warnings %v", res.Warnings) } + if hasWarning(res, "pvc-vol4: no DRBD port") { + t.Errorf("a definition that did not convert reported a port to capture; warnings %v", res.Warnings) + } + if hasWarning(res, "has ports for the other replicas of pvc-vol3") { t.Errorf("fully unmatched map reported as a partial one; warnings %v", res.Warnings) }