Red Hat Enterprise Linux 9 Essentials Book now available.
Purchase a copy of Red Hat Enterprise Linux 9 (RHEL 9) Essentials
Red Hat Enterprise Linux 9 Essentials Print and eBook (PDF) editions contain 34 chapters and 298 pages
18.4. Migrating with virt-manager
This section covers migrating KVM based guests with virt-manager.
Connect to the source and the target hosts
Connect to the source and target hosts. On the File menu, click Add Connection, the Add Connection window appears.
Enter the following details:
Hypervisor: Select QEMU.
Connection: Select the connection type.
Hostname: Enter the hostname.
Press the Connect button.
Figure 18.1. Add Connection
virt-manager now displays the newly connected host in the list of available hosts.
Figure 18.2. Connected Host
Add a storage pool to both hosts
Both hosts must be connected to the same storage pool. Create the storage pool on both hosts using the same network storage device. Using a storage pool ensures both servers have identical storage configurations. This procedure uses a NFS server.
Open the storage tab
On the Edit menu, click Host Details, the Host Details window appears.
Click the Storage tab.
Figure 18.3. Storage tab
Add a storage pool with the same NFS to the source and target hosts.
Add a new storage pool. In the lower left corner of the window, click the + button. The Add a New Storage Pool window appears.
Enter the following details:
Name: Enter the name of the storage pool.
Type: Select netfs: Network Exported Directory.
Figure 18.4. Add a new Storage Pool
Press Forward to continue.
Specify storage pool details
Enter the following details:
Format: Select the storage type. This must be NFS or iSCSI for live migrations.
Host Name: Enter the IP address or fully-qualified domain name of the storage server.
Figure 18.5. Storage pool details
Press the Finish button to add the storage pool.
Verify the new storage pool was added sucessfully
The new storage pool should be visible in the Storage tab.
Figure 18.6. New storage pool in the storage tab
Complete these steps on both hosts before proceeding.
Optional: Add a volume to the storage pool
Add a volume to the storage pool or create a new virtualized guest on the storage pool. If your storage pool already has virtualized guests, you can skip this step.
Create a new volume in the shared storage pool, click New Volume.
Enter the details, then click Create Volume.
Figure 18.7. Add a storage volume
Create a new virtualized guest on the new volume
Create a new virtualized guest that uses the new volume. For information on creating virtualized guests, refer to Part II, “Installation”.
Figure 18.8. New virtualized guest
The Virtual Machine window appears.
Figure 18.9. Virtual Machine window
Migrate the virtualized guest
From the main virt-manager screen, right-click on the virtual machine and select Migrate.... The Migrate the virtual machine window appears.
Figure 18.10. Migrate the virtual machine
Select the destination host from the list.
Select Migrate offline to disable live migration and do an offline migration.
Select advanced options if required. For a standard migration, no of these settings should be modified.
Press Migrate to confirm and migrate the virtualized guest.
A status bar tracks the progress of the migration. Once the migration is complete the virtualized guest will appear in the list of virtualized guests on the destination.