$ sudo podman login registry.redhat.io
You can upgrade the Migration Toolkit for Containers (MTC) by installing the latest Migration Toolkit for Containers Operator.
You must ensure that the same Operator version is installed on the source and target clusters. Do not enable automatic updates on the OpenShift Container Platform 4.5 cluster. |
If you are upgrading MTC 1.3, you must perform an additional procedure to update the MigPlan
custom resource (CR).
You can upgrade the Migration Toolkit for Containers (MTC) on an OpenShift Container Platform 4 cluster using the OpenShift Container Platform console.
In the OpenShift Container Platform console, navigate to Operators → Installed Operators.
Click Migration Toolkit for Containers Operator.
Under Provided APIs, locate the Migration Controller tile, and click Create Instance.
Click Create.
Click Workloads → Pods to verify that the MTC pods are running.
You can upgrade Migration Toolkit for Containers (MTC) on an OpenShift Container Platform 3 cluster by downloading the latest operator.yml
file and replacing the existing Migration Toolkit for Containers Operator.
Access to registry.redhat.io
Podman installed
Log in to registry.redhat.io
with your Red Hat Customer Portal credentials:
$ sudo podman login registry.redhat.io
Download the latest operator.yml
file:
$ sudo podman cp $(sudo podman create registry.redhat.io/rhmtc/openshift-migration-rhel7-operator:v1.4.2):/operator.yml ./
Replace the Migration Toolkit for Containers Operator:
$ oc replace --force -f operator.yml
If you are upgrading MTC 1.1.2 or earlier versions, delete the Restic
pods to apply the changes:
$ oc delete pod <restic_pod>
If you are upgrading MTC 1.2 or later versions, scale the migration-operator
deployment to 0
to stop the deployment:
$ oc scale -n openshift-migration --replicas=0 deployment/migration-operator
Scale the migration-operator
deployment to 1
to start the deployment and apply the changes:
$ oc scale -n openshift-migration --replicas=1 deployment/migration-operator
Verify that the migration-operator
was upgraded to 1.4.2:
$ oc -o yaml -n openshift-migration get deployment/migration-operator | grep image: | awk -F ":" '{ print $NF }'
Download the latest controller-3.yml
file:
$ sudo podman cp $(sudo podman create registry.redhat.io/rhmtc/openshift-migration-rhel7-operator:v1.4.2):/controller-3.yml ./
Create the migration-controller
object:
$ oc create -f controller-3.yml
If your OpenShift Container Platform version is 3.10 or earlier, set the security context constraint of the migration-controller
service account to anyuid
to enable direct image migration and direct volume migration:
$ oc adm policy add-scc-to-user anyuid -z migration-controller -n openshift-migration
Verify that the MTC pods are running:
$ oc get pods -n openshift-migration
If you have already added your OpenShift Container Platform 3 source cluster to the MTC console, you must update the service account token because the upgrade deletes and restores the openshift-migration
namespace:
Obtain the service account token:
$ oc sa get-token migration-controller -n openshift-migration
In the MTC console, click Clusters, click the Options menu next to the source cluster, and select Edit.
Enter the new service account token in the Service account token field, click Update cluster, and then click Close.
If you are upgrading Migration Toolkit for Containers (MTC) version 1.3.x, you must manually update the indirectImageMigration
and indirectVolumeMigration
parameters in the MigPlan
custom resource (CR).
Because the indirectImageMigration
and indirectVolumeMigration
parameters do not exist in version 1.3, their default value in version 1.4 is false
, which means that direct image migration and direct volume migration are enabled. Because the direct migration requirements are not fulfilled, the migration plan cannot reach a Ready
state unless these parameter values are changed to true
.
You must have upgraded MTC from version 1.3.x to 1.4.
You must have cluster-admin
privileges.
Log in to the target cluster.
Get the MigPlan
CR:
$ oc get migplan <migplan> -o yaml -n openshift-migration
Change the following parameter values to true
and save the file:
...
spec:
indirectImageMigration: true
indirectVolumeMigration: true
Apply the changes:
$ oc replace -f <migplan>.yaml -n openshift-migration
Verify the changes by viewing the updated MigPlan
CR:
$ oc get migplan <migplan> -o yaml -n openshift-migration