Skip to main content
NetApp virtualization solutions

Migrate VMs from VMware ESXi to Red Hat OpenShift Virtualization using Shift toolkit and Migration Toolkit for Virtualization

Contributors netapp-nimo

This section covers how Migration toolkit for virtualization (MTV) and NetApp Shift Toolkit brings seamless migration experience to Red Hat OpenShift Virtualization and provides a step-by-step guide on transitioning to OpenShift Virtualization using Migration toolkit for virtualization and Shift Toolkit’s conversion capabilities.

Before you begin

Verify that the following prerequisites are met before starting the migration.

Red Hat OpenShift Virtualization requirements
  • OpenShift cluster is network reachable

  • OpenShift Cluster endpoint with the following operators installed:

    • OpenShift Virtualization operator

    • NetApp Trident operator

  • NetApp Trident CSI configured with appropriate backends and storage classes

  • NodeNetworkConfigurationPolicy and NetworkAttachmentDefinitions (NAD) configured with proper VLANs

  • MTV 2.9.4 or later (which includes the conversion mode)

  • Service account token with cluster-admin privileges

VMware requirements
  • Account with minimal permissions. Refer to this section for the minimum privileges needed

  • VMDKs must be placed on individual volumes (mimicking VMDK to a PVC/PV construct) using svmotion

Note This limitation will be removed in the next release where NAS-economy driver can be used for PVC provisioning.
Note Use the script available within the Script block (Settings > Developer Access > Script block) to enable PVC placement on a qtree, or allows importing the volume as-is, or cloning and importing the volume, eliminating the need for manual vMotion operations.
  • VMware tools are running on guest VMs

  • The operating system of each VM is certified and supported as a guest operating system for conversions

  • IP addresses, VLANs, and other network configuration settings must not be changed before or during migration. The MAC addresses of the virtual machines are preserved during migration.

Step 1: Create migration plans using Migration Toolkit for Virtualization

  1. To leverage the lighting fast conversion of VMs, the first step is to create a migration plan for the VMs using MTV via web console or the command line.

    Note The plan should be created beforehand to ensure the preserve IP settings are configured by MTV.
    Procedure
    1. Log in to the MTV web console.

    2. Add Source and Destination Providers

    3. Create a Migration Plan in the Target Namespace

      • After providers are configured, create a migration plan and select the appropriate source and destination providers within the target namespace

        Show example
        Create Migration Plan
        Show example
        Source and Target Providers
    4. Select the VMs to Migrate

      • Identify and choose the virtual machines that will be included in the migration.

        Show example
        Select VMs
    5. Configure Network and Storage Mappings

      • Either select existing mappings or create new ones to align source networks and storage with the destination environment.

        Show example
        Network map
        Show example
        Storage map
    6. Choose Migration Type

      • Keep the default migration type initially; this will be updated during the migration process to reflect the conversion type.

        Show example
        Migration type
    7. Keep default options

      • Retain the default settings. Additionally, select the option to preserve static IP and specify the desired state of the VM after migration.

        Show example
        Additional Setup
    8. Review and Finalize

      • Review all settings carefully, then click Finish to create the migration plan.

        Show example
        Review and Create
  2. Once the migration plan is created, copy the name of the migration plan and head over to Shift toolkit UI.

  3. Add the source and destination hypervisors. Follow this link
    to create sites

    Note The endpoint configured in the Shift Toolkit must match the format used when adding it through the MTV console. For example, if the source or destination endpoint was added using FQDN, the same FQDN should be used in the Shift Toolkit.
    Show example
    Shift toolkit Site Display
  4. Navigate to Blueprints and Create a New Blueprint.

    • After completing the previous steps, go to Blueprints and select Create new blueprint using MTV plan.

      Note Unlike the standard workflow in Shift Toolkit, there is no need to manually create a resource group when using an MTV plan-based migration. Shift Toolkit automatically generates resource groups and applies the necessary mappings based on the migration plan YAML.
      Show example
      Create blueprint using MTV plan
  5. Select Destination and Migration Plan.

    • Choose the destination site and the corresponding OpenShift endpoint. After that, select the migration plan retrieved from the specified cluster, which contains the VMs to be migrated.

      Show example
      Blueprint details
  6. The resource group and mappings will all be autoconfigured based on the migration plan yaml.

    Show example
    Migration details
  7. Choose the PVC import option. By default, the setting is Clone and import the volume.

    Note Volumes can also be imported directly without creating a clone.
    Show example
    VM details
  8. Once done, create the blueprint.

  9. Trigger the migration by clicking on migration against the blueprint.

    Note The VMs should be powered OFF before triggering the migration. MTV will bring up the VM based on the VM target power state attribute.
    Show example
    Trigger Migrate
  10. Shift toolkit executes the workflow steps to convert the disk format, import the PVCs and creating the VM using OpenShift APIs.

    Show example
    Migration Steps
  11. After all PVCs are in place as specified and Shift Toolkit triggers MTV, the MTV migration workflow is initiated.

    1. The Migration Controller creates a VirtualMachineImport (VMI) custom resource (CR) for each source VM.

    2. Since the PVCs are already imported by Shift Toolkit, the Virtual Machine Import Controller launches a Conversion Pod with the PVCs attached.

    3. The Conversion Pod runs virt-v2v, installing and configuring device drivers on the PVCs for the target VM.

    4. The Virtual Machine Import Controller then creates a VirtualMachineInstance (VMI) CR.

    5. When the target VM powers on, the KubeVirt Controller creates a VM Pod, which runs QEMU-KVM with the PVCs attached as VM disks.

      Show example
      MTV trigger
  12. When all VMs have been migrated, the Migration Controller updates the migration plan status to Completed. The original power state of each source VM is preserved after migration.

    Show example
    MTV Completion Status
    Show example
    Windows VM after migration
    Linux VM after migration
    Note This shows Shift toolkit along with MTV simplifying the migration at lighting speed. In this example, 2 VMs with a total of 12TB was migrated. The entire process completed in around 8-10 mins.
    What’s happening behind the scenes:

    The following sections describe the steps triggered by Shift Toolkit APIs and MTV to convert VMDK files and create virtual machines on the OpenShift platform. This workflow remains consistent whether initiated through the Shift Toolkit UI or via scripts provided within Shift Toolkit Script Blocks.

Convert VMDK

Shift toolkit will automatically find the VMDKs associated with each VM including the primary boot disk.

Note If there are multiple VMDK files, each VMDK will be converted.
Volume Import and Migration Plan Configuration

Shift Toolkit uses Trident CSI to import volumes as PVCs into the cluster. Each PVC manifest is populated with specific labels and annotations to ensure MTV recognizes them:

  • Labels

    • vmID

    • vmUUID

  • Annotation:

    • vmdk disk path

Additionally, permissions on the disk.img file are updated. The permissions are modified using a POD that is deployed on the fly to mount the imported PVCs and set the permissions as follows:

  • "owner": { "id": 107 },"group": { "id": 107 },"mode": "0655"

Important Notes:

  • Forklift checks for vmID and vmUUID in the PVC.

  • Forklift uses the disk name (VMDK path) for forklift.konveyor.io/disk-source.

  • The number of imported PVCs must match the number of disks associated with the source VM. For example, if a VM has three VMDKs but four PVCs are imported with matching IDs, MTV will not update the migration plan status to “Ready to start.”

Once these steps are complete, Shift Toolkit patches the migration plan YAML so MTV understands that PVCs should be used directly, bypassing the data populator pod process (which is typically time-consuming). The patched YAML includes:

  • targetNamespace: default

  • type: conversion

  • storage: {}

Start Migration Process

Once the configuration is complete, MTV is invoked to begin the migration. The UI will display the migration type as Cold, but based on the YAML specification for conversion, MTV validates each PVC against the associated vmID and vmUUID, maps them accordingly, and then initializes the migration.
.Show example

Details
MTV Console completion time
Note VMs are created under “Default” project for virtual machines, however it can be modified within the MTV migration plan YAML.

Shift Toolkit accelerates migration by simplifying the process, minimizing downtime, and eliminating the need for ESXi host access or VDDK-based approaches.

Note Before getting started with this specific integration, contact your Red Hat account team.