Product SiteDocumentation Site

12.3. Migración KVM en vivo con virsh

Un huésped puede ser migrado a otro host con el comando virsh. El comando migrate acepta parámetros en el siguiente formato:
# virsh migrate --live GuestName DestinationURL
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 Fedora, 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.
Ejemplo: migración en vivo con virsh
Este ejemplo migra desde test1.bne.redhat.com a test2.bne.redhat.com. Cambie los nombres de los equipos para su entorno. Este ejemplo migra una máquina virtual llamada CentOS4test.
Este ejemplo supone que usted tiene completamente configurado el almacenamiento compartido, y que reúne todos los prerequisitos (listados aquí: Requerimientos de migración).
  1. Verificar que el huésped esté ejecutándose

    Desde el sistema origen, test1.bne.redhat.com, verifique si CentOS4test se esté ejecutando:
    [root@test1 ~]# virsh list
    Id Name                 State
    ----------------------------------
     10 CentOS4                running
    
  2. Migrar el huésped

    Ejecute el siguiente comando para migrar en vivo el huésped al destino, test2.bne.redhat.com. Añada /system al final de la URL de destino para decirle a libvirt que usted necesita acceso total.
    # virsh migrate --live CentOS4test qemu+ssh://test2.bne.redhat.com/system
    
    Once the command is entered you will be prompted for the root password of the destination system.
  3. Espere

    La migración puede tomarse algún tiempo dependiendo de la carga y del tamaño del huésped. virsh sólo reporta errores. El huésped continúa ejecutándose en el host fuente hasta migrar completamente.
  4. Verificar que el huésped haya llegado al host de destino

    Desde el sistema de destino, test2.bne.redhat.com, verifique que CentOS4test esté en ejecución:
    [root@test2 ~]# virsh list
    Id Name                 State
    ----------------------------------
     10 CentOS4                running
    
La migración en vivo ahora está completa.

Otros métodos de red

libvirt soporta una variedad de métodos de red incluyendo TLS/SSL, unix sockets, SSH, y TCP no encriptada. Consulte Capítulo 13, Administración remota de huéspedes virtualizados para obtener mayor información sobre otros métodos.