Skip to content

Commit af193a0

Browse files
authored
Merge pull request #34931 from apinnick/bz1964901-manual-rollback-uninstall-mtc
BZ1964901: Manually rolling back migration, uninstalling
2 parents 1cd7385 + dd65699 commit af193a0

File tree

6 files changed

+189
-12
lines changed

6 files changed

+189
-12
lines changed

migrating_from_ocp_3_to_4/troubleshooting-3-4.adoc

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
= Troubleshooting
33
include::modules/common-attributes.adoc[]
44
:context: troubleshooting-3-4
5+
:troubleshooting-3-4:
56

67
toc::[]
78

@@ -22,8 +23,8 @@ include::modules/migration-debugging-velero-resources.adoc[leveloffset=+2]
2223
include::modules/migration-partial-failure-velero.adoc[leveloffset=+2]
2324
include::modules/migration-using-mtc-crs-for-troubleshooting.adoc[leveloffset=+2]
2425

25-
[discrete]
2626
[id="additional-resources-for-debugging-tools_{context}"]
27+
[discrete]
2728
=== Additional resources for debugging tools
2829

2930
* xref:../migrating_from_ocp_3_to_4/about-mtc-3-4.adoc#migration-mtc-workflow_about-mtc-3-4[{mtc-short} workflow]
@@ -44,5 +45,18 @@ include::modules/migration-known-issues.adoc[leveloffset=+2]
4445

4546
You can roll back a migration by using the {mtc-short} web console or the CLI.
4647

48+
You can also xref:../migrating_from_ocp_3_to_4/troubleshooting-3-4.adoc#migration-rolling-back-migration-manually_troubleshooting-3-4[roll back a migration manually].
49+
4750
include::modules/migration-rolling-back-migration-web-console.adoc[leveloffset=+2]
4851
include::modules/migration-rolling-back-migration-cli.adoc[leveloffset=+2]
52+
include::modules/migration-rolling-back-migration-manually.adoc[leveloffset=+2]
53+
54+
include::modules/migration-uninstalling-mtc-clean-up.adoc[leveloffset=+1]
55+
56+
[id="additional-resources-uninstalling_{context}"]
57+
[discrete]
58+
=== Additional resources for uninstalling {mtc-short}
59+
60+
* xref:../operators/admin/olm-deleting-operators-from-cluster.adoc#olm-deleting-operators-from-a-cluster-using-web-console_olm-deleting-operators-from-cluster[Deleting Operators from a cluster using the web console]
61+
62+
:troubleshooting-3-4!:

migration_toolkit_for_containers/troubleshooting-mtc.adoc

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
= Troubleshooting
33
include::modules/common-attributes.adoc[]
44
:context: troubleshooting-mtc
5+
:troubleshooting-mtc:
56

67
toc::[]
78

@@ -22,8 +23,8 @@ include::modules/migration-debugging-velero-resources.adoc[leveloffset=+2]
2223
include::modules/migration-partial-failure-velero.adoc[leveloffset=+2]
2324
include::modules/migration-using-mtc-crs-for-troubleshooting.adoc[leveloffset=+2]
2425

25-
[discrete]
2626
[id="additional-resources-for-debugging-tools_{context}"]
27+
[discrete]
2728
=== Additional resources for debugging tools
2829

2930
* xref:../migration_toolkit_for_containers/about-mtc.adoc#migration-mtc-workflow_about-mtc[{mtc-short} workflow]
@@ -42,5 +43,18 @@ include::modules/migration-error-messages.adoc[leveloffset=+2]
4243

4344
You can roll back a migration by using the {mtc-short} web console or the CLI.
4445

46+
You can also xref:../migration_toolkit_for_containers/troubleshooting-mtc.adoc#migration-rolling-back-migration-manually_troubleshooting-mtc[roll back a migration manually].
47+
4548
include::modules/migration-rolling-back-migration-web-console.adoc[leveloffset=+2]
4649
include::modules/migration-rolling-back-migration-cli.adoc[leveloffset=+2]
50+
include::modules/migration-rolling-back-migration-manually.adoc[leveloffset=+2]
51+
52+
include::modules/migration-uninstalling-mtc-clean-up.adoc[leveloffset=+1]
53+
54+
[id="additional-resources-uninstalling_{context}"]
55+
[discrete]
56+
=== Additional resources for uninstalling {mtc-short}
57+
58+
* xref:../operators/admin/olm-deleting-operators-from-cluster.adoc#olm-deleting-operators-from-a-cluster-using-web-console_olm-deleting-operators-from-cluster[Deleting Operators from a cluster using the web console]
59+
60+
:troubleshooting-mtc!:

modules/migration-rolling-back-migration-cli.adoc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,13 @@ You can roll back a migration by creating a `MigMigration` custom resource (CR)
1010

1111
[NOTE]
1212
====
13-
If you roll back a failed direct volume migration, the following resources are preserved in the namespaces specified in the `MigPlan` custom resource (CR) to help you debug the failed migration:
13+
The following resources remain in the migrated namespaces for debugging after a failed direct volume migration (DVM):
1414
1515
* Config maps (source and destination clusters)
1616
* `Secret` CRs (source and destination clusters)
1717
* `Rsync` CRs (source cluster)
18-
* `Service` CRs (destination cluster)
19-
* `Route` CRs (destination cluster)
2018
21-
These resources must be deleted manually.
19+
These resources do not affect rollback. You can delete them manually.
2220
2321
If you later run the same migration plan successfully, the resources from the failed migration are deleted automatically.
2422
====
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * migrating_from_ocp_3_to_4/troubleshooting-3-4.adoc
4+
// * migration_toolkit_for_containers/troubleshooting-mtc
5+
6+
[id="migration-rolling-back-migration-manually_{context}"]
7+
= Rolling back a migration manually
8+
9+
You can roll back a failed migration manually by deleting the `stage` pods and unquiescing the application.
10+
11+
If you run the same migration plan successfully, the resources from the failed migration are deleted automatically.
12+
13+
[NOTE]
14+
====
15+
The following resources remain in the migrated namespaces after a failed direct volume migration (DVM):
16+
17+
* Config maps (source and destination clusters)
18+
* `Secret` CRs (source and destination clusters)
19+
* `Rsync` CRs (source cluster)
20+
21+
These resources do not affect rollback. You can delete them manually.
22+
====
23+
24+
.Procedure
25+
26+
. Delete the `stage` pods on all clusters:
27+
+
28+
[source,terminal]
29+
----
30+
$ oc delete $(oc get pods -l migration.openshift.io/is-stage-pod -n <namespace>) <1>
31+
----
32+
<1> Namespaces specified in the `MigPlan` CR.
33+
34+
. Unquiesce the application on the source cluster by scaling the replicas to their premigration number:
35+
+
36+
[source,terminal]
37+
----
38+
$ oc scale deployment <deployment> --replicas=<premigration_replicas>
39+
----
40+
+
41+
The `migration.openshift.io/preQuiesceReplicas` annotation in the `Deployment` CR displays the premigration number of replicas:
42+
+
43+
[source,yaml]
44+
----
45+
apiVersion: extensions/v1beta1
46+
kind: Deployment
47+
metadata:
48+
annotations:
49+
deployment.kubernetes.io/revision: "1"
50+
migration.openshift.io/preQuiesceReplicas: "1"
51+
----
52+
53+
. Verify that the application pods are running on the source cluster:
54+
+
55+
[source,terminal]
56+
----
57+
$ oc get pod -n <namespace>
58+
----

modules/migration-rolling-back-migration-web-console.adoc

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,13 @@ You can roll back a migration by using the {mtc-full} ({mtc-short}) web console.
1010

1111
[NOTE]
1212
====
13-
If you roll back a failed direct volume migration, the following resources are preserved in the namespaces specified in the migration plan to help you debug the failed migration:
13+
The following resources remain in the migrated namespaces for debugging after a failed direct volume migration (DVM):
1414
15-
* Config maps (source and target clusters)
16-
* `Secret` CRs (source and target clusters)
15+
* Config maps (source and destination clusters)
16+
* `Secret` CRs (source and destination clusters)
1717
* `Rsync` CRs (source cluster)
18-
* `Service` CRs (target cluster)
19-
* `Route` CRs (target cluster)
2018
21-
These resources must be deleted manually.
19+
These resources do not affect rollback. You can delete them manually.
2220
2321
If you later run the same migration plan successfully, the resources from the failed migration are deleted automatically.
2422
====
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * migrating_from_ocp_3_to_4/troubleshooting-3-4.adoc
4+
// * migration_toolkit_for_containers/troubleshooting-mtc
5+
6+
[id="migration-uninstalling-mtc-clean-up_{context}"]
7+
= Uninstalling {mtc-short} and deleting resources
8+
9+
You can uninstall the {mtc-full} ({mtc-short}) and delete its resources to clean up the cluster.
10+
11+
[NOTE]
12+
====
13+
Deleting the `velero` CRDs removes Velero from the cluster.
14+
====
15+
16+
.Prerequisites
17+
18+
* You must be logged in as a user with `cluster-admin` privileges.
19+
20+
.Procedure
21+
22+
. Delete the `MigrationController` custom resource (CR) on all clusters:
23+
+
24+
[source,terminal]
25+
----
26+
$ oc delete migrationcontroller <migration_controller>
27+
----
28+
29+
. Uninstall the {mtc-short} Operator on {product-title} 4 by using the {product-title} web console.
30+
ifdef::troubleshooting-3-4[]
31+
. Uninstall the {mtc-short} Operator on {product-title} 3 by deleting the `operator` CR manifest:
32+
+
33+
[source,terminal]
34+
----
35+
$ oc delete -f operator.yml
36+
----
37+
endif::[]
38+
39+
. Delete cluster-scoped resources on all clusters by running the following commands:
40+
41+
* `migration` custom resource definitions (CRDs):
42+
+
43+
[source,terminal]
44+
----
45+
$ oc delete $(oc get crds -o name | grep 'migration.openshift.io')
46+
----
47+
48+
* `velero` CRDs:
49+
+
50+
[source,terminal]
51+
----
52+
$ oc delete $(oc get crds -o name | grep 'velero')
53+
----
54+
55+
* `migration` cluster roles:
56+
+
57+
[source,terminal]
58+
----
59+
$ oc delete $(oc get clusterroles -o name | grep 'migration.openshift.io')
60+
----
61+
62+
* `migration-operator` cluster role:
63+
+
64+
[source,terminal]
65+
----
66+
$ oc delete clusterrole migration-operator
67+
----
68+
69+
* `velero` cluster roles:
70+
+
71+
[source,terminal]
72+
----
73+
$ oc delete $(oc get clusterroles -o name | grep 'velero')
74+
----
75+
76+
* `migration` cluster role bindings:
77+
+
78+
[source,terminal]
79+
----
80+
$ oc delete $(oc get clusterrolebindings -o name | grep 'migration.openshift.io')
81+
----
82+
83+
* `migration-operator` cluster role bindings:
84+
+
85+
[source,terminal]
86+
----
87+
$ oc delete clusterrolebindings migration-operator
88+
----
89+
90+
* `velero` cluster role bindings:
91+
+
92+
[source,terminal]
93+
----
94+
$ oc delete $(oc get clusterrolebindings -o name | grep 'velero')
95+
----

0 commit comments

Comments
 (0)