Chapter 2. Installing the Migration Toolkit for Virtualization

You can install the Migration Toolkit for Virtualization (MTV) by using the OpenShift Container Platform web console or the command line interface (CLI).

Important

After you have installed MTV, you must create a VMware Virtual Disk Development Kit (VDDK) image and add it to the spec.vddkInitImage field of the HyperConverged custom resource (CR).

2.1. Installing the MTV Operator

You can install the MTV Operator by using the OpenShift Container Platform web console or the command line interface (CLI).

2.1.1. Installing the MTV Operator by using the OpenShift Container Platform web console

You can install the MTV Operator by using the OpenShift Container Platform web console.

Prerequisites

  • OpenShift Container Platform 4.7 installed.
  • OpenShift Virtualization Operator installed.
  • You must be logged in as a user with cluster-admin permissions.

Procedure

  1. In the OpenShift Container Platform web console, click OperatorsOperatorHub.
  2. Use the Filter by keyword field to search for mtv-operator.
  3. Click the MTV Operator and then click Install.
  4. On the Install Operator page, click Install.
  5. Click OperatorsInstalled Operators to verify that the MTV Operator appears in the openshift-mtv project with the status Succeeded.
  6. Click the MTV Operator.
  7. Under Provided APIs, locate the ForkliftController, and click Create Instance.
  8. Click Create.
  9. Click WorkloadsPods to verify that the MTV pods are running.

Obtaining the MTV web console URL

You can obtain the MTV web console URL by using the OpenShift Container Platform web console.

Prerequisites

  • OpenShift Virtualization Operator installed.
  • MTV Operator installed.
  • You must be logged in as a user with cluster-admin privileges.

Procedure

  1. Log in to the OpenShift Container Platform web console.
  2. Click NetworkingRoutes.
  3. Select the openshift-mtv project in the Project: list.
  4. Click the URL for the forklift-ui service to open the login page for the MTV web console.

2.1.2. Installing the MTV Operator from the command line interface

You can install the MTV Operator from the command line interface (CLI).

Prerequisites

  • OpenShift Container Platform 4.7 installed.
  • OpenShift Virtualization Operator installed.
  • You must be logged in as a user with cluster-admin permissions.

Procedure

  1. Create the openshift-mtv project:

    $ cat << EOF | oc apply -f -
    apiVersion: project.openshift.io/v1
    kind: Project
    metadata:
      name: openshift-mtv
    EOF
  2. Create an OperatorGroup CR called migration:

    $ cat << EOF | oc apply -f -
    apiVersion: operators.coreos.com/v1
    kind: OperatorGroup
    metadata:
      name: migration
      namespace: openshift-mtv
    spec:
      targetNamespaces:
        - openshift-mtv
    EOF
  3. Create a Subscription CR for the Operator:

    $ cat << EOF | oc apply -f -
    apiVersion: operators.coreos.com/v1alpha1
    kind: Subscription
    metadata:
      name: mtv-operator
      namespace: openshift-mtv
    spec:
      channel: release-v2.0.0
      installPlanApproval: Automatic
      name: mtv-operator
      source: redhat-operators
      sourceNamespace: openshift-marketplace
      startingCSV: "mtv-operator.v2.0.0"
    EOF
  4. Create a ForkliftController CR:

    $ cat << EOF | oc apply -f -
    apiVersion: forklift.konveyor.io/v1beta1
    kind: ForkliftController
    metadata:
      name: forklift-controller
      namespace: openshift-mtv
    spec:
      olm_managed: true
    EOF
  5. Verify that the MTV pods are running:

    $ oc get pods -n openshift-mtv

    Example output

    NAME                                  READY  STATUS   RESTARTS  AGE
    forklift-controller-788bdb4c69-mw268  2/2    Running  0         2m
    forklift-operator-6bf45b8d8-qps9v     1/1    Running  0         5m
    forklift-ui-7cdf96d8f6-xnw5n          1/1    Running  0         2m

Obtaining the MTV web console URL

You can obtain the MTV web console URL from the command line.

Prerequisites

  • OpenShift Virtualization Operator installed.
  • MTV Operator installed.
  • You must be logged in as a user with cluster-admin privileges.

Procedure

  1. Obtain the MTV web console URL:

    $ oc get route virt -n openshift-mtv \
      -o custom-columns=:.spec.host

    Example output

    https://virt-openshift-mtv.apps.cluster.openshift.com.

  2. Launch a browser and navigate to the MTV web console.

2.2. Creating and using a VDDK image

The Migration Toolkit for Virtualization (MTV) uses the VMware Virtual Disk Development Kit (VDDK) SDK to transfer virtual disks from VMware vSphere.

You can download the VMware Virtual Disk Development Kit (VDDK), build a VDDK image, and push the VDDK image to your image registry. You then add the VDDK image to the spec.vddkInitImage field of the HyperConverged custom resource (CR).

Note

Storing the VDDK image in a public registry might violate the VMware license terms.

Prerequisites

Procedure

  1. Create and navigate to a temporary directory:

    $ mkdir /tmp/<dir_name> && cd /tmp/<dir_name>
  2. In a browser, navigate to the VMware VDDK download page.
  3. Select the latest VDDK version and click Download.
  4. Save the VDDK archive file in the temporary directory.
  5. Extract the VDDK archive:

    $ tar -xzf VMware-vix-disklib-<version>.x86_64.tar.gz
  6. Create a Dockerfile:

    $ cat > Dockerfile <<EOF
    FROM registry.access.redhat.com/ubi8/ubi-minimal
    COPY vmware-vix-disklib-distrib /vmware-vix-disklib-distrib
    RUN mkdir -p /opt
    ENTRYPOINT ["cp", "-r", "/vmware-vix-disklib-distrib", "/opt"]
    EOF
  7. Build the VDDK image:

    $ podman build . -t <registry_route_or_server_path>/vddk:<tag>
  8. Push the VDDK image to the registry:

    $ podman push <registry_route_or_server_path>/vddk:<tag>
  9. Ensure that the image is accessible to your OpenShift Virtualization environment.
  10. Edit the HyperConverged CR in the openshift-cnv project:

    $ oc edit hco -n openshift-cnv kubevirt-hyperconverged
  11. Add the vddkInitImage parameter to the spec stanza:

    apiVersion: hco.kubevirt.io/v1beta1
    kind: HyperConverged
    metadata:
      name: kubevirt-hyperconverged
      namespace: openshift-cnv
    spec:
      vddkInitImage: <registry_route_or_server_path>/vddk:<tag>