Upgrading the Migration Toolkit for Containers

You can upgrade the Migration Toolkit for Containers (MTC) on OKD 4.10 by using Operator Lifecycle Manager.

You can upgrade MTC on OKD 3 by reinstalling the legacy Migration Toolkit for Containers Operator.

If you are upgrading from MTC version 1.3, you must perform an additional procedure to update the MigPlan custom resource (CR).

Upgrading the Migration Toolkit for Containers on OKD 4.10

You can upgrade the Migration Toolkit for Containers (MTC) on OKD 4.10 by using the Operator Lifecycle Manager.

Prerequisites

  • You must be logged in as a user with cluster-admin privileges.

Procedure

  1. In the OKD console, navigate to OperatorsInstalled Operators.

    Operators that have a pending upgrade display an Upgrade available status.

  2. Click Migration Toolkit for Containers Operator.

  3. Click the Subscription tab. Any upgrades requiring approval are displayed next to Upgrade Status. For example, it might display 1 requires approval.

  4. Click 1 requires approval, then click Preview Install Plan.

  5. Review the resources that are listed as available for upgrade and click Approve.

  6. Navigate back to the Operators → Installed Operators page to monitor the progress of the upgrade. When complete, the status changes to Succeeded and Up to date.

  7. Click Migration Toolkit for Containers Operator.

  8. Under Provided APIs, locate the Migration Controller tile, and click Create Instance.

  9. Click WorkloadsPods to verify that the MTC pods are running.

Upgrading the Migration Toolkit for Containers on OKD 3

You can upgrade Migration Toolkit for Containers (MTC) on OKD 3 by manually installing the legacy Migration Toolkit for Containers Operator.

Prerequisites

  • You must be logged in as a user with cluster-admin privileges.

  • You must have access to registry.redhat.io.

  • You must have podman installed.

Procedure

  1. Log in to registry.redhat.io with your Red Hat Customer Portal credentials:

    1. $ sudo podman login registry.redhat.io
  2. Download the operator.yml file:

    1. $ sudo podman cp $(sudo podman create \
    2. registry.redhat.io/rhmtc/openshift-migration-legacy-rhel8-operator:v1.5.3):/operator.yml ./
  3. Replace the Migration Toolkit for Containers Operator:

    1. $ oc replace --force -f operator.yml
  4. Scale the migration-operator deployment to 0 to stop the deployment:

    1. $ oc scale -n openshift-migration --replicas=0 deployment/migration-operator
  5. Scale the migration-operator deployment to 1 to start the deployment and apply the changes:

    1. $ oc scale -n openshift-migration --replicas=1 deployment/migration-operator
  6. Verify that the migration-operator was upgraded:

    1. $ oc -o yaml -n openshift-migration get deployment/migration-operator | grep image: | awk -F ":" '{ print $NF }'
  7. Download the controller.yml file:

    1. $ sudo podman cp $(sudo podman create \
    2. registry.redhat.io/rhmtc/openshift-migration-legacy-rhel8-operator:v1.5.3):/controller.yml ./
  8. Create the migration-controller object:

    1. $ oc create -f controller.yml
  9. If you have previously added the OKD 3 cluster to the MTC web console, you must update the service account token in the web console because the upgrade process deletes and restores the openshift-migration namespace:

    1. Obtain the service account token:

      1. $ oc sa get-token migration-controller -n openshift-migration
    2. In the MTC web console, click Clusters.

    3. Click the Options menu kebab next to the cluster and select Edit.

    4. Enter the new service account token in the Service account token field.

    5. Click Update cluster and then click Close.

  10. Verify that the MTC pods are running:

    1. $ oc get pods -n openshift-migration

Upgrading MTC 1.3 to 1.7

If you are upgrading Migration Toolkit for Containers (MTC) version 1.3.x to 1.7, you must update the MigPlan custom resource (CR) manifest on the cluster on which the MigrationController pod is running.

Because the indirectImageMigration and indirectVolumeMigration parameters do not exist in MTC 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.

Prerequisites

  • You must be logged in as a user with cluster-admin privileges.

Procedure

  1. Log in to the cluster on which the MigrationController pod is running.

  2. Get the MigPlan CR manifest:

    1. $ oc get migplan <migplan> -o yaml -n openshift-migration
  3. Update the following parameter values and save the file as migplan.yaml:

    1. ...
    2. spec:
    3. indirectImageMigration: true
    4. indirectVolumeMigration: true
  4. Replace the MigPlan CR manifest to apply the changes:

    1. $ oc replace -f migplan.yaml -n openshift-migration
  5. Get the updated MigPlan CR manifest to verify the changes:

    1. $ oc get migplan <migplan> -o yaml -n openshift-migration