Skip to content

Instantly share code, notes, and snippets.

@matbu
Created December 11, 2024 10:38
Show Gist options
  • Save matbu/003c300fd99ebfbf383729c249e9956f to your computer and use it in GitHub Desktop.
Save matbu/003c300fd99ebfbf383729c249e9956f to your computer and use it in GitHub Desktop.
VMWare to OpenStack migration - Migrate your workloads with OS-Migrate

๐ŸŒ Run Migration from VMware to OpenStack with OS Migrate

This guide demonstrates a full migration cycle from VMware to OpenStack using the OS Migrate Ansible collection. You can find all details here:

https://github.com/os-migrate/vmware-migration-kit

https://github.com/os-migrate


Overview

The example assumes you already have a conversion host deployed in your destination OpenStack cloud.

There are multiple ways to use the vmware-migration-kit:

  • Full migration: Run the provided playbook to migrate VMs.
  • Discovery mode: Collect and discover ESXi nodes and export data into a JSON file, which can be updated and reused for migration.

In this example, we will execute a full migration cycle using the playbook migration.yml.


1. Pull the OS Migrate Ansible Execution Environment (AEE)

podman pull matbu/aee-fedora-osm

2. Run the AEE Container and Get a Shell

podman run -it matbu/aee-fedora-osm /bin/bash

3. Prepare the VMware Migration Kit Repository

Navigate to the Repository

pushd /root/vmware-migration-kit/vmware_migration_kit

Optional: Update to the Latest Changes

git pull

4. Configure SSH Access to the Conversion Host

Add Your SSH Key

mkdir /root/.ssh/
cat <<EOF > /root/.ssh/conv_host
-----BEGIN OPENSSH PRIVATE KEY-----
XXX
-----END OPENSSH PRIVATE KEY-----
EOF
chmod 600 /root/.ssh/conv_host

5. Prepare the Inventory File

Create and Update inventory.yml

migrator:
  hosts:
    localhost:
      ansible_connection: local
      ansible_python_interpreter: "{{ ansible_playbook_python }}"

conversion_host:
  hosts:
    10.0.79.209:
      ansible_ssh_user: cloud-user
      ansible_ssh_private_key_file: /root/.ssh/conv_host

6. Configure Variables

Copy vars.yaml to Your Working Directory

cp ../vars.yaml .

Update the vars.yaml File

  • Set the vCenter password and VDDK thumbprint.
  • Ensure the list of VMware guests is specified in the vms section:
vms:
  - my_vmware_guest_1
  - my_vmware_guest_2

7. Retrieve the VDDK Thumbprint

Run the following command to obtain the VDDK thumbprint:

openssl s_client -connect ESXI_SERVER_NAME:443 </dev/null |
   openssl x509 -in /dev/stdin -fingerprint -sha1 -noout

8. Run the Migration

Execute the migration playbook:

ansible-playbook -i inventory.yml migration.yml -e @vars.yaml

๐Ÿ“Œ Notes

  • Replace placeholders (e.g., XXX, IPs, and paths) with actual values.
  • Ensure the conversion host and VMware environment are properly configured before running the playbook.

Happy migrating! ๐ŸŽ‰

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment