How to manage virtual machines using Red Hat OpenShift Virtualization on Red Hat OpenShift Service on AWS

Red Hat OpenShift Virtualization gives you the ability to modernize your applications—without needing to rework all of your virtual machines—on new infrastructure. Learn how to create or migrate VMs using OpenShift Virtualization on Red Hat OpenShift Service on AWS.

Red Hat OpenShift Virtualization gives you the ability to modernize your applications—without needing to rework all of your virtual machines—on new infrastructure. Learn how to create or migrate VMs using OpenShift Virtualization on Red Hat OpenShift Service on AWS.

Importing virtual machines into OpenShift Virtualization on Red Hat OpenShift Service on AWS (ROSA)

10 mins

Many organizations are looking to migrate their existing virtual machines (VMs) to new infrastructure, but may encounter difficulties in tackling the transfer process. In this resource, Alan Cowles, Technical Principal Product Manager at Red Hat, walks through the steps to import virtual machines into Red Hat® OpenShift® Virtualization on Red Hat OpenShift Service on AWS (ROSA).

What will you learn?

  • How to import VMs from other environments to OpenShift Visualization on ROSA

What you need before starting:

Importing VMs into OpenShift Virtualization on ROSA

Alan Cowles (00:00):
Hello, my name is Alan Cowles, I'm a principal product manager at Red Hat, and this is a continuing demonstration of OpenShift Virtualization running on Red Hat OpenShift Service on AWS, or ROSA. In this demonstration, we are going to import a couple of VMs from an existing hypervisor. In this case, I have a vSphere 8 environment set up with four VMs. They're all currently in a powered down state, so we can do a cold migration. But in order to do this, we are first going to install the migration toolkit operator. I've already done this actually. It's just a quick process to install the migration toolkit for virtualization operator and the forklift controller, and it gives you this neat little migration menu over here with the dynamic plug-in. We can click on the overview and see that currently, we have nothing that has migrated. We can check out the providers for virtualization. Right now, there's the default provider, which is this host cluster running as OpenShift Virtualization, and it actually shows the two VMs that are there from my previous exercise.

(01:12):
For us to continue this demo, we need to add the vCenter I just showed you a moment ago. So I'm going to click on ‘create provider,’ and the provider type is going to be vSphere, and I'm just going to call it ‘VMware.’ And we need to put in the URL of the vCenter, followed by the SDK, for the software development kit. So we're going to paste this in here. And we also have something called a VDDK image that applies to convert VMware disk images to KubeVirt format. So I've got one of those prepped and ready to go. And then, we will need our credentials to log into the vCenter itself, I'm going to go ahead and paste those in as well. And the last thing we need is actually the SHA-1 fingerprint of the TLS certificate for the vCenter. There are instructions online how to find that. So go ahead and create this provider, and we will see that it has already populated the inventory, it shows the four virtual machines in the data center.

(02:28):
The next step is to create a plan for virtualization. There's currently no plan found, so we're going to click the button, and we're going to call this ‘VM migrate,’ and our source provider is going to be the VMware environment we just created. And our target provider is going to be the host here, and we are going to put those in the imported VMs namespace. Now, we can see the data center clusters here, and we're going to go ahead and select the two Windows and one Linux database VM. We do not need the HAProxy VM for the way this application was set up, because of the way that services and routes are handled in OpenShift.

(03:20):
Now, it gives us the option to select the network mapping, and we're going to have to create one here. And if you're using the default VMware data network, you can just use the ‘pod network’ default here. And for the storage mapping, we want to take the original workload data store, and, of course, each VM will be assigned their own PVC and volume. So we're just going to choose the default storage class for that. I mentioned earlier there are two types of migration: cold, if the VMs are already shut down, which is what we're going to do here, but you can also do a warm migration with running VMs, where it does some incremental copies of data and then schedules a shutdown and cut-over point. so that's something that you can also do. So I'm going to click ‘next’ to go ahead with the cold migration. And another thing you can do is add some webhooks in, Ansible playbooks, anything you need to do to the VM before it actually starts up.

(04:15):
With that set and ready to go, we're going to go ahead and click ‘finish.’ And you can see that our cold migration plan is in place, coming from VMware to the host in OpenShift Virtualization. We're going to migrate three VMs, and we're ready to go, so let's click on ‘start.’

(04:40)
Now, you can see with the database one, the process has already started. Each one of these can be expanded to show the different steps along the way. I'm going to go ahead and click on this, but you can see there are five steps that are required along the way to initialize migration, allocate the disks, convert the VMDK image in vSphere to a KubeVirt format, and then to actually copy the data disks over, and finally create the VM.

(05:12):
So we're going to leave this one expanded to watch the process. It can take several minutes, especially moving from an on-prem environment to the cloud.

(05:26)
It can take a few minutes to complete this process, so we'll jump ahead to when it's complete, after all the data is copied. You can see now that we have completed the convert image to KubeVirt process on all three VMs, and we are currently copying the data disks.

(06:01) 
You can now see that the Linux database guest has completed its migration in about seven minutes total time. We're going to go ahead and collapse that and expand out our Windows guests as they're running, and check back in once they've completed their migration.

(06:26):
We can now see that the copying of the data disks has completed, and that both VMs are now created, so we're going to actually go over to our virtualization menu and take a look at our virtual machines. And we can actually see that we have the three that we have imported, as well as the two that we had running before. So we're going to go ahead and boot these.

(07:10)
And we'll just check on our database one, it was the first one to come up, but we can actually see, just like before, can open the VNC console, and the host is up.

(07:28)
How about over on our Windows hosts? Same scenario, go ahead and open our web console, and we can see that our guests are up.

(07:38):
Thank you for joining me for this demonstration where I used the migration toolkit for virtualization to import existing Windows and Linux VMs into OpenShift Virtualization on the Red Hat OpenShift Service on AWS, or ROSA, from an existing vSphere 8 cluster. I hope you enjoyed it.

Now that you know how to import existing VMs into OpenShift Virtualization, you’re ready to modernize your infrastructure. 


Get more support

Previous resource
Deploying virtual machines in OpenShift
Next resource
Next steps for OpenShift Virtualization

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.