Bookmark this page

Guided Exercise: Migrating a Virtual Machine in a Cluster

In this exercise, you will manually migrate a running virtual machine from one host to another within a cluster.

Outcomes

You should be able to manually migrate a virtual machine between two hosts.

This exercise uses the development data center, which contains the clusterone cluster, and the hostb and hostd hosts. This exercise also uses the rhel-vm1 virtual machine, which runs on either the hostb or the hostd host.

Log in as the student user on workstation and run the lab migration-vm start command. This command ensures that the hosts, clusters, data centers, and networks of the Red Hat Virtualization environment are configured appropriately.

[student@workstation ~]$ lab migration-vm start
  1. Attach the hostd.lab.example.com host to the development data center.

    1. Using the https://rhvm.lab.example.com URL log in to the Administration Portal of the RHV Manager as admin in the internal profile. Use redhat as the password.

    2. From the menu, click ComputeHosts to view the list of available hosts.

    3. From the Compute >> Hosts page, select the hostd.lab.example.com host.

    4. Click Management, and then select Maintenance to mark hostd.lab.example.com for housekeeping operations. The Maintenance Host(s) window displays.

    5. Click OK to confirm.

    6. From the Compute >> Hosts page, select the hostd.lab.example.com host, and then click Edit. The Edit Host window displays.

    7. Select clusterone from the drop-down menu of the Host Cluster field. Click OK to set the cluster of hostd.lab.example.com to clusterone. In the Power Management Configuration window, click OK to ignore configuring the power management settings and continue setting the cluster for hostd.lab.example.com to clusterone.

  2. Attach the existing storage-net and vm-net logical networks to hostd.lab.example.com. The logical network vm-net should be on eth0 and use DHCP to get an address. The logical network storage-net should be on eth1, with the static IPv4 address 172.24.0.13, and the 255.255.255.0 netmask.

    1. From the Compute >> Hosts page, click the name of the hostd.lab.example.com host.

    2. In the Compute >> Hosts >> hostd.lab.example.com page, click the Network Interfaces tab.

    3. Click the Setup Host Networks button to change the network configuration of hostd.lab.example.com.

    4. In the Setup Host hostd.lab.example.com Networks window, click and drag the storage-net box from the right side to the left side of the window. Drop the box onto the no network assigned field, next to the eth1 network interface.

    5. Click and drag the vm-net (VLAN 10) box from the right side to the left side of the window. Drop the box next to the eth0 network interface. After dropping, you should see two logical networks assigned to eth0 interface.

    6. Click on the pencil icon inside the storage-net box. The Edit Network storage-net window displays. In the Edit Network storage-net window, under Boot Protocol, select the Static radio button.

    7. In the IP field, type 172.24.0.13 as the IP address of hostd.lab.example.com in the storage-net network.

    8. In the Netmask/Routing Prefix field, type 255.255.255.0 as the netmask. Leave the Gateway field empty.

    9. Click OK to save the settings.

    10. Ensure that the check boxes for the Verify connectivity between Host and Engine and Save network configuration options are selected.

    11. Click OK to save the new network configuration for hostd.lab.example.com.

    12. In the Compute >> Hosts page, click Management and select Activate to make hostd.lab.example.com operational in the clusterone cluster.

  3. Identify the host that is running the rhel-vm1 virtual machine. If there is more than one rhel-vm1 virtual machine, use the virtual machine located in the clusterone cluster.

    1. From the menu bar of the RHV-M Administration Portal, click ComputeVirtual Machines to view the list of virtual machines.

    2. In the Status field for the rhel-vm1 virtual machine, verify that the status of the rhel-vm1 virtual machine is Up.

    3. View the Host field for the rhel-vm1 virtual machine to determine the host for this virtual machine.

    4. Right-click the row for the rhel-vm1 virtual machine, and click Console.

      In the Opening console.vv window, which opens in Firefox, select the Open with radio button, and then select Remote Viewer (default) from the drop-down menu, if not already selected. Click OK to display the console for rhel-vm1 with Remote Viewer.

  4. With the rhel-vm1:1 - Remote Viewer window open and displaying the console, migrate the rhel-vm1 virtual machine to a different host.

    1. In the Compute >> Virtual Machines page of the Administration Portal of RHV Manager, select the rhel-vm1 virtual machine.

    2. Click the Migrate button. The Migrate VM(s) window displays.

    3. In the Destination Host field, use the drop-down menu to select the host to which the rhel-vm1 virtual machine should be migrated. The destination host may display as either hostb.lab.example.com or hostd.lab.example.com. Click the Migrate button to start the migration.

    4. Verify that the value of the Status field for the rhel-vm1 virtual machine transitions from Migrating From to Up. The console for rhel-vm1 should show that the virtual machine is running during the migration.

  5. Verify that the Host field for the rhel-vm1 virtual machine displays the new host to confirm the successful migration of the virtual machine.

Finish

On workstation, run the lab migration-vm finish script to complete this exercise.

[student@workstation ~]$ lab migration-vm finish

This concludes the guided exercise.

Revision: rh318-4.3-c05018e