Migrating VMs from VMware vSphere to OpenShift

OpenShift® Virtualization supports the migration of VMs from VMware vSphere to OpenShift.

Before you begin

  • Ensure that the internal OpenShift registry setup is complete. Use an OpenShift internal registry image from a single namespace to provision workloads across multiple namespaces. After the internal OpenShift registry setup is complete, follow this procedure to use an OpenShift internal registry image that is stored in a single namespace to provision workloads across desired namespaces.
  • Deploy the Migration Toolkit for Virtualization (MTV) operator. For more information about deploying MTV operator, see Installing the Migration Toolkit for Virtualization.

About this task

OpenShift Virtualization supports the migration of VMs from VMware vSphere to OpenShift. To accelerate this process, it uses Virtual Disk Development Kit (VDDK) images. VDDK enables faster, block-level access to VM disks, reducing transfer times by skipping unused data and improving overall performance. It is useful for large VMs or bulk migrations. For more information about how to build and configure the VDDK image, see OpenShift.

Note: In this procedure, Origin Namespace refers to where the internal image is stored and Destination Namespace refers to where the image are pulled and used by pods.

Procedure

  1. Create a Service Account in the destination namespace.
    It is the namespace where your pods run and provides access to the image.
    oc create serviceaccount registry-puller -n <destination-namespace>
  2. Create an Image Pull Secret in the destination namespace.
    Go through the internal OpenShift registry and provide your credentials.
    oc create secret docker-registry registry-pull-secret \
      --docker-server=<internal-openshift-image-registry> \
      --docker-username=<your_username> \
      --docker-password=<your_password> \
      --docker-email=<your_email> \
      -n <destination-namespace>
  3. Link the Secret to the Service Account in the destination namespace.
    oc secrets link registry-puller registry-pull-secret --for=pull -n <destination-namespace>
  4. Grant Permission to the Service Account to Pull from the origin namespace.
    It allows the service account in the destination namespace to pull images from the origin namespace.
    oc adm policy add-role-to-user system:image-puller \
      system:serviceaccount:<destination-namespace>:registry-puller \
      -n <origin-namespace>