Skip to content

Commit f75c759

Browse files
committed
MIG-684: Map namespaces
1 parent 84cf635 commit f75c759

File tree

3 files changed

+58
-13
lines changed

3 files changed

+58
-13
lines changed

modules/migration-creating-migration-plan-cam.adoc

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,18 @@ You can create a migration plan in the {mtc-full} ({mtc-short}) web console.
2424
+
2525
The migration plan name must not exceed 253 lower-case alphanumeric characters (`a-z, 0-9`) and must not contain spaces or underscores (`_`).
2626

27-
. Select a *Source cluster*, a *Target cluster*, and a *Repository*, and click *Next*.
28-
. On the *Namespaces* page, select the projects to be migrated and click *Next*.
29-
. On the *Persistent volumes* page, click a *Migration type* for each PV:
27+
. Select a *Source cluster*, a *Target cluster*, and a *Repository*.
28+
. Click *Next*.
29+
. Select the projects for migration.
30+
. Optional: Click the edit icon beside a project to change the target namespace.
31+
. Click *Next*.
32+
. Select a *Migration type* for each PV:
3033

3134
* The *Copy* option copies the data from the PV of a source cluster to the replication repository and then restores the data on a newly created PV, with similar characteristics, in the target cluster.
3235
* The *Move* option unmounts a remote volume, for example, NFS, from the source cluster, creates a PV resource on the target cluster pointing to the remote volume, and then mounts the remote volume on the target cluster. Applications running on the target cluster use the same remote volume that the source cluster was using.
3336

3437
. Click *Next*.
35-
. On the *Copy options* page, select a *Copy method* for each PV:
38+
. Select a *Copy method* for each PV:
3639

3740
* *Snapshot copy* backs up and restores data using the cloud provider's snapshot functionality. It is significantly faster than *Filesystem copy*.
3841
* *Filesystem copy* backs up the files on the source cluster and restores them on the target cluster.
@@ -51,7 +54,7 @@ If you selected *Filesystem copy*, you can change the target storage class.
5154
The direct migration options copy images and files directly from the source cluster to the target cluster. This option is much faster than copying images and files from the source cluster to the replication repository and then from the replication repository to the target cluster.
5255

5356
. Click *Next*.
54-
. Optional: On the *Hooks* page, click *Add Hook* to add a hook to the migration plan.
57+
. Optional: Click *Add Hook* to add a hook to the migration plan.
5558
+
5659
A hook runs custom code. You can add up to four hooks to a single migration plan. Each hook runs during a different migration step.
5760

modules/migration-migrating-applications-api.adoc

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -242,16 +242,37 @@ spec:
242242
name: <migstorage_ref> <3>
243243
namespace: openshift-migration
244244
namespaces:
245-
- <application_namespace> <4>
245+
- <source_namespace_1> <4>
246+
- <source_namespace_2>
247+
- <source_namespace_3>:<destination_namespace> <5>
246248
srcMigClusterRef:
247-
name: <remote_cluster_ref> <5>
249+
name: <remote_cluster_ref> <6>
248250
namespace: openshift-migration
249251
----
250252
<1> Direct image migration is enabled if `false`.
251253
<2> Direct volume migration is enabled if `false`.
252254
<3> Specify the name of the `MigStorage` CR instance.
253-
<4> Specify one or more namespaces to be migrated.
254-
<5> Specify the name of the source cluster `MigCluster` instance.
255+
<4> Specify one or more source namespaces. If you specify only the source namespace, the destination namespace is the same.
256+
<5> Specify a destination namespace if it is different from the source namespace.
257+
<6> Specify the name of the source cluster `MigCluster` instance.
258+
+
259+
[IMPORTANT]
260+
====
261+
You must ensure that namespaces are not duplicated on the source or the destination clusters because the UID and GID ranges are copied during migration. The following examples will cause a validation error:
262+
263+
----
264+
spec:
265+
namespaces:
266+
- namespace_2
267+
- namespace_1:namespace_2
268+
----
269+
270+
----
271+
spec:
272+
namespaces:
273+
- namespace_1:namespace_1
274+
----
275+
====
255276

256277
. Create the `MigPlan` CR:
257278
+

modules/migration-mtc-cr-manifests.adoc

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,24 @@ spec:
268268

269269
The `MigPlan` CR defines the parameters of a migration plan. It contains a group of virtual machines that are being migrated with the same parameters.
270270

271+
[IMPORTANT]
272+
====
273+
You must ensure that namespaces are not duplicated on the source or the destination clusters because the UID and GID ranges are copied during migration. The following examples will cause a validation error:
274+
275+
----
276+
spec:
277+
namespaces:
278+
- namespace_2
279+
- namespace_1:namespace_2
280+
----
281+
282+
----
283+
spec:
284+
namespaces:
285+
- namespace_1:namespace_1
286+
----
287+
====
288+
271289
[source,yaml]
272290
----
273291
apiVersion: migration.openshift.io/v1alpha1
@@ -298,8 +316,10 @@ spec:
298316
name: <migstorage_name> <12>
299317
namespace: openshift-migration
300318
namespaces:
301-
- <namespace> <13>
302-
refresh: false <14>
319+
- <source_namespace_1> <13>
320+
- <source_namespace_2>
321+
- <source_namespace_3>:<destination_namespace_4> <14>
322+
refresh: false <15>
303323
----
304324
<1> The migration has completed if `true`. You cannot create another `MigMigration` CR for this `MigPlan` CR.
305325
<2> Specify the name of the source cluster `MigCluster` CR.
@@ -313,8 +333,9 @@ spec:
313333
<10> Direct image migration is disabled if `true`. Images are copied from the source cluster to the replication repository and from the replication repository to the destination cluster.
314334
<11> Direct volume migration is disabled if `true`. PVs are copied from the source cluster to the replication repository and from the replication repository to the destination cluster.
315335
<12> Specify the name of `MigStorage` CR.
316-
<13> Specify one or more namespaces.
317-
<14> The `MigPlan` CR is validated if `true`.
336+
<13> Specify one or more source namespaces. If you specify only the source namespace, the destination namespace is the same.
337+
<14> Specify the destination namespace if it is different from the source namespace.
338+
<15> The `MigPlan` CR is validated if `true`.
318339

319340
[id="migstorage_{context}"]
320341
== MigStorage

0 commit comments

Comments
 (0)