Migrating Existing Virtual Machines
Introduction
This portion of our lab uses the Migration Toolkit for Virtualization (MTV) to import virtual machines from VMware vSphere to OpenShift. The migration toolkit supports two "modes" of import:
-
Cold migration turns off the source virtual machine before starting the migration. This is the default migration type.
-
Warm migration copies data while the source virtual machine continues to run. Once the bulk of data has been migrated, the VM is shutdown and the final data is copied to the destination. The new VM can then be started, resulting in a much shorter period of downtime for the VM-hosted application.
The migration toolkit has already been deployed to your cluster using the Operator available in OperatorHub. |
Documentation for how to install and configure the Operator can be found here.
If you would like to learn more about how to configure the Migration Toolkit for Virtualization for your own needs, please see the documentation at the following links for:
-
Explore the VMware vSphere environment
-
Review the configuration for the Migration Toolkit for Virtualization (MTV)
-
Create a Migration Plan
-
Migrate VMs into OpenShift Virtualization
Prerequisites for Migrations
The following prerequisites apply to all migrations:
-
ISO/CD-ROM disks must be unmounted.
-
Each NIC must contain one IPv4 and/or one IPv6 address.
-
The VM operating system must be certified and supported for use as a guest operating system for OpenShift Virtualization.
-
VM names must contain only lowercase letters (a-z), numbers (0-9), or hyphens (-), up to a maximum of 253 characters. The first and last characters must be alphanumeric. The name must not contain uppercase letters, spaces, periods (.), or special characters.
-
VM names must not duplicate the name of an existing VM in the OpenShift Virtualization environment.
The Migration Toolkit for Virtualization will automatically assign a new name to a VM that does not comply with the rules, doing so allows the migration to proceed smoothly. |
Migrating Virtual Machines from VMware
A three-tier application has been deployed on VMware for you to migrate to OpenShift.
The application consists of the following four virtual machines:
-
One HAproxy system that redirects traffic to the web servers
-
One Linux system running a MariaDB database
-
Two Microsoft Windows servers with IIS hosting a PHP application connecting to the database
For this lab, you will be tasked with migrating three of the four virtual machines using cold migration.
You will not need to migrate the HAproxy (load balancer) VM because OpenShift handles network traffic and load balancing natively for VMs connected to the SDN using a Service. |
Review the VMware environment
To help understand the process of mapping resources, such as datastores and port groups, from vSphere into OpenShift’s equivalents, storage classes and network attachment definitions, let’s begin by reviewing the source environment for the migrations.
-
Navigate to VMware vCenter: vCenter Console
-
Click on Launch vSphere Client
-
Login with the following credentials:
-
User: {vcenter_full_user}
-
Password: {vcenter_password}
-
-
By default you’ll land in the Inventory view at the top of the navigation tree. Click the Workloads icon and expand the navigation tree until you see the folder that matches your username, and the 4 VMs under it. Click the VMs tab at the top of the screen to view the VM details.
-
Change to the Networks view, then expand the tree to view the port group used by the virtual machines. Note that the name is segment-migrating-to-ocpvirt.
-
Finally, review the datastores in use by browsing to the Datastores view. Expand the tree to see the datastores that are attached to the SDDC-Datacenter, and optionally browse to the VMs sub-tab to view the capacity used by each virtual machine.
Review the VMware provider to the migration toolkit
The Migration Toolkit for Virtualization (MTV) uses the VMware Virtual Disk Development Kit (VDDK) SDK to transfer virtual disks from VMware vSphere. The VDDK has already been configured for you in this environment.
-
Navigate in the left menu to Migration → Providers for virtualization
-
Select project mtv-{user}
MTV 2.4 and later are project/namespace aware and do not require administrator privileges. You can delegate VM imports to application teams and VM users so that they can self-serve and migrate at their own pace!
Also you may ignore the Inventory server warning. It is not necessary for the remainder of this lab.
-
By default, there is a provider called host which represents OpenShift Virtualization as a target platform.
-
The lab is already configured with the VMware provider named vmware and it is marked as a migration source.
Create a Migration Plan
Now that we have reviewed our environment, and have our providers created, it is time for us to create a Migration Plan. This plan selects which VMs to migrate from VMware vSphere to Red Hat OpenShift Virtualization and specifics about how to execute the migration.
-
Navigate in the left menu to Migration → Plans for virtualization and press Create Plan.
-
You will be asked to select the source provider that you intend to migrate from. Click on the VMware tile.
-
On the next page select the three VMs you would like to move:
-
database-{user}
-
winweb01-{user}
-
winweb02-{user}
-
-
Click Next.
-
On the next screen you will be tasked with providing details for your migration plan. Several details will already be filled in for you, but you will have to make a few minor modifications to ensure that the VMs land in the correct namespace, and that the networks and storage options map correctly.
Please fill in your migration plan with the following values:
-
Plan name: move-webapp-vmware
-
Target provider: host
-
Target namespace: vmexamples-{user}
-
Network map: Pod Networking
-
Storage map: ocs-external-storagecluster-ceph-rbd
Both the Network and Storage map will automatically detect the Network and Datastore that the discovered virtual machines currently make use of on the source provider. You will just need to make sure that their respective values are set correctly on the OpenShift side.
-
-
Click Create migration plan.
-
You will be taken to a new screen where you will see that the plan for migration is being made ready.
-
After a few moments the plan will become Ready, click on the blue "Start Migration" button to start the migration process.
-
You will be presented with a confirmation box to begin the migration, click on the Start button.
-
A progress bar will appear in the center of the screen along with the status of 0 of 3 VMs migrated.
-
Click on the 0 of 3 VMs migrated link and you will be presented with a page with more details about the migration process.
-
You can click the drop-down arrow next to the name of each VM being migrated to get additional details about the stages of the migration process.
Having many participants performing the same task in parallel in a simulated lab environment can cause this task to perform much slower than in a real environment. Please be patient with this process as it completes. You may continue with other sections in the roadshow as the migrations complete.
Also the Migration Toolkit Documentation suggests at least a 10Gb connection between the data centers - which is not something that is available in this demo.
-
After several minutes the migration has completed.
-
The selected VMs have now been migrated and can be started on OpenShift Virtualization.
Summary
In this section we explored the Migration Toolkit for Virtualization, and used it to assist with the migration of existing virtual machines from a VMware vSphere environment to OpenShift Virtualization. In addition to the Migration Toolkit for Virtualization, there are three other migration toolkits. The combination of these can be used to move many types of workloads into and within OpenShift clusters depending on your organization’s needs.
-
Migration Toolkit for Runtimes - Assist and accelerate Java application modernization and migration.
-
Migration Toolkit for Applications - Accelerate large-scale application modernization efforts to containers and Kubernetes.
-
Migration Toolkit for Containers - Migrate stateful application workloads between OpenShift clusters.
For more information about these other migration toolkits, please reach out to your Red Hat account team.