Home VM Migration Data Migration: How to Migrate VMware to OpenStack in 3 Ways?

Data Migration: How to Migrate VMware to OpenStack in 3 Ways?

2022-09-07 | Iris Lee

Table of contents
  • 1. Method 1: Using VirtIO drivers
  • 2. Method 2: Using qemu-img tool
  • 3. Method 3: Using the one-and-done solution

12067354_4884451 (1).jpg

On 26th, May 2022, Broadcom made an unsolicited takeover offer of $61 billion to VMware, which they accepted and stirred up the worry about the likely price rises. 40% of VMware customers surveyed expressed negative sentiments because of multiple reasons, and one of them is “influence on software license terms and conditions that could occur”, according to the analyst company S&P Global Market Intelligence.

Their fears are not entirely misplaced considering the precedent that numerous clients complained about substantial out-the-door pricing hikes during renewals, with little room for negotiation, after Broadcom acquired CA Technologies and Symantec.

Customers make every effort to avoid having to agree to price increases. Some of them lock in long-term pricing before the deal completes, and others are considering migrating to other virtualized infrastructures. As an open-source cloud computing platform with flexibility and adaptability, OpenStack comes to their notice. By switching virtual machines from VMware to OpenStack, they may drastically lower the TCO (Total Cost of Ownership) of setting up and maintaining their IT infrastructure. Economic comparison between OpenStack and VMware reveals that, in some cases, costs can be reduced by a full order of magnitude.

Without further ado, let’s come straight to the point. Data migration from VMware to OpenStack can be divided into 3 ways as follows, you can choose what works best for your business.

1.    Method 1: Using VirtIO drivers

1)      Add VirtIO drivers

Since some systems don’t boot from VirtIO hardware by default, you may take extra steps to install the VirtIO drivers into them.

2)      Expand partitions (optional)

This step is for the servers with limited free disk space on their partition. Use the VMware-vdisk manager tool with the ‘-x’ argument to increase the disk size. The partition must then be expanded from the operating system. In the following stage, when customizing the virtual machine, you can accomplish that.

3)      Customize Virtual Machine (optional)

You may want to remove some software (such VMware Tools and drivers) and other things to get the operating system ready to work in OpenStack. Writing a script that performs this for you will allow you to automate the process. The script and files should be able to be added to the virtual drive using the virt-copy-in command.

4)      Create Cinder volumes

Create a Cinder volume of the same size as each disk you want to import.

Create the volume with following command lines:

cinder create --display-name <name_of_disk> <size> --volume-type <volumetype>

In order to proceed with the next step, we will need the volume ids, which you can also find by running the following command.

cinder list | grep <name_of_disk>

5)      Transform VMDK into Ceph

Remove the actual Ceph disk named the volume ids we noted in the previous step from the Ceph pool.

rbd -p <ceph_pool> rm volume-<volume-id>

Convert the VMDK file into the volume on Ceph (repeat this step for all virtual disk of the VM). The full path to the VMDK file is contained in the VMDK disk file variable. The ID that you previously noticed is volume-id.

qemu-img convert -p <vmdk_disk_file> -O rbd rbd:<ceph_pool>/volume-<volume-id>

6)      Create a Neutron port (optional)

Build a port with neutron and use it in the next step (note its id). You need to know the network name as the label. Add security groups based on this command line:

--security-group <security_group_name>

Add this parameter for each security group:

neutron port-create --fixed-ip ip_address=<ip_address> --mac-address <mac_address> <network_name> --name <port_name>

7)      Create and launch the instance in OpenStack

To find the flavor-id of the desired flavor, use the nova flavor-list command.

Now create and launch the new instance.

nova boot <instance_name> --flavor <flavor_id> --boot-volume <boot_volume_id> --nic port-id=<neutron_port_id>

Remember the instance ID. Add each subsequent instance disk by the command (if there are other volumes you wish to add):

nova volume-attach <instance_ID> <volume_id>

2.    Method 2: Using qemu-img tool

1)    Export the VMware VM in OVF format.

Extract the CentOS1- disk1.vmdk file from the.ovf using the decompression tool tar -xvf, and then upload the file to the OpenStack server.

2)    Convert VMDK to qcow2 format using qemu-img tool.

qemu-img convert -f vmdk CentOS1-disk1.vmdk -O qcow2 CentOS1JMH.qcow2

3)    Import it to OpenStack.

openstack image create "CentOS1-fvmware"

  --file CentOS1JMH qcow2c

  --disk-format qcow2 --container-format bare

  --public

4)    Create an instance.

Create an instance from the CentOS1JMH image you just uploaded. If it fails, delete the failed instance and select the newly created CentOS1 volume and launch as an instance from it.

Problems like disk couldn’t be found can be fixed through the following steps:

a)      Click the SendAltCtrl in the upper right corner of the control, and click several times to restart VMware.

b)      Choose to boot from the second CentOS rescue when VMware boots to Grub.

c)      After activating safe mode, log in to the virtual machine using SSH.

d)      Check whether the vda1 hard disk of OpenStack is mounted to the /boot directory. mount /dev/vda1 /boot.

e)      Create a boot area:

sudo dracut -f /boot/initramfs-$(uname -r).img $(uname -r)

Then, reboot it. Check out logs if it fails.

Instance startup log:

sudo journalctl -a -u devstack@n-cpu.service | grep ERROR

Volume creation log:

sudo journalctl -a -u devstack@c-vol.service | grep ERROR

3.    Method 3: Using the one-and-done solution

Vinchin Backup & Recovery is a versatile data solution for 10+ main stream virtualizations including VMware and OpenStack, whose Cross-Platform Recovery features as the integrated V2V migration tool that allows the seamless data migration across these platforms without other instruments.

By creating backups of the source virtualization and restoring them to the target virtualization, Vinchin Backup & Recovery simply completes the V2V migration that takes other methods numerous steps.

1)    Select the restore point.

Click VM Backup > Restore and select the VMware restore point you desire to migrate.

dd9c503964050da5315a6e7278ba4b1.png

2)    Select the restore destination.

The restore destination should be one of your OpenStack target hosts. Once you've chosen the restoration point, you can adjust the name, CPU, RAM, whether to restart the virtual machine after the restore, and other options.

130160a5786c62b1603a1ca705ffc45.png

c751b280ebde7010655706dec7d3148.png

3)    Customize the restore strategies.

Specify all kinds of restore strategies here including general and transmission ones (optional).

235fb84a51de68a841d77c8dc38ae12.png

Submit the job after you’ve done with the configurations. The V2V migration from VMware to OpenStack now finishes once the task ends, and you can see the newly created OpenStack VM in your virtualized infrastructure.

The once-complex data migration from VMware to OpenStack concludes with 3 steps and requires no command lines because of Vinchin Backup & Recovery, which integrates VM backup, data recovery, and V2V migration into one software to maximize operational efficiency. You can download the free trial of the solution and explore more practical features such as data reduction and anti-ransomware protection now.  

Share on:

Categories: VM Migration