VMware vSphere is a virtualization and cloud computing platform that provides a suite of virtualization products for creating and managing virtualized data centers. Developed by VMware, Inc., vSphere is widely used in enterprise environments to enable organizations creating and managing virtualized infrastructures. The platform allows multiple virtual machines (VMs) to run on a single physical server.
In this blogpost we will show, how to migrate an existing VMware vSphere instance, in our example a Debian 12 instance, to Exoscale.


Current setup/configuration on VMware

root@vmwaredebian12:~# df -h
Filesystem                   Size  Used Avail Use% Mounted on
udev                         1.9G     0  1.9G   0% /dev
tmpfs                        392M  516K  392M   1% /run
/dev/mapper/debian--vg-root  4.4G  1.3G  2.9G  31% /
tmpfs                        2.0G     0  2.0G   0% /dev/shm
tmpfs                        5.0M     0  5.0M   0% /run/lock
/dev/vda1                    455M   58M  372M  14% /boot
tmpfs                        392M     0  392M   0% /run/user/0
tmpfs                        392M     0  392M   0% /run/user/1000


Pre-Tasks for the migration

Before diving into the technical details:


  • Comment out non OS Mountpoints in /etc/fstab, otherwise the instance may be stuck in single user mode during initial boot on Exoscale.
  • Identify bootmode from instance (Legacy=BIOS or UEFI)
  • Create an Exoscale IAM Key for Exoscale CLI and Template registration.
  • Create an Exoscale SOS Bucket for Template registration.
  • Create an Ubuntu Instance with qemu-utils installed and Exoscale CLI installed and configured.


Prerequesites for the migration

  • Root password from VMware Instance.
  • VMDK disk image from VMware Instance.


Step 1: Copy VMDK disk image to the Ubuntu Instance

Use a tool of your choice (e.g.: scp/sftp) to upload the VMDK disk image to the Ubuntu Instance.

Step 2: VMDK to QCOW2 migration

As Exoscale uses QCOW2 as file format for disk images, we will need to migrate the VMDK image to QCOW2.

qemu-img convert -O qcow2 -p debain-12-flat.vmdk debain-12-flat.qcow2

Step 3: Check virtual disk size and resize if needed to 10G

In our case we have a virtual disk size of 6G, so we will need to resize it to 10G.

qemu-img info debain-12-flat.qcow2
image: debain-12-flat.qcow2
file format: qcow2
virtual size: 6 GiB (6442450944 bytes)
disk size: 2.42 GiB
cluster_size: 65536
Format specific information:
    compat: 1.1
    compression type: zlib
    lazy refcounts: false
    refcount bits: 16
    corrupt: false
    extended l2: false

qemu-img resize debain-12-flat.qcow2 10G
Image resized.

qemu-img info debain-12-flat.qcow2
image: debain-12-flat.qcow2
file format: qcow2
virtual size: 10 GiB (10737418240 bytes)
disk size: 2.42 GiB
cluster_size: 65536
Format specific information:
    compat: 1.1
    compression type: zlib
    lazy refcounts: false
    refcount bits: 16
    corrupt: false
    extended l2: false

Step 4: Calculate md5sum

You will need this checksum later to register the template.

md5sum debain-12-flat.qcow2
85ea29d7cee21bcfe22d3cca0fd350b6  debain-12-flat.qcow2

Step 5 Upload QCOW2 disk image to an Exoscale SOS Bucket

exo storage --acl public-read upload debain-12-flat.qcow2 sos://vmware-migration-exoscale/debain-12-flat.qcow2
debain-12-flat.… [==============================================================================] 2.42 GiB / 2.42 GiB | 1m46s

Step 6: Register Instance as a custom template

This Debian Instance is using legacy(BIOS) bootmode, if your instance uses UEFI please change boot-mode parameter to uefi in the command below.

exo compute instance-template register \
  --boot-mode legacy \
  --build "Debian 12 Vmware Migration" \
  --description "Debian 12 Vmware Migration" \
  --username root \
  -z de-fra-1 \
  debian_vmware_12 \
  https://sos-at-vie-2.exo.io/vmware-migration-exoscale/debain-12-flat.qcow2 \
  85ea29d7cee21bcfe22d3cca0fd350b6
 ✔ Registering template "debian_vmware_12"... 1m42s
┼──────────────────┼──────────────────────────────────────┼
│     TEMPLATE     │                                      │
┼──────────────────┼──────────────────────────────────────┼
│ ID               │ 3ba94ffb-94b7-4257-8ec5-5065cc11fc42 │
│ Zone             │                                      │
│ Name             │ debian_vmware_12                     │
│ Description      │ Debian 12 Vmware Migration           │
│ Family           │ other (64-bit)                       │
│ Creation Date    │ 2024-01-29 16:47:56 +0000 UTC        │
│ Visibility       │ private                              │
│ Size             │ 10 GiB                               │
│ Version          │                                      │
│ Build            │ Debian 12 Vmware Migration           │
│ Maintainer       │                                      │
│ Default User     │ root                                 │
│ SSH key enabled  │ true                                 │
│ Password enabled │ true                                 │
│ Boot Mode        │ legacy                               │
│ Checksum         │ 85ea29d7cee21bcfe22d3cca0fd350b6     │
┼──────────────────┼──────────────────────────────────────┼

Step 7: Change Template back to private on SOS

❯ exo storage setacl sos://vmware-migration-exoscale/debain-12-flat.qcow2 private
┼───────────────┼────────────────────────────────────────────────────────────────────────────┼
│    STORAGE    │                                                                            │
┼───────────────┼────────────────────────────────────────────────────────────────────────────┼
│ Path          │ debain-12-flat.qcow2                                                       │
│ Bucket        │ vmware-migration-exoscale                                                  │
│ Last Modified │ 2024-01-30 13:24:50 UTC                                                    │
│ Size          │ 2.4 GiB                                                                    │
│ URL           │ https://sos-at-vie-2.exo.io/vmware-migration-exoscale/debain-12-flat.qcow2 │
│ ACL           │                                                                            │
│               │   Read           -                                                         │
│               │   Write          -                                                         │
│               │   Read ACP       -                                                         │
│               │   Write ACP      -                                                         │
│               │   Full Control   vmware-migration-org                                      │
│               │                                                                            │
│ Metadata      │                                                                            │
│ Headers       │                                                                            │
│               │   Content-Type   application/octet-stream                                  │
│               │                                                                            │
┼───────────────┼────────────────────────────────────────────────────────────────────────────┼

Step 8: Deploy Instance from custom template

exo compute instance-template list -v private -z de-fra-1
┼──────────────────────────────────────┼─────────────────────────────┼────────────────┼───────────────────────────────┼
│                  ID                  │            NAME             │     FAMILY     │         CREATION DATE         │
┼──────────────────────────────────────┼─────────────────────────────┼────────────────┼───────────────────────────────┼
│ 3ba94ffb-94b7-4257-8ec5-5065cc11fc42 │ debian_vmware_12            │ other (64-bit) │ 2024-01-29 16:47:56 +0000 UTC │
┼──────────────────────────────────────┼─────────────────────────────┼────────────────┼───────────────────────────────┼

exo compute instance create \
  --template debian_vmware_12 \
  --template-visibility private \
  --security-group default \
  --ssh-key myKey \
  -z de-fra-1 \
  vmwaredebian12
 ✔ Creating instance "vmwaredebian12"... 18s
┼──────────────────────┼──────────────────────────────────────┼
│   COMPUTE INSTANCE   │                                      │
┼──────────────────────┼──────────────────────────────────────┼
│ ID                   │ a463836d-3d4f-40ec-b461-b226f380eb0f │
│ Name                 │ vmwaredebian12                       │
│ Creation Date        │ 2024-01-29 16:55:47 +0000 UTC        │
│ Instance Type        │ standard.medium                      │
│ Template             │ debian_vmware_12                     │
│ Zone                 │ de-fra-1                             │
│ Anti-Affinity Groups │ n/a                                  │
│ Deploy Target        │ -                                    │
│ Security Groups      │ defaul                               │
│ Private Instance     │ No                                   │
│ Private Networks     │ n/a                                  │
│ Elastic IPs          │ n/a                                  │
│ IP Address           │ 194.182.171.217                      │
│ IPv6 Address         │ -                                    │
│ SSH Key              │ myKey                                │
│ Disk Size            │ 50 GiB                               │
│ State                │ running                              │
│ Labels               │ n/a                                  │
│ Reverse DNS          │                                      │
┼──────────────────────┼──────────────────────────────────────┼

Step 9: Reconfigure Network settings

Log in to the instance using Exoscale Console and reconfigure the network settings. This is needed as the instance is getting a new network device.

Step 10: Copy all remaining data

Use a tool of your choice (e.g.: tar/rsync or backup/restore) to copy all remaining data to your instance.

Optional Step: Install cloud-init

With cloud-init you will be able to leverage the disk resize and password reset feature for your instance from Exoscale. Take care as this might change the SSH Host key from your instance.

apt-get install cloud-init


Conclusion

In summary, migrating a virtual instance from VMware vSphere to Exoscale involves a step-by-step process designed to ensure a seamless transition without compromising on data integrity and system functionality. By addressing prerequisites, such as adjusting the system configuration and obtaining essential credentials and disk images, users can successfully navigate the migration journey.

From copying the VMDK disk image to the Ubuntu instance and converting it to the required QCOW2 format, to registering the custom template on Exoscale and deploying the new instance, each step is carefully detailed to provide a comprehensive guide for users transitioning their virtualized environments. The guide emphasizes the flexibility and scalability offered by Exoscale, coupled with meticulous planning and execution, to make the migration process efficient and effective.

The inclusion of optional steps, such as installing cloud-init for enhanced instance management, underscores the adaptability of the migration process to meet specific user requirements. Ultimately, this guide equips users with the knowledge and tools needed to seamlessly migrate their VMware vSphere instances to Exoscale, unlocking the benefits of Exoscale’s cloud infrastructure.

Please be aware that a template fee and an instance fee are applicable for each deployed/migrated instance.