Migrating VMs with Shared Virtual Disks using OpenShift Migration Toolkit

Red Hat

Audience
Public
Technology Integrations
Linux
Source Type
Documentation

This page describes the high-level migration workflow for virtual machines with shared disks using OpenShift Migration Toolkit for virtualization.

Clustered applications using RDM (Raw Device Mapping) volumes, vVols or clustered VMDKS for shared storage require a two-stage migration. In stage 1, a single VM is migrated along with the shared virtual disk. In stage 2, the remaining VMs are migrated without re-migrating the shared volumes. After both stages, a reconnection step re-establishes the shared volume attachments.

The example in this section will be using RDMs, but this has been tested and validated with RDMs, vVols and clustered VMDKs on VMFS.

The example here will still require all of the steps in the previous topic, but will require slight changes to the migration plans to enable successful migrations of cluster shared virtual disks.

Prerequisites:

  1. If using the CLI for migration: oc and kubectl installed and authenticated (oc whoami confirms active session)

  2. Migration Toolkit for Virtualization (MTV) operator installed in the target OpenShift cluster

  3. XCopy Offload enabled on the MTV controller

  4. Ephemeral image registry configured (required only for VDDK path, skip for XCopy or Vol copy offload)

  5. SCSI Persistent Reservation enabled if migrating Windows Failover Clustering VMs

  6. FORKLIFT_NAMESPACE environment variable set to the target Forklift project namespace

  1. Migrate First VM with Shared Disks.
    # Plan for first VM — set migrateSharedDisks: true
    apiVersion: forklift.konveyor.io/v1beta1
    kind: Plan
    metadata:
    name: rdm-stage1-plan
    spec:

    migrateSharedDisks: true # <-- required for stage 1 only

    pvcNameTemplateUseGenerateName: true
    targetNamespace: ${FORKLIFT_NAMESPACE}
    warm: false

    ... provider, map, etc. as per standard workflow

    vms:
    - id: vm-cluster-node-01 # First VM only
    name: cluster-node-01
  2. Migrate Remaining VMs.
    # Second plan — migrateSharedDisks must be false
    # Otherwise Forklift migrates one copy of RDMs per VM
    apiVersion: forklift.konveyor.io/v1beta1
    kind: Plan
    metadata:
    name: rdm-stage2-plan
    spec:

    migrateSharedDisks: false # <-- critical: must be false for stage 2

    pvcNameTemplateUseGenerateName: true
    targetNamespace: ${FORKLIFT_NAMESPACE}
    warm: false
    vms:
    - id: vm-cluster-node-02
    name: cluster-node-02
    - id: vm-cluster-node-03
    name: cluster-node-03
    - id: vm-cluster-node-04
    name: cluster-node-04
    - id: vm-cluster-node-05
    name: cluster-node-05
    - id: vm-cluster-node-06
    name: cluster-node-06
    Post-Migration: Reconnect VMs to Shared Volumes
  3. After the above 2 steps complete, reconfigure the shared RDM volumes as LUN-type SCSI disks on all cluster VMs. The first migrated VM retains ownership of the shared disk PVCs. Configure the remaining VMs to attach those existing PVCs as shared LUNs.
    1. In the OpenShift web console, navigate to the first migrated VM and go to Storage.
    2. For each shared disk, edit the disk, change Drive Type from 'Disk' to 'LUN', change Interface from 'virtio' to 'SCSI'.
    3. For each additional VM, navigate to Storage > Add Disk, select the shared disk, set Type to 'LUN' and Interface to 'SCSI'.
    4. Repeat for all shared disks and all remaining VMs.

Test Configuration

6x Large-Disk Linux VMs sharing 2x 1 TB physical RDMs in multi-writer mode, representing a clustered application with shared data volumes. VDDK does not support physical RDMs. VDDK tests used virtual RDMs of equivalent size for comparison.

Migration Step VMFS / VDDK (Virtual RDM) VMFS / XCopy (Physical RDM)
Stage 1: First VM + shared RDMs (700 GB used) 8h 20m 27s 5m 15s
Stage 2: Remaining 5 VMs (no shared disks) 6h 48m 45s 5m 28s