Skip to main content
NetApp virtualization solutions

Migrate VMs from VMware ESXi to Red Hat OpenShift Virtualization

Contributors kevin-hoke

Migrate VMs from VMware ESXi to Red Hat OpenShift Virtualization using the Shift Toolkit by preparing VMs, converting disk formats, and configuring the target environment.

The Shift Toolkit enables VM migration between virtualization platforms through disk format conversion and network reconfiguration on the destination environment.

Before you begin

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

Red Hat OpenShift Virtualization requirements
  • OpenShift Cluster endpoint with the following operators installed:

    • OpenShift Virtualization operator

    • NetApp Trident CSI driver

    • NMstate

  • NetApp Trident CSI configured with appropriate backends and storage classes

  • NodeNetworkConfigurationPolicy and NetworkAttachmentDefinitions (NAD) configured with proper VLANs

  • OpenShift cluster is network reachable with current host file entries

  • Administrator level privileges on the cluster

  • Kubeconfig file downloaded

VMware requirements
  • VMDKs are 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.
  • VMware tools are running on guest VMs

  • VMs to be migrated are in a RUNNING state for preparation

  • VMs must be powered off before triggering migration

  • VMware tools removal happens on the destination hypervisor once VMs are powered on

Guest VM requirements
  • For Windows VMs: Use local administrator credentials

  • For Linux VMs: Use a user with permissions to execute sudo commands without password prompt

  • For Windows VMs: Mount the VirtIO ISO to the VM (download from here)

    Note The preparation script uses the .msi package to install drivers and qemu-guest-agents.

Step 1: Add the destination site (OpenShift)

Add the destination OpenShift Virtualization environment to the Shift Toolkit.

Steps
  1. Click Add New Site and select Destination.

    Show example
    Select destination
  2. Enter the destination site details:

    • Site Name: Provide a name for the site

    • Hypervisor: Select OpenShift

    • Site Location: Select the default option

    • Connector: Select the default selection

  3. Click Continue.

    Show example
    Destination site details
  4. Enter the OpenShift details:

    • Endpoint: FQDN of OpenShift Cluster endpoint (for example, api.demomigsno.demoval.com)

    • Upload Kubeconfig file: Use the kubeconfig file with minimal permissions

      Note The file extension must be yaml.
      Show example
      Destination OpenShift details
  5. Click Create Site.

    Show example
    Destination OpenShift creation
    Note The source and destination volume will be the same as the disk format conversion happens at the volume level within the same volume.

Step 2: Create resource groups

Organize VMs into resource groups to preserve boot order and boot delay configurations.

Before you begin

Ensure VM VMDKs are moved to individual datastore volumes on a newly created ONTAP SVM.

Steps
  1. Navigate to Resource Groups and click Create New Resource Group.

  2. Select the source site from the dropdown and click Create.

  3. Provide resource group details and select the workflow:

    • Clone based Migration: Performs end-to-end migration from source to destination hypervisor

    • Clone based Conversion: Converts disk format to the selected hypervisor type

  4. Click Continue.

  5. Select VMs using the search option.

    Note VM selection for resource groups is based on virtual machine and not at the datastore level.
    Show example
    Datastores associated with the virtual machine
    Show example
    VM datastore details
  6. Update migration details:

    • Select Destination Site

    • Select Destination OpenShift entry

    • Select the storage class

      Show example
      Migration details
      Note The Trident backend will be mapped to the source volume automatically if there is only one TBC; however, if there are multiple TBCs, the backend can be selected.
  7. Configure boot order and boot delay for all selected VMs:

    • 1: First VM to power on

    • 3: Default

    • 5: Last VM to power on

  8. Click Create Resource Group.

    Show example
    Migration details configuration
Result

The resource group is created and ready for blueprint configuration.

Step 3: Create a migration blueprint

Create a blueprint to define the migration plan, including platform mappings, network configuration, and VM settings.

Steps
  1. Navigate to Blueprints and click Create New Blueprint.

  2. Provide a name for the blueprint and configure host mappings:

    • Select Source Site and associated vCenter

    • Select Destination Site and associated OpenShift target

    • Configure cluster and host mapping

      Show example
      Blueprint details
  3. Select resource group details and click Continue.

  4. Set execution order for resource groups if multiple groups exist.

  5. Configure network mapping to appropriate logical networks.

    Note Network attachment definitions should already be provisioned within the OpenShift cluster with the appropriate VLAN and trunk options. For test migration, select "Do not configure Network" to avoid production network conflicts; manually assign network settings after conversion.
    Show example
    Network mapping
  6. Review storage class and backend mappings (automatically selected based on VM selection).

    Note Ensure VMDKs are svmotioned to individual volumes beforehand so the virtual machine can be created and powered on from the PVC.
  7. Under VM details, select configuration details and provide service account credentials for each OS type:

    • Windows: Use a user with local administrator privileges (domain credentials can also be used)

    • Linux: Use a user that can execute sudo commands without password prompt

      Show example
      Configuration selection
      Note The configuration selection allows you to select the disk image format, skip override prepareVM, and choose whether to split the volume from the parent. By default, split clone is disabled and the workflow defaults to RAW format.
  8. Configure IP settings:

    • Do not configure: Default option

    • Retain IP: Keep same IPs from source system

    • DHCP: Assign DHCP on target VMs

      Ensure VMs are powered on during prepareVM phase and VMware Tools are installed.

  9. Configure VM settings:

    • Resize CPU/RAM parameters (optional)

    • Modify boot order and boot delay

    • Power ON: Select to power on VMs after migration (default: ON)

    • Remove VMware tools: Remove VMware Tools after conversion (default: selected)

    • VM Firmware: BIOS > BIOS and EFI > EFI (automatic)

    • Retain MAC: Keep MAC addresses for licensing requirements

      Note If interface name needs to be retained while retaining the MAC address, ensure appropriate udev rules are created on the source VM.
    • Service Account override: Specify separate service account if needed

  10. Click Continue.

  11. (Optional) Schedule the migration by selecting a date and time.

    Note Schedule migrations at least 30 minutes ahead to allow time for VM preparation.
  12. Click Create Blueprint.

Result

The Shift Toolkit initiates a prepareVM job that runs scripts on source VMs to prepare them for migration.

Show example
Virtual machines prepared for migration

The preparation process:

  • Injects scripts to update VirtIO drivers, install qemu-agent, remove VMware tools, backup IP details, and update fstab

  • Uses PowerCLI to connect to guest VMs (Linux or Windows) and update VirtIO drivers

  • For Windows VMs: Stores scripts in C:\NetApp

  • For Linux VMs: Stores scripts in /NetApp and /opt

Note For any supported VM OSes, the Shift Toolkit automatically installs necessary VirtIO drivers before disk conversion to ensure successful boot after conversion.

When prepareVM completes successfully, the blueprint status updates to "PrepareVM Complete." Migration will now happen at the scheduled time or can be started manually by clicking the Migrate option.

Show example
PrepareVM complete status
Show example
Blueprint ready for migration

Step 4: Execute the migration

Trigger the migration workflow to convert VMs from VMware ESXi to OpenShift Virtualization.

Before you begin

All VMs are gracefully powered off according to the planned maintenance schedule.

Steps
  1. On the blueprint, click Migrate.

    Show example
    Migration steps
  2. The Shift Toolkit performs the following steps:

    • Deletes existing snapshots for all VMs in the blueprint

    • Triggers VM snapshots at the source

    • Triggers volume snapshot before disk conversion

    • Clones the individual volumes

    • Converts VMDK to RAW format for each VMDK

      The Shift Toolkit automatically finds all VMDKs associated with each VM, including the primary boot disk.

Note If there are multiple VMDK files, each VMDK will be converted. In this release (v4.0), each VMDK should be placed on an individual volume/datastore.
  • Cleans up the volumes to have just the disk.img file

    With the virtual machine disk image converted to RAW format, the Shift Toolkit cleans up the volumes, renames the raw file to disk.img, and assigns necessary permissions.

  • Imports the volumes as PVCs using Trident import

    The volumes are then imported as PVCs using NetApp Trident APIs.

  • Creates VMs using VM-specific yaml files

    Once the PVCs are imported and PVs are in place, the Shift Toolkit uses OC CLI to create each VM depending on the OS using yaml files.

Note VMs are created under the "Default" namespace.
  • Powers on VMs at the target

    Depending on the VM OS, the Shift Toolkit auto-assigns the VM boot option along with storage controller interfaces. For Linux distributions, VirtIO or VirtIO SCSI is used. For Windows, the VM powers on with SATA interface, then the scheduled script auto-installs VirtIO drivers and changes the interface to VirtIO.

  • Registers networks on each VM

    Networks are assigned based on the blueprint selection.

  • Removes VMware tools and assigns IP addresses using cron jobs

Show example
Red Hat OpenShift VM migration

Use Migration Toolkit for Virtualization with Shift Toolkit

This section describes how to use Migration Toolkit for Virtualization (MTV) with NetApp Shift Toolkit for seamless migration to Red Hat OpenShift Virtualization.

Before you begin

Ensure the following prerequisites are met:

  • OpenShift cluster with OpenShift Virtualization operator and NetApp Trident CSI driver installed

  • MTV 2.9.4 (which includes conversion mode)

  • Shift Toolkit installed

    Note Since only Shift Toolkit API is used, there is no need to configure Shift Toolkit resource groups or blueprints.
  • Administrator level privileges on the OpenShift cluster

  • A Linux instance with tridentctl and OC command line tool installed

    • Kubeconfig exported or OC login executed to connect to the cluster

    • Download the script named "OpenShift-MTV" from Shift Toolkit UI (Settings > Developer Access > Script Blocker)

    • Unzip the file: unzip openshift-mtv.zip

    • Ensure Python3 is installed: dnf install python3

    • Install OpenJDK 8 or later: yum install java-1.8.0-openjdk

    • Install requirements: pip install -r requirements.txt

  • Virtual Machine requirements for MTV: VMDKs for a VM must be placed on individual volumes. For a VM with 3 disks, each disk should be on its individual volume (mapping datastore to PVC construct). This must be done manually using storage vmotion.

Steps
  1. Create migration plans using MTV.

    To leverage fast VMDK conversion, create a migration plan for the VMs and ensure the following parameters are in the YAML:

    • targetNamespace: default

    • type: conversion

    • storage: {}

      Note The plan should be created beforehand to ensure preserve IP settings are configured by MTV.
  2. Map VMs from vCenter and volumes on ONTAP storage.

    Use the script to create necessary PVCs and import them to the OpenShift cluster. The PVCs must have the following labels and annotations:

    Labels:

    • vmID and vmUUID in the PVC (Forklift looks for these values)

      Annotation:

    • The vmdk disk name for forklift.konveyor.io/disk-source

      The script ensures these attributes are set for every PVC and updates disk.img permissions:

    • "owner": { "id": 107 }

    • "group": { "id": 107 }

    • "mode": "0655"

  3. Update the JSON file with the following details:

    • ONTAP Cluster: Can be a SVM; vsadmin can be used. Set splitclone to "False" if clone volume doesn't need immediate detachment

    • vCenter: Minimum RBAC rights to discover VMs and associated VMDK files

    • Trident storage class: Should be NFS backend with correct version in yaml

    • OpenShift: Specify the project name (default is used as an example)

      Note Keep the rest of the values as default.
  4. Once prerequisites are met, execute python3 main.py to create PVCs and import them to the OpenShift Cluster.

  5. Once PVCs are imported, trigger migration using MTV to create the VM with the appropriate specification.

    Show example
    Python script execution
    Show example
    Results in Shift Toolkit
  6. Convert VMDK with MTV.

    The script automatically finds all VMDKs associated with each VM, including the primary boot disk.

    Note If there are multiple VMDK files, each VMDK will be converted.
  7. Upload RAW image to OpenShift Virtualization.

    The script uses Trident CSI to import volumes as PVCs to the cluster. The PVC yaml is populated with labels and annotations.

  8. Create virtual machine with MTV.

    After import, call the MTV plan to start migration. The UI shows as "Cold," but based on the yaml specification of conversion, MTV checks for each PVC and the vmID/vmUUID, maps them, and initializes the migration.

    Show example
    Migration status
    Note VMs are created under "Default" project for virtual machines, but this can be modified within the MTV migration plan YAML.
  9. Boot VM for the first time with MTV.

    Depending on the VM OS, MTV auto-assigns the VM boot option along with storage controller interfaces.

    Show example
    Migration history

    Migration completed in 6 minutes for a VM with 1.5TB data disk (spread across 3 PVCs). This showcases a streamlined, low-impact approach to re-homing VMs using ONTAP storage.

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

Video demonstration

The following video demonstrates the process outlined in this solution.

Zero touch migration from ESX to Oracle Linux Virtualization Manager (OLVM)