Skip to content

Latest commit

 

History

History
499 lines (344 loc) · 17.8 KB

00-redhat_solutions-insfrastructure_migration_lab.adoc

File metadata and controls

499 lines (344 loc) · 17.8 KB

Red Hat Solutions: IT Optimization - Infrastructure Migration

1. Overview

This demonstration uses Red Hat CloudForms as a broker to drive virtual-to-virtual tools such as ovftool and virt-v2v to migrate VMs from VMware vSphere to Red Hat Virtualization. During the demostration, the resources need ot be mapped in order to perform the migration.

The initial mappings are related to the Virtualization capabilities, which in this case, we will use the following:

  • Point of Departure (POD): VMware vSphere

  • Point of Arrival (POA): Red Hat Virtualization

    • Point of Arrival type: RHEV

This way we define the origin and destination of the VMs taking into account the type of infrastucture where they will be hosted. There is work in progress to enable OpenStack as a valid Point of Arrival.

After this initial mapping, the VMs to be migrated will require the following information:

  • Attributes: specifying the type of migration to be performed on the VM

  • Tags: Identifying the VMs and assigning (if needed) the network configuration tranformation

  • Migration group: Name of the group of VMs to be migrated toghether. It is assigned in through the tags and attributes

All the mappings can be seen in CloudForms as a capability internally named Tags, which is extended information added to any of the objects being managed (VMs, Virtualizaiton Infrastructure, Cloud Infrastructures, etc).

Once everything id properly identified and mapped, t will allow us to prepare the full migration and execute it as a batch in an intervention window.

The migration is executed in two phases:

  • Pre-migration: VMs get checked to ensure that the migration will be successful. Once checks are passed they are taggeg as "pre-migration successful"

  • Migration: All the VMs with the successful pre-migration tag will be assigned to worker machines that will perform the migration.

Goal
  • Migrate several VMs from vSphere to Red Hat virtualization with a Red Hat Solution: Infrastructure Migration

    Note
    The source VM’s are still maintained post migration and are not deleted. This allows for "failback" if a migration failure occurs.

Current versions of products used:

Product Version

CloudForms

4.5

Red Hat Virtualization

4.1

VMware vSphere

5.5

1.1. System Requirements

  • Firefox 17 or higher, or Chromium / Chrome

    Note
    Internet Explorer is not recommended.
  • Adobe Flash 15 or higher must be enabled in Firefox or Chromium used for vCenter connectivity

  • SSH client

1.2. Environment

A full new demo environment is deployed on every request. To make the environment unique a 4 character identifier is assigned to it (i.e. 1a2b), this identifier is referred in this documentation as GUID.

The demo environment consists of the following systems:

Architecture Diagram
Hostname Internal IP External name Description

migration.example.com

192.168.0.105

N/A

Virtual-to-Virtual Migration server

workstation.example.com

192.168.0.10

workstation-<YOUR-GUID>.rhpds.opentlc.com

Jump host and Ansible host

storage.example.com

192.168.0.254

workstation-<YOUR-GUID>.rhpds.opentlc.com

NFS server

cf.example.com

192.168.0.100

cf-<YOUR-GUID>.rhpds.opentlc.com

CloudForms server

kvm.example.com

192.168.0.40

kvm-<YOUR-GUID>.rhpds.opentlc.com

KVM hypervisor managed by Red Hat Virtualization

rhvm.example.com

192.168.0.35

rhvm-<YOUR-GUID>.rhpds.opentlc.com

Red Hat Virtualization Manager server

esx1.example.com

192.168.0.51

N/A

ESXi hypervisor

esx2.example.com

192.168.0.52

N/A

ESXi hypervisor

vcenter.example.com

192.168.0.50

vcenter-<YOUR-GUID>.rhpds.opentlc.com

VMware vCenter server

Prerequisites
  • Deployment of the demo environment which includes the following VMs provisioned in the vSphere environment:

    • jboss0 - a Red Hat Enterprise Linux 7 host running JBoss EAP

    • jboss1 - a Red Hat Enterprise Linux 7 host running JBoss EAP

    • lb - a Red Hat Enterprise Linux 7 host running Nginx configured to proxy traffic to jboss0 and jboss1

    • db - a Red Hat Enterprise Linux 7 host running PostgreSQL that the jboss0 and jboss1 application servers connect to

  • An external service is configured as https://app-<YOUR-GUID>.rhpds.opentlc.com pointing to the Load Balancer to make the Ticket Monster app accesible.

1.3. Obtaining or enabling access credentials

  1. First time login, forgot login or password? Go to https://www.opentlc.com/account

  2. Your username should NOT have an @ in it.

  3. Partners MUST request access to RHPDS by sending an email to open-program@redhat.com.

1.4. Provision Your Demo Environment

  1. Log in to the Red Hat Product Demo System with your provided credentials.

  2. Go to Services → Catalogs.

  3. Under All Services → Red Hat Solutions, select Infrastructure Migration Demo.

  4. On the right pane, click Order.

  5. Please, read carefully all of the information on the resulting page, check the box to confirm you understood the runtime warning message, and then click Submit.

    Important
    • It takes about 20 ~ 30 minutes for the demo to load completely and become accessible.

      • Wait for the full demo to load, even if some of its systems are marked "Up."

    • Watch for an email with information about how to access your demo environment.

      • Make note of the email’s contents: a list of hostnames, IP addresses, and your GUID.

      • Whenever you see <YOUR-GUID> in the demo instructions, replace it with the GUID provided in the email.

    • You can get real-time updates and status of your demo environment at https://www.opentlc.com/rhpds-status.

    Tip
    Be mindful of the runtime of your demo environment! It may take several hours to complete the demo, so you may need to extend the runtime. This is especially important in later steps when you are building virtual machines. For information on how to extend runtime and lifetime, see https://www.opentlc.com/lifecycle.

2. Getting Started

  1. Once the system is running, use SSH to access your demo server using your OPENTLC login name and private SSH key.

    • Using a Unix/Linux system:

      $ ssh -i /path/to/private_key <YOUR-OpenTLC-USERNAME-redhat.com>@workstation-<YOUR-GUID>.rhpds.opentlc.com
    • Example for user 'batman' and GUID '1a2b', using the default ssh private key:

      $ ssh -i ~/.ssh/id_rsa batman-redhat.com@workstation-1a2b.rhpds.opentlc.com
  2. Become root using the provided password:

    $ sudo -i
  3. Check the status of the environment using ansible:

    # ansible all -m ping

    This command establishes a connection to all the machines in the environment (except ESXi servers). In case the machines are up an running a success message, per each, will show up. This is an example of a success message for the VM jboss0.example.com:

    jboss0.example.com | SUCCESS => {
        "changed": false,
        "ping": "pong"
    }

    There are 4 VMs in the vCenter environment hosting an app with Nginx as loadbalancer, two JBoss EAP in domain mode, and a Postgresql database. To check only if these ones are running, you may use the following command:

    # ansible app -m ping
  4. Establish an SSH connection to the CloudForms server and monitor automation.log:

    # ssh cf.example.com
    # tail -f /var/www/miq/vmdb/log/automation.log
    Tip
    The log entries are very long, so it helps if you stretch this window as wide as possible.
    Note
    The log entries can be also seen in the CloudFomrm web UI in Automation → Automate → Log.
  5. Verify that the Ticket Monster app is running:

Ticket Monster app running
Note
You must accept all of the self-signed SSL certificates.
  1. Prepare to manage the environment. From a web browser, open each of the URLs below in its own window or tab, using these credentials (except when noted):

    • Username: admin

    • Password: <to_be_provided>

      Note
      You must accept all of the self-signed SSL certificates.
    • Red Hat Virtualization Manager: https://rhevm-<YOUR-GUID>.rhpds.opentlc.com

      1. Navigate to and click Administration Portal and log in using admin, <to_be_provided>, and internal.

    • vCenter: https://vcenter-<YOUR-GUID>.rhpds.opentlc.com

      1. Use root as the username to log in to vCenter.

      2. Click Log in to vSphere Web Client.

        • Flash Player is required.

          Tip
          Modern browsers have flash player disabled by default. You may need to enable it for this page.
      3. Click VMs and Templates.

    • CloudForms: https://cf-<YOUR-GUID>.rhpds.opentlc.com

      Tip
      You can also find these URLs in the email provided when you provisioned the demo environment.

2.1. Validate the Current VMs

  1. On the CloudForms web interface, go to Compute → Infrastructure → Providers.

  2. If you see an exclamation mark (!), or a cross (x) in a provider, check the provider’s box, go to Authentication → Re-check Authentication Status.

    Tip
    Take into account that vCenter may take longer to start.
  3. Go to Compute → Infrastructure → Virtual Machines → VMs → All VMs.

  4. All VMs and Templates in both RHV and vSphere show as entities in CloudForms.

    Note
    If you needed to validate providers, you may have to wait a few minutes and refresh the screen before the VMs show up.
  5. Select the pane VMs & Templates and, in it, the VMware provider.

  6. Only the VMs and Templates in vSphere will show.

2.2. Configure Red Hat Virtualization as a Migration Point of Arrival

RHV PoA
  1. On the cf system, go to Compute → Infrastructure → Providers.

  2. Click RHV.

  3. Select Policy → Edit Tags.

  4. Select Point of Arrival and then select Rhev for the assigned value.

    • This sets this provider as an available Red Hat Virtualization destination.

  5. Select the provider_type tag and select POA for the assigned value, then click Save.

    • This sets this provider as the current point of arrival.

2.3. Configure VMware vSphere as a Migration Point of Departure

vSphere PoD
  1. Navigate to the VMware provider.

  2. Select Policy → Edit Tags.

  3. Select provider_type and select POD for the assigned value, then click Save.

    • This sets this provider as the point of departure or source provider.

3. Migrate the db (PostgreSQL) VM from VMware to Red Hat Virtualization

  1. Use CloudForms to shut down (not power off) the VMs to be migrated. Initially just db but, all VMs can be shut down (db, jboss0, jboss1, lb).

    Tip
    It can be verified that db VM is down by running, in the terminal, in the workstation machine, the check command: # ansible db.example.com -m ping

For all application VMs (db, jboss0, jboss1, lb) the check command is: # ansible app -m ping

3.1. Set VM Migration Attributes

  1. On the cf system, go to Services → Catalogs and select the Service Catalogs pane.

  2. Under All Services → Import CSV, select Import Attributes.

  3. On the right, click Order.

  4. On the resulting screen, select attribute_db.csv in the Filename field and click Submit.

  5. Monitor automation.log on the cf server. When the process is complete, continue with the next section. It can be done by establishing an SSH connection to the CloudForms server and watching the content of automation.log:

    # ssh cf.example.com
    # tail -f /var/www/miq/vmdb/log/automation.log
    Note
    The log entries can be also seen in the CloudForms web UI in Automation → Automate → Log.
    Tip
    The csv files for attributes can be accessed in the machine cf under the folder /mnt/migrate/import_csv/attributes/.

3.2. Set VM Migration Tags

  1. On the cf system, go to Services → Catalogs → Service Catalogs.

  2. Under All Services → Import CSV, select Import Tags.

  3. On the right, click Order.

  4. On the resulting screen, select tag_db.csv in the Filename field and click Submit.

  5. Monitor automation.log on the cf server. When the process is complete, continue with the next section. It can be done by establishing an SSH connection to the CloudForms server and watching the content of automation.log:

    # ssh cf.example.com
    # tail -f /var/www/miq/vmdb/log/automation.log
    Note
    The log entries can be also seen in the CloudFomrm web UI in Automation → Automate → Log.
    Tip
    The csv files for attributes can be accessed in the machine cf under the folder /mnt/migrate/import_csv/tags/.

3.3. Check Tags and Attributes

  1. Go to Infrastructure → Providers → Virtual Machines → VMs → All VMs.

  2. Navigate to the db VM.

  3. Under Custom Attributes, confirm that there is a custom attribute called ip with the value you provided in attribute_db.csv.

  4. Under Smart Management, confirm that migrate_group is set to demo2 and Point of Arrival is set to Rhev.

3.4. Start VM Pre-Migration

Before starting the migration a set of checks are run against the tagged VMs to facilitate a successful migration. Once the checks are passed, the VMs are tagged as check_premigrate_tag = true. The migration will not run on the VMs unles the machines have this tag assigned.

  1. On the cf system, go to Services → Catalogs and choose the Service Catalogs pane.

  2. Under All Services → Migration, select Batch_PreMigrate.

  3. On the right, click Order.

  4. For Migration Group, select demo2.

  5. Verify in the VMs in Migration Group textbox that db is the only Vm displayed, and click Submit.

  6. Monitor automation.log in the terminal connected to CloudForms.

    # ssh cf.example.com
    # tail -f /var/www/miq/vmdb/log/automation.log
    Note
    The log entries can be also seen in the CloudFomrm web UI in Automation → Automate → Log.

3.5. Start VM Migration

  1. On the cf system, go to Services → Catalogs and choose the Service Catalogs pane.

  2. Under All Services → Migration, select Batch_Migrate.

  3. On the right, click Order.

  4. For Migration Group, select demo2.

  5. Verify in the VMs in Migration Group textbox that db is the only Vm displayed, and click Submit.

  6. Monitor automation.log in the terminal connected to CloudForms, and the Red Hat Virtualization Admin GUI closely.

    Note
    The log entries can be seen in the CloudFomrm web UI in Automation → Automate → Log.
    Tip

    It may be beneficial to open three separate sessions to the Migration server and run the following:

    # watch find /mnt
    # tail -f /mnt/migrate/ova/db.example.com/*log
    # tail -f /mnt/migrate/ova/db.example.com/*err
    Note
    It takes about 20 minutes for automation.log to show that the service is complete.

3.6. Verify VM Migration

  1. Log in to the Red Hat Virtualization Admin GUI and open the console for the db VM that was migrated.

  2. Start the db VM and log in as root with the password <to_be_provided>.

  3. Make sure the VM retained the IP address from attribute_db.csv and that it can resolve an external hostname.

4. Migrate the JBoss EAP VMs from VMware to RHV Platform

  1. Use CloudForms to shut down (not power off) the VMs to be migrated. Initially just jboss0 and jboss1 but, all VMs can be shut down (db, jboss0, jboss1, lb).

    Tip
    It can be verified that jboss0 and jboss1 VM are down by running, in the terminal, in the workstation machine, the check command: # ansible jboss -m ping

For all application VMs (db, jboss0, jboss1, lb) the check command is: # ansible app -m ping

4.1. Set VM Migration Attributes

  1. On the cf system, go to Services → Catalogs and select the Service Catalogs pane.

  2. Under All Services → Import CSV, select Import Attributes.

  3. On the right, click Order.

  4. On the resulting screen, enter attribute_jboss.csv in the Filename field and click Submit.

  5. Monitor automation.log on the cf server. When the process is complete, continue with the next section.

    Note
    The log entries can be seen in the CloudFomrm web UI in Automation → Automate → Log.

4.2. Set VM Migration Tags

  1. On the cf system, go to Services → Catalogs → Service Catalogs.

  2. Under All Services → Import CSV, select Import Tags.

  3. On the right, click Order.

  4. On the resulting screen, enter tag_jboss.csv in the Filename field and click Submit.

  5. Monitor automation.log on the cf server. When the process is complete, continue with the next section.

4.3. Check Tags and Attributes

  1. Go to Infrastructure → Providers → Virtual Machines → VMs → All VMs.

4.4. VM Pre-Migration

  1. On the cf system, go to Services → Catalogs and choose the Service Catalogs pane.

  2. Under All Services → Migration, select Batch_PreMigrate.

  3. On the right, click Order.

  4. For Migration Group, select demo.

  5. Verify in the VMs in Migration Group textbox that db is the only Vm displayed, and click Submit.

  6. Monitor automation.log in the terminal connected to CloudForms.

    # ssh cf.example.com
    # tail -f /var/www/miq/vmdb/log/automation.log
    Note
    The log entries can be also seen in the CloudFomrm web UI in Automation → Automate → Log.

4.5. Migrate the VM

  1. On the cf system, go to Services → Catalogs → Service Catalogs.

  2. Under All Services → Migration, select Batch_Migrate.

  3. On the right, click Order.

  4. For Migration Group, select demo then click Submit.

  5. Monitor automation.log and the RHV Platform dashboard closely.

5. End State

  • You now have the db server on VMware and the two jboss servers on RHV Platform.

  • The lb system remains on VMware

6. Extra Credit

  • Use what you learned in this lab to migrate lb to RHV Platform (Tip: use demo3 migration group)

7. Extra Tip

  • You can use attribute_all.csv for attributes, tag_all.csv for tags, and fulltest as migration group, to perform a full migration.