A try to migrate virtual machine from Openstack to Red Hat Openshift Virtualization
As I wrote in the previous article, Red Hat Openshift Virtualization allows us to run virtual machines on top of the Red Hat Openshift . One of the requirements from existing customers running applications on virtual machines is how to migrate these virtual machines onto the K8S platform, in particular the Red Hat Openshift (RHOCP).
Why is that? In addition to the reasons related to pros/cons between the virtual machine and container technology, another reason is that the release cycles of the current cloud platforms are likely longer than the K8S-based platforms, especially in the use cases of private cloud. For example, RHOCP will GA a new release in about 6 months, while Openstack community Edition also has a release life of 6 months. However, it must be noted that RHOCP is an enterprise-proven product, and with Openstack community version, Openstack-based private cloud development companies need a lot of time to upgrade to new version and then performing a lot of tasks related to testing, hardening, etc. then later on releasing the enterprise version => this takes too much time.
In this article, I will have a small demo on how to migrate a virtual machine running on the Openstack platform — namely the Red Hat Openstack Platform to the Red Hat Openshift.
- Red Hat OpenStack Platform 16.1 (RHOSP)
- Red Hat Openshift Platform 4.5
Enable Software Emulation:
We can see that virt-handler pods running on each worker node in RHOCP cluster reporting that there is NO devices.kubevirt.io/kvm in each worker node since all of my RHOCP nodes are running on AWS, not bare metal. Therefore, if we do not enable software emulation in this situation, the effort of spawning vm in RHOCP will go in vain.
Currently, Red Hat Openshift Virtualization is only running on bare metal. It means that if RHOCP is not installed and running on bare metal, it will not work. In my environment, I run RHOCP on AWS, therefore i need to enable the software emulation which is supported by QEMU. I did it by adding debug.useEmulation: “true” in the kubevirt configmap in RHOCP as below:
Demo step by step:
- I create a virtual machine (vm)in RHOSP using cirros image and create a small file called “test.txt”. The content of this file is: Hello Red Hat Openshift Virtualization.
- Take a snapshot of the above vm’s volume and then create an image from this snapshot:
3. Download this image and upload into RHOCP using “virtctl” command line.
4. Spawn a new vm in RHOCP and check the file test.txt:
I played this demo is not to say that: It is easy to migrate running, existing virtual machines from Openstack or other cloud environments onto Red Hat Openshift Virtualization. In fact, it is a hard, complex work. I just want to highlight that people are trying to do this job either manually or with the help of automation due to the realistic requirements. In fact, if we define well the factors related to storage, network which i think are the most difficult things to do migration job (except live-migration) in both environments, we can migrate from Openstack to Red Hat Openshift Virtualization. In addition, there are some ideas, projects in community that people are aiming for creating a tool to do it.