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).
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
-
In the OpenShift Container Platform web console, click Operators
OperatorHub. - Use the Filter by keyword field to search for mtv-operator.
- Click the MTV Operator and then click Install.
- On the Install Operator page, click Install.
-
Click Operators
Installed Operators to verify that the MTV Operator appears in the openshift-mtv project with the status Succeeded. - Click the MTV Operator.
- Under Provided APIs, locate the ForkliftController, and click Create Instance.
- Click Create.
-
Click Workloads
Pods 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
- Log in to the OpenShift Container Platform web console.
-
Click Networking
Routes. -
Select the
openshift-mtv
project in the Project: list. -
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
Create the openshift-mtv project:
$ cat << EOF | oc apply -f - apiVersion: project.openshift.io/v1 kind: Project metadata: name: openshift-mtv EOF
Create an
OperatorGroup
CR calledmigration
:$ cat << EOF | oc apply -f - apiVersion: operators.coreos.com/v1 kind: OperatorGroup metadata: name: migration namespace: openshift-mtv spec: targetNamespaces: - openshift-mtv EOF
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
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
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
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.
- 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).
Storing the VDDK image in a public registry might violate the VMware license terms.
Prerequisites
- OpenShift Container Platform image registry or a secure external registry.
-
podman
installed. - If you are using an external registry, OpenShift Virtualization must be able to access it.
Procedure
Create and navigate to a temporary directory:
$ mkdir /tmp/<dir_name> && cd /tmp/<dir_name>
- In a browser, navigate to the VMware VDDK download page.
- Select the latest VDDK version and click Download.
- Save the VDDK archive file in the temporary directory.
Extract the VDDK archive:
$ tar -xzf VMware-vix-disklib-<version>.x86_64.tar.gz
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
Build the VDDK image:
$ podman build . -t <registry_route_or_server_path>/vddk:<tag>
Push the VDDK image to the registry:
$ podman push <registry_route_or_server_path>/vddk:<tag>
- Ensure that the image is accessible to your OpenShift Virtualization environment.
Edit the
HyperConverged
CR in the openshift-cnv project:$ oc edit hco -n openshift-cnv kubevirt-hyperconverged
Add the
vddkInitImage
parameter to thespec
stanza:apiVersion: hco.kubevirt.io/v1beta1 kind: HyperConverged metadata: name: kubevirt-hyperconverged namespace: openshift-cnv spec: vddkInitImage: <registry_route_or_server_path>/vddk:<tag>