Tech ONTAP Blogs

Move Your VMs to OpenShift Virtualization—The Shift Toolkit Way

niyaz
NetApp
875 Views

For organizations adapting to changes in virtualization licensing while optimizing total cost of ownership (TCO), OpenShift Virtualization combined with NetApp ONTAP offers a powerful, future-ready solution. This presents a compelling alternative option for virtualization. Built on KubeVirt, an open-source technology, it enables seamless management of virtual machines (VMs) alongside containers within a unified Kubernetes environment. This integration allows IT teams to consolidate workloads on a single platform, streamlining operations and accelerating cloud-native transformation. NetApp ONTAP stands out as the most versatile data platform for virtualization, on-premises or in the cloud. It supports all major hypervisors in on-premises environment and offers native data services across leading public clouds. ONTAP’s integration empowers organizations to:

  • Seamlessly adapt to licensing changes
  • Choose the optimal deployment model for each workload
  • Maintain consistent data management across hybrid and multi-cloud environments

This flexibility positions ONTAP as a strategic enabler for organizations navigating the evolving virtualization landscape.

 

What is OpenShift virtualization

Key Capabilities

  • KVM-based VMs run in containers, managed as Pods
  • Fully scheduled, deployed, and managed by Kubernetes
  • Intuitive VM lifecycle management via the OpenShift web console
  • Integrated with Kubernetes-native persistent storage and orchestration

Storage & Data Protection with NetApp Trident

  • Trident CSI: Dynamic storage provisioning over NFS, FC, iSCSI, NVMe/TCP
  • Granular VM-level operations: snapshots, clones, volume expansion

Trident Protect:

  • Crash-consistent VM backups to S3-compatible storage
  • Disaster recovery with replication, failover, and failback

Beyond the powerful storage features like snapshots, clones, and efficiency, NetApp ONTAP plays a key role in streamlining VM migration to OpenShift Virtualization. Depending on the number of VM disks and their size, the available migration options will take some time. This is where ONTAP along with cloning capability via Shift toolkit make the migration seamless. Call it the virtual machine migration offloader to storage.

 

Why Shift toolkit

Shift toolkit combines high-fidelity format conversion with native storage cloning and efficiency to convert a VMDK to RAW and handles it at scale & speed. The metadata only nature of FlexClone means the conversion can be done in seconds to minutes (for example, 2 TB in seconds). This allows customers to run VM conversions with minimal storage overhead and near-zero downtime. To emphasize the point, there is no data copy in here, meaning the conversion happens instantly. This saves time and compute resources. This makes ONTAP a strategic enabler for large-scale migrations involving tens of thousands of VMs, delivering efficiency without disruption.

 

While VMKFStools cloning with copy offload is a supported method, it still requires data movement across volumes, even though the process is offloaded to the storage layer. In contrast, the Shift Toolkit significantly outperforms XCOPY offload. It acts as a VM migration offloader that eliminates the need for actual data copying. The Shift Toolkit API enables intra-volume copies, where both the source and destination reside within the same volume. By leveraging NetApp’s proprietary deduplication technology, the destination file typically occupies only a few kilobytes for metadata, allowing clone operations to complete almost instantly.

 

Importantly, this approach avoids reliance on deprecated protocols within the VMware ecosystem. Instead, it uses supported, traditional datastores to enable fast and seamless VM migration.

 

This blog covers how the NetApp Shift Toolkit brings the same seamless migration experience to Red Hat OpenShift Virtualization as it does for hypervisors like Hyper-V and provides a step-by-step guide on transitioning to OpenShift Virtualization using Shift Toolkit’s conversion APIs. Looking ahead, future releases of the toolkit will offer enhanced capabilities and deeper integration to further streamline the migration journey.

 

Prerequisites

  • OpenShift cluster with OpenShift Virtualization operator and NetApp Trident CSI driver installed.
  • Shift toolkit v2.2 installed
    • No additional configuration required. Since only Shift toolkit API is used in this case, there is no need to configure Shift toolkit resource groups or blueprint.
  • Administrator level privileges on the OpenShift cluster
  • A Linux instance (this can be an existing management instance as well) with tridentctl and OC command line tool installed.
    • kubeconfig exported or OC login shd be executed to connect to the cluster.
    • Download the script named - Shift VM to OpenShift from Shift toolkit script block and copy the zip file to this Linux instance.
    • Unzip the zip using unzip <filename> (unzip 'shift-vm-to-openshift.zip')
    • Ensure Python3 is installed (dnf install python3)
    • Install openjdk 8 or later version (yum install java-1.8.0-openjdk)
    • Run pip install -r requirements.txt (need internet)
VM requirements:
  • Ensure the VMDKs for a VM are placed on individual volumes. For instance, consider a VM with 3 disks. Each of the disk should be placed on its individual volume (mapping datastore to PVC construct). This needs to be done manually using storage vmotion.
  • The script runs against RHEL 8 and 9, SLES 12 and Windows 2019/2022

Note: The script doesn’t assign Network now. This needs to be manually assigned. Will be covered in a later update.

 

PrepareVM requirements (for injecting Virtio drivers):
  • PrepareVM script is embedded in the zip file. Use powershell to execute the script from the Shift toolkit VM.
  • Ensure vmware.powercli module is installed (install-module VMware.PowerCLI -scope AllUsers -force -SkipPublisherCheck -AllowClobber)
  • For Windows VM, mount the virtio iso to the VM. The virtio driver can be downloaded from here.

 

Preparing the VM

Shift toolkit runs the VirtIO driver, qemu-agent installation and fstab update script. To accomplish the same, Shift toolkit uses powercli to connect to the guest VMs (Linux or windows) and updates the VirtIO drivers ensuring the necessary drivers are available once the VM boots up on OpenShift side.

The script for Linux and Windows can be found in the zip extract. The syntax to use is as follows:

.\prepare-vm.ps1 -vCenter "IP or FQDN" -vCenterUser "administrator@domain.com" -vCenterPass "password" -vmName "vm name" -guestUser "user" -guestPass "password" -osFlavor "linux" -localWindowsScriptPath "prepare-vm-win.ps1" -localLinuxScriptPath "prepare-vm-linux.sh"

 

niyaz_0-1754665348537.png

 

Note: The script remains the same for Linux or windows distro, just need to ensure the right parameters are passed.

 

Discovering VMs from vCenter and volumes on ONTAP storage

In order to start the process, update the json file with the following details:

  • ONTAP Cluster
    • This can be a SVM, its management IP and vsadmin credentials
    • Splitclone parameter can be set to “False” if the clone volume doesn’t need to be detached.
  • vCenter
    • Min RBAC rights to access the vCenter to discover the VMs and associated VMDK files.
  • Shift toolkit
    • The Shift toolkit VM IP and the credentials to access the same. If using the default credentials, it will be admin/admin
  • Trident storage class
    • Should be NFS backend and ensure the right version is updated
  • OpenShift
    • Specify the project name (default is used as an example)

Note: Keep the rest of the values as default

 

niyaz_1-1754665586451.png

 

High level workflow:

Once the pre-reqs are met, simply execute python3 main.py which will do the orchestration.

niyaz_2-1754665675328.png

 

Below sections cover what steps are triggered by Shift toolkit APIs to convert the VMDK ad create a VM on the OpenShift side.

 

Convert VMDK

Once the json file is updated, the script will automatically find the VMDKs associated with each VM including the primary boot disk. The conversion happens in seconds compared to other approaches.

 

niyaz_0-1754677921922.png

 

Note: if there are multiple VMDK files, each VMDK will be converted.

 

Upload the RAW image to OpenShift Virtualization Cluster

With the virtual machine disk image converted to RAW format, script uploads the RAW file to OpenShift cluster and import them individually using trident.

niyaz_10-1754666272746.png

 

Create Virtual Machine

Script generates a “YAML” for each VM depending on the OS.

niyaz_11-1754666335320.png

 

Booting VM for the first time

Depending on the Virtual Machine OS, Shift toolkit will auto assign the VM boot option, along with the storage controller interface. In case of Linux distros, VirtIO is used. And for Windows, Shift toolkit starts with SATA interface and then auto installs VirtIO drivers and then changes the interface to VirtIO by modifying the YAML.

 

Note: Once the VM boots up, ensure to assign the network manually for this iteration.

niyaz_12-1754666396455.png

 

niyaz_13-1754666410761.png

 

All the above is covered by running python3 main.py

 

Fast, Simple VM Migration with ONTAP and Shift Toolkit

In this blog demo, a RHEL VM with 3 fully populated disks totalling 1.5 TB was migrated to OpenShift Virtualization in under 5 minutes. The VMDK to RAW conversion completed in seconds - thanks to ONTAP and Shift Toolkit.

 

This showcases a streamlined, low-impact approach to rehoming VMs using ONTAP storage. And if you're using block protocols, storage class migration is your go-to solution. This is just the beginning, stay tuned for deeper protocol level integration ahead.

 

Planning a Move to OpenShift Virtualization? Shift Toolkit Has You Covered.

If you are planning to migrate to OpenShift virtualization or already in the process, give Shift toolkit script a try. It’s completely free. Reach out to your NetApp team to register your interest and explore upcoming integrations that streamline operations.

 

Public