Getting started with Red Hat OpenShift Virtualization

Red Hat® OpenShift® Virtualization allows users to run virtual machines (VMs) alongside containers on the same platform. Learn how to create, deploy, and migrate different VMs on a single platform. 

Red Hat® OpenShift® Virtualization allows users to run virtual machines (VMs) alongside containers on the same platform. Learn how to create, deploy, and migrate different VMs on a single platform. 

Migrating existing virtual machines with Red Hat OpenShift Virtualization

30 mins

In addition to creating virtual machines (VMs), Red Hat® OpenShift® Virtualization enables users to import existing VMs from other environments. In the following example, we will import machines from a VMware vSphere 8 setup, but you may import from other hypervisors. These migrations can be done cold (all source VMs are shutdown) or warm (incremental copying while VMs are running). 

What will you learn?

  • How to import a VM from an existing environment

What you need before starting:

  • Red Hat account
  • OpenShift cluster running with bare metal nodes
  • OpenShift Virtualization Operator installed on your node

Importing a virtual machine

The above video is a visual walkthrough of the steps below.
 

  1. Navigate to your web console and select Operators in the left hand menu. From the dropdown, click OperatorHub.
  2. In the new page, search and find the Migration Toolkit for Virtualization Operator operator and install it. 
    Once installed, there will be a new Migration option in the left hand menu. Select this option and click Overview from the dropdown to see completed migrations for your environment. 
  3. Click Providers for virtualization under the Migration dropdown, then click Create Provider in the upper right. 
  4. In the new page that appears, select your provider. For this example scenario, select vSphere.
    • Under Provider resource name enter in “vmware”
    • Under URL enter in the SDK for the provider. In this example it would be “http://portal.vc.opentlc.com/sdk”
    • For VDDK init image, this is if you wish to convert vmware disk images to KubeVirt format. Paste in the path here if so desired. Example: “quay.io/aa-bb-name/demo-path”
    • Then for username and password, enter in your credentials for vSphere itself. 
    • Under SSHA-1 fingerprint, provide the TLS certification for vCenter.
  5. Once done adding all relevant information, click Create provider in the lower left. 
  6. The page will refresh and show the inventory populated with the virtual machines from vSphere. 

Once finished, OpenShift Virtualization will need a migration plan to migrate the machines.

  1. From the Migration dropdown, click Plans for virtualization.
  2. Click Create plan
  3. The migration plan screen will have several fields to fill out:
    • Plan name - vm-import (you may change this however you desire)
    • Source provider - vmware
    • Target provider - host
    • Target namespace - imported-vms
  4. Proceed to VM Selection and click the SDDC-Datacenter checkbox. 
  5. Under Select VMs click to check the boxes for each VM you wish to migrate. 
  6. Proceed to Network mapping and click Create a network mapping  under the selection dropdown. 
  7. Using the default source networks, select the Pod network option under the Target namespaces/networks dropdown. 
  8. Proceed to Storage mapping and click Create a storage mapping under the selection dropdown. 
    • Each VM will be assigned their own PVC and volume. For Target storage classes, select the (default) option. 
      Under Type, select the Cold or Warm migration option as needed for your VMs. 
  9. Proceed to Hooks and add any as desired for your virtual machines before they are migrated. 
  10. Continue to the Review screen and click Finish
  11. The screen will refresh to show the migration plan and ready status. Click Start to begin your migration. 

Once the migration is started, the page will refresh to show each VM’s details,including the status and amount of data copied. Each option can be expanded to track the steps for full data copy and migration. This will take several minutes to complete depending on your environment and number of VMs.  

After the process is complete, you can view your machines under the VirtualMachines option in the Virtualization menu. From this screen, you may right-click on any machine and click Start to boot them. Clicking on the name of any VM will direct you to its status page where you can access the web console to access the machine.

Now that your machines have been successfully booted, you have completed your virtual machine migration. 

Previous resource
Creating virtual machines
Next resource
Conclusion

This learning path is for operations teams or system administrators

Developers may want to check out Developing applications on OpenShift on developers.redhat.com.

Get started on developers.redhat.com

Hybrid Cloud Logo LinkedIn YouTube Facebook Twitter

Products

Tools

Try, buy, sell

Communicate

About Red Hat

We’re the world’s leading provider of enterprise open source solutions—including Linux, cloud, container, and Kubernetes. We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Subscribe to our newsletter, Red Hat Shares

Sign up now