Chapter 4. Planning

The planning phase of the migration has 2 key stages:

  • Creating an infrastructure mapping
  • Creating and running a migration plan

4.1. Creating an Infrastructure Mapping

The infrastructure mapping maps your VMware resources to RHV resources.

Migration Screen

Compute Manage UI

Note

Before creating an infrastructure mapping, you must authenticate the RHV conversion hosts. Otherwise, the network will be missing in the infrastructure mapping.

  1. Click ComputeMigration and click Create Infrastructure Mapping.
  2. Enter the name of your mapping and click Next.
  3. Select a source cluster and a target cluster.

    Note

    A target cluster that does not contain a conversion host is marked with a warning icon ( warning ), which appears after a few seconds' delay for polling the clusters and refreshing the UI.

  4. Click Add Mapping and Next.
  5. Map the datastore of each cluster:

    1. Select the target cluster from the drop-down list.
    2. Select a source datastore and a target datastore.
    3. Click Add Mapping and Next.
  6. Map the network of each cluster:

    1. Select the target cluster from the drop-down list.
    2. Select a source network and a target network.
    3. Click Add Mapping.
  7. Click Create.
  8. If a successful mapping message is displayed, click Close. If the infrastructure mapping displays error messages, see Common Issues and Mistakes.

    Your infrastructure mapping is displayed in ComputeMigration.

    infrastructure mapping created

After creating an infrastructure mapping, create a migration plan.

4.2. Creating and Running a Migration Plan

Prerequisites

  • If you are migrating a large number of virtual machines or you are re-migrating virtual machines after a failed migration, create a CSV file containing a list of source virtual machines to migrate.

    The CSV file specifies the virtual machine names (mandatory) and providers (optional, for differentiating virtual machines with identical names), in the following format:

    Name, Provider
    vm01, vSphere3
    vm02, vSphere3
    vm03, vSphere3
    ...

    If you are migrating a small number of virtual machines, you can use the migration plan to discover the virtual machines. The migration plan displays a list, from which you manually select the virtual machines to migrate.

  • Check the target datastore to ensure that there are no virtual machines with the same name as a source virtual machine. A name conflict will cause the migration to fail.
  • Unmount any ISO images that are mounted on source virtual machines. A virtual machine with an attached ISO image will cause the migration to fail.
  • Check that the source virtual machine disks are unencrypted. The current IMS version does not support the migration of encrypted disks.

Procedure

  1. Click ComputeMigration and click Create Migration Plan.
  2. Select the infrastructure mapping from the drop-down list.
  3. Enter the name of your migration plan.
  4. Discover the virtual machines:

    • If you are using the migration plan to discover the virtual machines automatically:

      1. Select Choose from a list of VMs discovered in the selected infrastructure mapping.
      2. Click Next.

        Discovered Virtual Machines

        Discover VMs

    • If you are importing a CSV file:

      1. (Optional) To validate your infrastructure mapping, select Choose from a list of VMs discovered in the selected infrastructure mapping and click Next. If your virtual machines appear in the list, the infrastructure mapping is correct. Click Back.
      2. Select Import a CSV file with a list of VMs to be migrated and click Next.
      3. Click Import, browse to the CSV file, and click Open.
  5. Select the virtual machines to migrate and click Next to go to Advanced Options.

    Advanced Options

    Advanced Options

    Select an Ansible playbook service catalog item if you are automating pre- or post-migration tasks.

  6. Select Start Migration Immediately and click Create.
  7. Click Close. The migration plan may take some time to complete. In Progress Plans, the amount of data being transferred, the number of virtual machines being migrated, and the elapsed time are displayed. To view the migration progress of individual virtual machines, click the migration plan to go to the migration plan details.

    When the migration is complete, the migration plan is displayed under Completed Migrations, with the number of successfully migrated virtual machines. A Retry option enables you to re-migrate any virtual machines in this plan that failed to migrate. See Retrying a Migration Plan. For other errors, see Common Issues and Mistakes.

Note

During migration, the counter displaying the migration plan progress (in ComputeMigration) may be a few seconds ahead of the counter that appears in the migration plan details (ComputeMigrationMigration Plan). This is because the migration plan counter displays the total time to run the migration plan, while the migration plan details counter displays the time to migrate the virtual machines.

4.3. Advanced Migration Option: Automating Pre- and Post-Migration Tasks with Ansible

Red Hat Infrastructure Migration Solution enables you to use Ansible playbooks to automate tasks on virtual machines before or after migration. For example, use a playbook to remove web server virtual machines from a load-balancing pool before migration and adding them back to the pool after migration. You create an Ansible service catalog item that contains the playbook and select it while creating the infrastructure migration plan.

Use the IMS RHEL Pre-migration Ansible Playbook Example to configure the target Red Hat Enterprise Linux virtual machines.

Creating an Ansible Service Catalog Item

The CloudForms inventory must contain at least one Ansible repository, one playbook, and one credential.

IMS RHEL Pre-migration Ansible Playbook Example

The ims.rhel_pre_migration role configures a target Red Hat Enterprise Linux virtual machine for migration by performing the following tasks:

  • Preserving the static IP address configuration
  • Installing the Red Hat Virtualization guest agent

This example registers a virtual machine with a Satellite 6 server and enables the rhel-7-server-rpms repository. If no variables are provided, the playbook assumes that the repositories are already configured and installs the guest agent while maintaining the static IP address.

---
- hosts: all
  vars:
    rhsm_config:
      server_hostname: "satellite.example.com"
      server_username: "admin"
      server_password: "password"
      org_id: "organization"
    rhsm_repositories:
      - "rhel-7-server-rpms"
  roles:
    - role: ims.rhel_pre_migration