Introduction
The goal of this document it to offer a solution to automate the migration from other hypevisor solutions to Oracle Linux KVM managed by Oracle Linux Virtualization Manager (OLVM).
This version of the document covers the automated migration from VMware vSphere.
Migration from VMware vSphere / ESXi
The semi-automated migration procedure relies on the following components:
- libvirt, qemu and virt-v2v correctly installed and configured on an Oracle Linux KVM host
- Network access (ssh or https) to VMware vSphere
Requirements and Assumptions
- VMware hosts and manager (source) and Oracle Linux KVM/Oracle Linux Virtualization Manager (destination) hosts are network reachable to each other
- Oracle Linux Virtualization Manager and VDSM releases are >= 4.5
- ovirt-engine-4.5.4-1.el8 RPM or higher is installed on the Oracle Linux Virtualization Manager host
- vdsm-4.50.3.4-1 RPM or higher is installed on the Oracle Linux KVM Server
- virt-v2v-1.42.0-22 or higher is installed on the Oracle Linux KVM Server
- At least one Oracle Linux KVM host and a Storage Domain have already been configured on Oracle Linux Virtualization Manager and are up and running
Setup
With the proper Oracle Linux Virtualization Manager / Oracel Linux KVM configuration up and running, proceed with following steps:
Verify “qemu-block-curl” RPM is installed on the desired Oracle Linux KVM Server (the server where the migration will be managed/executed)
| [root@kvm: ~]# dnf install qemu-kvm-block-curl |
- Create the two password files that will be used by the migration process
| # echo <vmware-admin-password> > /root/v2v/vmware-admin-password # echo <olvm-admin-password> > /root/v2v/ovirt-admin-password |
- Copy the “Oracle Linux Virtualization Manager” certificate on the KVM host
On KVM host we need the Oracle Linux Virtualization Manager certificate, required to get access to the web-server during the migration process; the same can be easily copied with the following command on KVM host
| # scp root@<OLVM-FQDN>:/etc/pki/ovirt-engine/ca.pem /root/v2v/ca.pem |
Migration Process from VMware vSphere
Once the “Setup” phase above has been completed we can proceed to the Virtual Machine (VM) Migration.
To correctly get the Virtual Machine migrated, the VM must be shutdown on the source hypervisor (VMware vSphere).
- Connect by “ssh” to the KVM Host where “virt-v2v” will be used
- By “root”, execute the following command to get the list of Virtual Machines and their state on VMware vSphere
| # virsh -c vpx:// vsphere-domain>%5c<vsphere-user>@<vsphere-host>/Datacenter/<vsphere-datacenter-name>?no_verify=1 list –all # virsh -c vpx://vsphere.local%5cAdministrator@topgear.demo.com/Datacenter/topgear.demo.com?no_verify=1 list –all |
Output Example:
| [root@v2v-app: ~/v2v]# virsh -c vpx://vsphere.local%5cAdministrator@topgear.demo.com/Datacenter/topgear.demo.com?no_verify=1 list –all |
- By “root”, execute the following command to get a Virtual Machine directly migrated from VMware vSphere to Oracle Linux KVM
- OLVM-FQDN-HOST refers to the Oracle Linux Virtualization Manager hostname
- VMware vSphere URL has to be correctly identified and implemented
- If you are migrating to FC/iSCSI Storage Domain following argument needs to be added to your virt-v2v command: “-oa preallocated”.
| export LIBGUESTFS_BACKEND=direct # virt-v2v –ic vpx://<vsphere-domain>%5c<vsphere-user>@<vsphere-host>/<vsphere-datacenter-name>?no_verify=1 <vm-name> –password-file /root/v2v/vmware-admin-password -o rhv-upload –oc https://<olvm-fqdn-host>/ovirt-engine/api –os <olvm-storage-domain> -op /root/v2v/ovirt-admin-password –oo rhv-cafile=/root/v2v/ca.pem –oo rhv-cluster=<olvm-cluster-name> -of raw –oo rhv-direct –bridge <olvm-bridge-name> |
Example:
| export LIBGUESTFS_BACKEND=direct #virt-v2v –ic vpx://vsphere.local%5cAdministrator@topgear.demo.com/topgear.demo.com?no_verify=1 ol7-reiserfs –password-file /root/v2v/vmware-admin-password -o rhv-upload –oc https://ovirt.demo.com/ovirt-engine/api –os local-u01 -op /root/v2v/ovirt-admin-password –oo rhv-cafile=/root/v2v/ca.pem –oo rhv-cluster=ol7-cluster -of raw –oo rhv-direct –bridge ovirtmgmt |
Further options to migrate from VMware vSphere
Feedback from the field reported that this option could be faster while migrating from VMware vSphere to Oracle Linux KVM.
- Locally copy the virtual machine from VMware vSphere
| # virt-v2v-copy-to-local –ic esx://root@ESX-FQDN-OR-IP?no_verify=1 <vm-name> |
- Import the local virtual-machine to Oracle Linux KVM
| export LIBGUESTFS_BACKEND=”direct” virt-v2v \ |
[OPTIONAL] Enable debug options for virt-v2v
- If you want to enable “debug” for the entire process, add the following options to the syntax above:
| # virt-v2v -v -x –ic vpx://…………… |
Post Migration Steps
Once the migration is completed, the Virtual Machine will appear on “Oracle Linux Virtualization Manager” Browser User Interface.
- We can now edit the “Virtual Machine“, change the “VM-Name” and “Description“, verify “vNIC configuration/association” to then confirm the changes with “OK” button.
- Start the Virtual Machine on “Oracle Linux Virtualization Manager / Oracle Linux KVM“
