Introduction
Migration Toolkit for Virtualization (MTV) 2.7 provides a comprehensive solution to migrate virtual machines (VMs) from VMware to OpenShift Virtualization. This guide outlines the steps required to install and configure MTV 2.7 while leveraging OpenShift's internal registry.
Prerequisites
Before proceeding, ensure you have met the following requirements:
- Review VMware Prerequisites: Familiarize yourself with the VMware prerequisites as outlined in the official documentation.
- Creating a VDDK Image: Follow the steps for creating a VDDK image for VMware disk introspection.
-
OpenShift Cluster Requirements:
- A functional OpenShift Container Platform (OCP) cluster with OpenShift Virtualization enabled.
- Access to the OpenShift internal registry.
- Sufficient resources (CPU, Memory, and Storage) to accommodate migrated workloads.
Step 1: Install Migration Toolkit for Virtualization
MTV 2.7 can be installed via the OperatorHub in OpenShift.
- Login to OpenShift:
oc login --server=<OCP_API_SERVER> --token=<TOKEN>
-
Install MTV Operator:
- Navigate to Operators > OperatorHub in the OpenShift Web Console.
- Search for Migration Toolkit for Virtualization.
- Click Install and follow the guided setup.
- Verify Installation:
oc get pods -n openshift-mtv
Ensure all pods in the openshift-mtv
namespace are running.
Step 2: Configure OpenShift Internal Registry for MTV
MTV needs access to OpenShift’s internal image registry to store migrated VM images.
Expose the Internal Registry:
oc patch configs.imageregistry.operator.openshift.io cluster \
--type=merge -p '{"spec":{"defaultRoute":true}}'
Retrieve the internal registry route:
oc get route default-route -n openshift-image-registry --template='{{ .spec.host }}'
Authenticate with the Registry:
podman login -u kubeadmin -p $(oc whoami -t) \
$(oc get route default-route -n openshift-image-registry --template='{{ .spec.host }}')
Step 3: Download and Save the VDDK Archive
Download the required VDDK archive from VMware and save it in a temporary directory. After downloading, extract the archive:
Create and Configure the VDDK Image
Migration Toolkit for Virtualization requires a VMware Virtual Disk Development Kit (VDDK) image for efficient data transfer.
Prepare the VDDK Libraries:
- In a browser, navigate to the VMware VDDK version 8 download page.
- Select version 8.0.1 and click Download.
- Note: In order to migrate to OpenShift Virtualization 4.12, download VDDK version 7.0.3.2 from the VMware VDDK version 7 download page.
Extract the tar file
tar -xzf VMware-vix-disklib-\<version>.x86\_64.tar.gz
Build the Container Image:
# Create 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 container image
podman build -t vddk-image:latest .
Tag the VDDK Image for OpenShift's Internal Registry:
This will go in the openshift-mtv namespace
podman tag vddk-image:latest $(oc get route default-route -n openshift-image-registry --template='{{ .spec.host }}')/openshift-mtv/vddk-image:latest
Push the VDDK Image to OpenShift's Internal Registry:
podman push $(oc get route default-route -n openshift-image-registry --template='{{ .spec.host }}')/openshift-mtv/vddk-image:latest
Give image pull permissions to openshift-mtv namespace
oc adm policy add-role-to-group system:image-puller system:serviceaccounts:openshift-mtv -n openshift-image-registry
Configure MTV to Use the VDDK Image:
- Navigate to Operators > Installed Operators in OpenShift Web Console.
- Locate the
ForkliftController
resource and edit its configuration. - Specify the VDDK image location:
spec:
vddkInitImage: 'image-registry.openshift-image-registry.svc:5000/openshift-mtv/vddk-image:latest'
- Save and apply the changes.
Step 4: Configure Migration Plan
-
Access the MTV Web UI:
- Navigate to Operators > Installed Operators in OpenShift.
- Click Migration Toolkit for Virtualization and select Open Console.
-
Define a Migration Plan:
- Add VMware as a source provider.
- Select OpenShift Virtualization as the destination.
- Map VM workloads accordingly.
-
Start Migration:
- Validate VM connectivity.
- Initiate migration and monitor the process via OpenShift logs:
oc logs -f <mtv-pod-name> -n openshift-mtv
Conclusion
By following these steps, you have successfully migrated virtual machines from VMware to OpenShift Virtualization using Migration Toolkit for Virtualization 2.7 while leveraging the OpenShift internal registry. Ensure to monitor workloads post-migration and optimize resources accordingly.
Top comments (0)