10.15. Migrating Virtual Machines Between Hosts
- 10.15.1. What is Live Migration?
- 10.15.2. Live Migration Prerequisites
- 10.15.3. Automatic Virtual Machine Migration
- 10.15.4. Preventing Automatic Migration of a Virtual Machine
- 10.15.5. Manually Migrating Virtual Machines
- 10.15.6. Setting Migration Priority
- 10.15.7. Canceling Ongoing Virtual Machine Migrations
- 10.15.8. Event and Log Notification upon Automatic Migration of Highly Available Virtual Servers
10.15.1. What is Live Migration?
Live migration provides the ability to move a running virtual machine between physical hosts with no interruption to service. The virtual machine remains powered on and user applications continue to run while the virtual machine is relocated to a new physical host. In the background, the virtual machine's RAM is copied from the source host to the the destination host. Storage and network connectivity are not altered.
10.15.2. Live Migration Prerequisites
Live migration is used to seamlessly move virtual machines to support a number of common maintenance tasks. Ensure that your Red Hat Enterprise Virtualization environment is correctly configured to support live migration well in advance of using it.
At a minimum, for successful live migration of virtual machines to be possible:
- The source and destination host should both be members of the same cluster, ensuring CPU compatibility between them.
Note
Live migrating virtual machines between different clusters is generally not recommended. The currently only supported use case is documented at https://access.redhat.com/articles/1390733. - The source and destination host must have a status of
Up. - The source and destination host must have access to the same virtual networks and VLANs.
- The source and destination host must have access to the data storage domain on which the virtual machine resides.
- There must be enough CPU capacity on the destination host to support the virtual machine's requirements.
- There must be enough RAM on the destination host that is not in use to support the virtual machine's requirements.
- The migrating virtual machine must not have the
cache!=nonecustom property set.
In addition, for best performance, the storage and management networks should be split to avoid network saturation. Virtual machine migration involves transferring large amounts of data between hosts.
Live migration is performed using the management network. Each live migration event is limited to a maximum transfer speed of 30 MBps, and the number of concurrent migrations supported is also limited by default. Despite these measures, concurrent migrations have the potential to saturate the management network. It is recommended that separate logical networks are created for storage, display, and virtual machine data to minimize the risk of network saturation.
10.15.3. Automatic Virtual Machine Migration
Red Hat Enterprise Virtualization Manager automatically initiates live migration of all virtual machines running on a host when the host is moved into maintenance mode. The destination host for each virtual machine is assessed as the virtual machine is migrated, in order to spread the load across the cluster.
The Manager automatically initiates live migration of virtual machines in order to maintain load balancing or power saving levels in line with cluster policy. While no cluster policy is defined by default, it is recommended that you specify the cluster policy which best suits the needs of your environment. You can also disable automatic, or even manual, live migration of specific virtual machines where required.
10.15.4. Preventing Automatic Migration of a Virtual Machine
Summary
Red Hat Enterprise Virtualization Manager allows you to disable automatic migration of virtual machines. You can also disable manual migration of virtual machines by setting the virtual machine to run only on a specific host.
The ability to disable automatic migration and require a virtual machine to run on a particular host is useful when using application high availability products, such as Red Hat High Availability or Cluster Suite.
Procedure 10.53. Preventing automatic migration of a virtual machine
- Click the Virtual Machines tab and select a virtual machine.
- Click Edit to open the Edit Virtual Machine window.
- Click the Host tab.
- Use the Start Running On radio buttons to designate the virtual machine to run on Any Host in Cluster or a Specific host. If applicable, select a specific host from the drop-down menu.
Warning
Explicitly assigning a virtual machine to a specific host and disabling migration is mutually exclusive with Red Hat Enterprise Virtualization high availability. Virtual machines that are assigned to a specific host can only be made highly available using third party high availability products like Red Hat High Availability. - Use the drop-down menu to affect the Migration Options. Select Do not allow migration to enable the Pass-Through Host CPU check box.
- If applicable, enter relevant CPU Pinning topology commands in the text field.
- Click to save the changes and close the window.
Result
You have changed the migration settings for the virtual machine.
10.15.5. Manually Migrating Virtual Machines
A running virtual machine can be live migrated to any host within its designated host cluster. Live migration of virtual machines does not cause any service interruption. Migrating virtual machines to a different host is especially useful if the load on a particular host is too high. For live migration prerequisites, see Section 10.15.2, “Live Migration Prerequisites”.
Note
When you place a host into maintenance mode, the virtual machines running on that host are automatically migrated to other hosts in the same cluster. You do not need to manually migrate these virtual machines.
Note
Live migrating virtual machines between different clusters is generally not recommended. The currently only supported use case is documented at https://access.redhat.com/articles/1390733.
Procedure 10.54. Manually Migrating Virtual Machines
- Click the Virtual Machines tab and select a running virtual machine.
- Click to open the Migrate Virtual Machine(s) window.
- Use the radio buttons to select whether to Select Host Automatically or to Select Destination Host, specifying the host using the drop-down list.
Note
When the Select Host Automatically option is selected, the system determines the host to which the virtual machine is migrated according to the load balancing and power management rules set up in the cluster policy. - Click to commence migration and close the window.
During migration, progress is shown in the Migration progress bar. Once migration is complete the Host column will update to display the host the virtual machine has been migrated to.
10.15.6. Setting Migration Priority
Summary
Red Hat Enterprise Virtualization Manager queues concurrent requests for migration of virtual machines off of a given host. Every minute the load balancing process runs. Hosts already involved in a migration event are not included in the migration cycle until their migration event has completed. When there is a migration request in the queue and available hosts in the cluster to action it, a migration event is triggered in line with the load balancing policy for the cluster.
It is possible to influence the ordering of the migration queue, for example setting mission critical virtual machines to migrate before others. The Red Hat Enterprise Virtualization Manager allows you to set the priority of each virtual machine to facilitate this. Virtual machines migrations will be ordered by priority, those virtual machines with the highest priority will be migrated first.
Procedure 10.55. Setting Migration Priority
- Click the Virtual Machines tab and select a virtual machine.
- Click to open the Edit Virtual Machine window.
- Select the High Availability tab.
- Use the radio buttons to set the Priority for Run/Migrate Queue of the virtual machine to one of Low, Medium, or High.
- Click to save changes and close the window.
Result
The virtual machine's migration priority has been modified.
10.15.7. Canceling Ongoing Virtual Machine Migrations
Summary
A virtual machine migration is taking longer than you expected. You'd like to be sure where all virtual machines are running before you make any changes to your environment.
Procedure 10.56. Canceling Ongoing Virtual Machine Migrations
- Select the migrating virtual machine. It is displayed in the Virtual Machines resource tab with a status of Migrating from.
- Click the button at the top of the results list. Alternatively, right-click on the virtual machine and select Cancel Migration from the context menu.
Result
The virtual machine status returns from Migrating from status to Up status.
10.15.8. Event and Log Notification upon Automatic Migration of Highly Available Virtual Servers
When a virtual server is automatically migrated because of the high availability function, the details of an automatic migration are documented in the tab and in the engine log to aid in troubleshooting, as illustrated in the following examples:
Example 10.1. Notification in the Events Tab of the Web Admin Portal
Highly Available Virtual_Machine_Name failed. It will be restarted automatically.
Virtual_Machine_Name was restarted on Host Host_Name
Example 10.2. Notification in the Manager engine.log
This log can be found on the Red Hat Enterprise Virtualization Manager at
/var/log/ovirt-engine/engine.log:
Failed to start Highly Available VM. Attempting to restart. VM Name: Virtual_Machine_Name, VM Id:Virtual_Machine_ID_Number
