Live Migration of Workloads
Migrating workloads between compute nodes and storage types is a crucial feature of any modern hypervisor. OpenShift Virtualization allows the sumple and easy process of migrating your virtual machine compute and storage from one place to another.
In this lab, you will start by migrating the virtual machine compute from one node to another. Then, you will migrate the VM’s storage from one StorageClass to another.
Accessing the OpenShift Cluster
{openshift_cluster_console_url}[{openshift_cluster_console_url},window=_blank]
oc login -u {openshift_cluster_admin_username} -p {openshift_cluster_admin_password} --server={openshift_api_server_url}
{openshift_api_server_url}[{openshift_api_server_url},window=_blank]
{openshift_cluster_admin_username}
{openshift_cluster_admin_password}
Compute Migration to a specific node
During maintenance or troubleshooting, you might need to migrate a VM to a different node. Live migration is the process of moving a running Virtual Machine Instance (VMI) to a different node without disruption.
| This is similar to the VMware vMotion feature for VMs. |
In this lab, you will be performing a live migration of a virtual machine from one compute node to another. To do this, you will access a running VM, determine its current node, and then move it to another node.
Requirements
-
The underlying PVC must use ReadWriteMany (RWX) access mode
-
The pod network must not be configured with the bridge binding type.
-
Ports 49152 and 49153 must be available in the VM’s virt-launcher pod; live migration fails if these ports are specified in a masquerade network interface.
-
CPU model must match on the source and destination node
Instructions
-
Ensure you are logged in to the OpenShift Console as the admin user from your web browser and continue to the next step.
-
Navigate to Virtualization → Virtual Machines and then click on the virtual machine named live-migrate-vm1. Note which node the VM is currently running on under General → Node. In this example, it is worker-cluster-m2ssq-1, but your worker node will be different.
-
To migrate the VM to another worker node, click on the Actions menu, hover over Migration, and then click on Compute.
-
You will be presented with a window that asks if you would like to select the target worker node Automatically or to select a Specific Node.
-
Change the selection to Specific Node and then check the box next to a node (e.g. worker-cluster-m2ssq-1. Your lab will have a different node name).
-
Wait a few moments and you will see that the Virtual Machine status changes from Running to Migrating.
-
A few moments after that, the Virtual Machine status will return to Running. Note that the worker node is now on the new worker node (e.g. worker-cluster-m2ssq-1).
-
The VM has migrated to a new worker node while still running. Note that you will use this live migration process again later in this lab.
Compute Migration to a random node
During maintenance or troubleshooting, you might need to migrate a VM to a different node. Live migration is the process of moving a running Virtual Machine Instance (VMI) to a different node without disruption.
| This is similar to the VMware vMotion feature for VMs. |
In this lab, you will be performing a live migration of a virtual machine from one compute node to another. To do this, you will access a running VM, determine its current node, and then move it to another node.
Requirements
-
The underlying PVC must use ReadWriteMany (RWX) access mode
-
The pod network must not be configured with the bridge binding type.
-
Ports 49152 and 49153 must be available in the VM’s virt-launcher pod; live migration fails if these ports are specified in a masquerade network interface.
-
CPU model must match on the source and destination node
Instructions
-
Ensure you are logged in to the OpenShift Console as the admin user and continue to the next step.
-
Navigate to Virtualization → Virtual Machines and then click on the virtual machine named live-migrate-vm1. Note which worker node the VM is currently running on (example: worker-cluster-m2ssq-1. Your cluster will have a different node name).
-
To migrate the VM to another worker node, click on the Actions menu, hover over Migration, and then click on Compute.
-
You will be presented with a window that asks if you would like to select the target worker node Automatically or to select a Specific Node. Leave the selection at the default, which is to migrate to an Automatically selected Node
-
Wait a few moments and you will see that the Virtual Machine status changes from Running to Migrating.
-
A few moments after that, the Virtual Machine status will return to Running. Note that the worker node has changed (e.g. worker-cluster-m2ssq-3).
-
The VM has migrated to a new worker node while still running. Note that you will use this live migration process again later in this lab.
Storage Migration
Storage environments often have their own lifecycles and performance profiles, so it is important to be able to move virtual machines from one storage type to another for lifecycle and performance management. OpenShift Virtualization allows the migration of PVCs from one StorageClass to another while the virtual machine is running.
| This is similar to the VMware Storage vMotion feature for VMs. |
Instructions
-
Ensure you are logged in to the OpenShift Console as the admin user and continue to the next step.
-
Navigate to Virtualization → Virtual Machines, and select the virtualmachines project. Select the VM named live-migrate-vm1.
-
Click on the Configuration tab and select Storage. Note that the VM currently has a single bootable disk that is using the StorageClass called ocs-external-storagecluster-ceph-rbd.
-
Click on the Console tab and login to the virtual machine using the credentials above the console window. Run a command, such as
toporping, that will continue running as we perform the remainder of this exercise. -
Click on the Actions menu and hover over Migration and click on Storage.
-
In the window that appears, review the options and then click on Next. It is not necessary to change any settings at this time.
-
In the next screen, select the Destination Storage Class called custom-storage-class. Click Next.
-
Review the storage migration configuration and then click on Migrate VirtualMachine storage.
-
The next window will show you the status of the storage migration. It is safe to close the window with the X in the top corner, or you may click on the link to View storage migrations. Do not click the Stop button.
-
To view the storage migration status, navigate to Migration for Virtualization → Storage migrations where you can view the status of the migration plan. The migration plan will start in the Pending state, then move to Running, then finally Completed.
It may take some time for the migration to complete. -
Once the migration is Complete, navigate back to the virtual machine called live-migrate-vm1 and view the Configuration → Storage options again. Note that the name of the Source has changed and the Storage class has changed to custom-storage-class, which is what you selected in the storage migration plan.
-
Click on the Console tab. You will see that your application is still running uninterrupted.
















