VM Migration with the Ansible Automation Platform

In the previous module, you saw how easy it is to migrate VMs from VMware to OpenShift Virtualization using the Migration Toolkit for Virtualization (MTV).

While this process is effective and doesn’t take too long to complete, how can we speed up the process and achieve scale when needed?

Here, we introduce Ansible Automation Platform (AAP) to the mix.

Ansible Automation Platform

Let me show you how easy it is to migrate from VMware to OpenShift Virtualization with Ansible Automation Platform.

mtv ansible architecture 01

Here, we have an architectural diagram showcasing each phase from Day 0 to Day 2 of the VM lifecycle.

The focus today is on Day 1 and how we can leverage the capabilities of the MTV and AAP to simplify and automate the migration process.

The manual process is efficient and only took a few minutes to complete. But how can we accelerate and scale this process when necessary? To address this, we incorporate the Ansible Automation Platform.

DO:

  1. Navigate to the AAP Controller

    1. Log in if necessary:

      • Username: placeholder_aap_controller_admin_user

      • Password: placehoder_aap_controller_admin_password

  2. Click on Templates in the left menu, and then click on 01 Migrate VMware VMs to OpenShift Virtualization.

SAY:

Ansible Automation Platform provides Templates to simplify interaction with the automation Jobs that automate your apps and systems.

Here, we have the configuration of a template to migrate virtual machines.

Of note, are the Inventory, which is the list and details of hosts known to the system and provided to the Template, as migration sources are targets.

The Playbook is the actual Ansible code that drives the migration process.

Other settings handle scale, reporting detail level, and credentials applied to this Template.

DO:

  1. Click Launch.

01 ansible migration template details

SAY:

The job template handles all the prerequisites, but we still need to answer some questions in our customizable Ansible survey, such as the names of the VMs we wish to migrate.

Prepopulated here are the Name of your provider? which might be one of several if you have a very complex environment.

The Name of your migration plan, storage mapping, and network mapping have been given defaults that you are encouraged to change.

We need to choose a VM that has not been migrated yet. In the first module, we manually migrated the database and winweb01 machines. So here, we will migrate the remaining VM: winweb02.
01 ansible migration template survey

DO:

  1. Enter the name of the VM you would like to migrate into the Ansible survey.

    winweb02
  2. Click Next to continue.

01 ansible migration template preview
  1. Click Launch to start the migration process.

    The display might not refresh automatically. Refresh your browser to see the Ansible Job Output.
01 ansible migration job output

SAY:

This time we can see the process just takes us a little less than 30 seconds to complete.

We can now take a look at the migration job itself and see it running, setting up everything for us, such as the provider creation, the network and storage maps, and even the migration plan itself.

DO:

  1. Navigate to the OpenShift Console

  2. Click Migration in the left menu, and then click Plans for Virtualization.

  3. Make sure you’re in the openshift-mtv namespace. You might have to select Show default projects to access it.

If you see a Start button, don’t click it. Automation will catch up and start the migration for you.

ansible migration plan

SAY:

Now, within the OpenShift Console, you can see that everything has been pre-created for us thanks to the Ansible Automation Platform.

The migration has been been started for us, as well.

DO:

  1. Click on the NetworkMaps for virtualization on the left menu, and indicate the new network map created by AAP.

  2. Click on the StorageMaps for virtualization on the left menu, and indicate the new storage map created by AAP.

  3. Return to the Plans for virtualization on the left menu, and click on the migration-plan.

  4. Click on the YAML tab, and highlight the names of the virtual machines to be migrated (around lines 65 through 90 in the YAML).

SAY:

Ansible Automation Platform has started the VM migration plan, and the winweb02 VM migration commences.

If you prefer, you can setup the Ansible job to only prepare the migration process, and rely on you to click the Start button.

With the Ansible Automation Platform, you have total control over how and what you want to automate. Not to mention the increased speed and reduction in manual steps, which eliminates the element of human error. By automating your workflows, you ensure consistency as you scale out your migration process.

Summary

SAY:

In this demo, we used the AAP to migrate our VMs to OpenShift Virtualization, bringing automation to the process and all the benefits that come with it: speed, scale, and consistency.

Furthermore, we can now easily integrate this process with other automation workflows and automate the lifecycle of your virtual machines. While Day 2 and Day 3 operations are not covered in this demo, there are separate resources available to assist you with those.

In addition to the Migration Toolkit for Virtualization, there are three other migration toolkits.

The combination of these can be used to move many types of workloads into and within OpenShift clusters depending on your organization’s needs.

For more information about these other migration toolkits, please reach out to your Red Hat account team.

DO:

Please delete this demo from the Red Hat Demo Platform as soon as you have completed practicing or delivering the demo to your customer.