Migrate VMware vSphere to Oracle Linux KVM

Version 4

    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.

     

    Screen Shot 2020-04-07 at 11.49.48 AM.png

     

    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/OLVM (destination) hosts are network reachable to each other
    • OLVM/VDSM releases are >= 4.3
      • ovirt-engine-4.3.6.6-1.0.9 RPM or higher is installed on the Oracle Linux Virtualization Manager host
      • vdsm-4.30.33-1.0.3 RPM or higher is installed on the Oracle Linux KVM Server
    • virt-v2v-1.40.2-5.0.1 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 OLVM and are up and running
      • Local on Host, Posix-Compliant FS and NFS are suitable options for direct VM import/migration
      • Fiber Channel / iSCSI storage domains are not suitable for direct VM import/migration
      • Once imported VMs can be migrated to other storage domain options, like Fiber Channel / iSCSI

     

    Setup

    With the proper OLVM/OL-KVM configuration up and running, proceed with following steps:

    • Install "qemu-block-curl" RPM on the desired OL-KVM Server (the server where the migration will be managed/executed)

     

    # yum install oraclelinux-developer-release-el7 yum-utils -y
    # yum-config-manager --enable ol7_developer_kvm_utils
    # yum install qemu-block-curl
    

     

    NB: the only RPM that should be installed from "ol7_developer_kvm_utils" Yum channel is "qemu-block-curl";

    In order to keep the entire system supported by Oracle, other packages should be updated from "ol7_kvm_utils" Yum channel.

    To accomplish this requirement, execute following step:

     

    • Edit "/etc/yum.repos.d/oraclelinux-developer-ol7.repo" and add following line:

     

    [ol7_developer_kvm_utils]
    name=Oracle Linux $releasever KVM Utilities for Development and test ($basearch)
    baseurl=https://yum$ociregion.oracle.com/repo/OracleLinux/OL7/developer/kvm/utils/$basearch/
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
    gpgcheck=1
    enabled=1
    includepkgs=qemu-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 OLVM certificate, required to get access to the OLVM 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/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
    Enter vsphere.local\Administrator's password for topgear.demo.com:
     Id    Name                           State
    ----------------------------------------------------
     12    VMware vCenter Server Appliance running
     23    OEL_8_1b_64bit_from_vCenter    running
     24    OEL_7_7_64bit_from_vCenter_test_vpx running
     25    OEL_7_7_64bit_python2          running
     -     CentOS_7                       shut off
     -     OEL7                           shut off
     -     OEL_7_7_64bit_from_vCenter     shut off
     -     OEL_8_1_64bit_from_vCenter     shut off
     -     ol7-reiserfs                   shut off
     -     template_OEL7_7_64bit_python2  shut off
    

     

    • By “root”, execute the following command to get a Virtual Machine directly migrated from VMware vSphere to OL KVM/OLVM

     

    OLVM-FQDN-HOST refers to the Oracle Linux Virtualization Manager hostname

     

     

    VMware vSphere URL has to be correctly identified and implemented

     

    export LIBGUESTFS_BACKEND=direct
    

     

    # virt-v2v -ic vpx://<vsphere-domain>%5c<vsphere-user>@<vsphere-host>/Datacenter/<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>
    
    # 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
    

     

    If you want to enable “debug” for the entire process, add the following options to the syntax above:

     

    # virt-v2v -v -x -ic vpx://……………

     

     

    Virt-v2v cannot directly work with VMware ESX hosts starting from VMware vSphere 5.0 and beyond; so the only option is to leverage the connection to the VMware vSphere (as in the example above).

     

    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 start the same Virtual Machine on OL KVM/OLVM:
    • Start the Virtual Machine on "Oracle Linux Virtualization Manager / Oracle Linux KVM"