diff --git a/docs/linstor-migration.md b/docs/linstor-migration.md index d63d185c..ed285d8b 100644 --- a/docs/linstor-migration.md +++ b/docs/linstor-migration.md @@ -87,7 +87,7 @@ linstor-migrate -in ./dump -drbd-ports ./drbd-ports.txt -out ./blockstor-manifes `-linstor-passphrase-file` and `-keyring-out` are needed only when the dump has LUKS volumes; a wrong passphrase stops the run before anything is written. A passphrase that is given is checked against LINSTOR's master key even when no volume is encrypted, since the keyring made from it is what blockstor will unlock with. If LINSTOR never had a master passphrase (no `encrypted/masterkey` in the dump), there is nothing to check it against, and the run is refused: drop the LUKS flags. `./blockstor-keyring.yaml` is the keyring Secret: it holds the master key wrapped under the LINSTOR passphrase and nothing in the clear. It is applied before the blockstor controller starts, not with the manifests: see cutover step 3. To convert into a blockstor cluster that already has a keyring, pass `-keyring-in -blockstor-passphrase-file ` instead of `-keyring-out`, where `keyring.json` is the `keyring.json` key of its `blockstor-master-key` Secret. -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 check that every LUKS definition reports its passwords migrated, and resolve every `no DRBD port` line (it 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 check that every LUKS definition reports its passwords migrated, and resolve 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 3e173384..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 } @@ -2195,7 +2202,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 @@ -2256,7 +2263,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 4909a186..384e4e79 100644 --- a/pkg/linstormigrate/convert_test.go +++ b/pkg/linstormigrate/convert_test.go @@ -513,7 +513,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) } @@ -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 { @@ -600,10 +601,14 @@ 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) } + 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) } diff --git a/site/content/en/docs/migration.md b/site/content/en/docs/migration.md index 301637d1..578c8e3d 100644 --- a/site/content/en/docs/migration.md +++ b/site/content/en/docs/migration.md @@ -79,7 +79,7 @@ Read the whole report it prints. Each `warning:` line is something the tool refu - `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).