22.3. Live KVM migration with virsh


A guest can be migrated to another host with the virsh command. The migrate command accepts parameters in the following format:
# virsh migrate --live GuestName DestinationURL
Copy to Clipboard Toggle word wrap
The GuestName parameter represents the name of the guest which you want to migrate.
The DestinationURL parameter is the URL or hostname of the destination system. The destination system must run the same version of Red Hat Enterprise Linux, be using the same hypervisor and have libvirt running.
Once the command is entered you will be prompted for the root password of the destination system.
Example: live migration with virsh

This example migrates from test1.example.com to test2.example.com. Change the host names for your environment. This example migrates a virtual machine named RHEL4test.

This example assumes you have fully configured shared storage and meet all the prerequisites (listed here: Migration requirements).
  1. Verify the guest is running

    From the source system, test1.example.com, verify RHEL4test is running:
    [root@test1 ~]# virsh list
    Id Name                 State
    ----------------------------------
     10 RHEL4                running
    
    Copy to Clipboard Toggle word wrap
  2. Migrate the guest

    Execute the following command to live migrate the guest to the destination, test2.example.com. Append /system to the end of the destination URL to tell libvirt that you need full access.
    # virsh migrate --live RHEL4test qemu+ssh://test2.example.com/system
    Copy to Clipboard Toggle word wrap
    Once the command is entered you will be prompted for the root password of the destination system.
  3. Wait

    The migration may take some time depending on load and the size of the guest. virsh only reports errors. The guest continues to run on the source host until fully migrated.
  4. Verify the guest has arrived at the destination host

    From the destination system, test2.example.com, verify RHEL4test is running:
    [root@test2 ~]# virsh list
    Id Name                 State
    ----------------------------------
     10 RHEL4                running
    
    Copy to Clipboard Toggle word wrap
The live migration is now complete.

Note

libvirt supports a variety of networking methods including TLS/SSL, unix sockets, SSH, and unencrypted TCP. See Chapter 23, Remote management of guests for more information on using other methods.
맨 위로 이동
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2025 Red Hat