Este contenido no está disponible en el idioma seleccionado.

4.3. Shared Storage Example: NFS for a Simple Migration


Important

This example uses NFS to share guest virtual machine images with other KVM host physical machines. Although not practical for large installations, it is presented to demonstrate migration techniques only. Do not use this example for migrating or running more than a few guest virtual machines. In addition, it is required that the sync parameter is enabled. This is required for proper export of the NFS storage. In addition, it is strongly recommended that the NFS is mounted on source host physical machine, and the guest virtual machine's image needs to be created on the NFS mounted directory located on source host physical machine. It should also be noted that NFS file locking must not be used as it is not supported in KVM.
iSCSI storage is a better choice for large deployments. Refer to Section 12.5, “iSCSI-based Storage Pools” for configuration details.
Also note, that the instructions provided in this section are not meant to replace the detailed instructions found in Red Hat Linux Storage Administration Guide. Refer to this guide for information on configuring NFS, opening IP tables, and configuring the firewall.
  1. Create a directory for the disk images

    This shared directory will contain the disk images for the guest virtual machines. To do this create a directory in a location different from /var/lib/libvirt/images. For example:
    # mkdir /var/lib/libvirt-img/images
  2. Add the new directory path to the NFS configuration file

    The NFS configuration file is a text file located in /etc/exports. Open the file and edit it adding the path to the new file you created in step 1.
    # echo "/var/lib/libvirt-img/images" >> /etc/exports/[NFS-Config-FILENAME.txt]
  3. Start NFS

    1. Make sure that the ports for NFS in iptables (2049, for example) are opened and add NFS to the /etc/hosts.allow file.
    2. Start the NFS service:
      # service nfs start
  4. Mount the shared storage on both the source and the destination

    Mount the /var/lib/libvirt/images directory on both the source and destination system, running the following command twice. Once on the source system and again on the destination system.
    # mount source_host:/var/lib/libvirt-img/images /var/lib/libvirt/images

    Warning

    Make sure that the directories you create in this procedure is compliant with the requirements as outlined in Section 4.1, “Live Migration Requirements”. In addition, the directory may need to be labeled with the correct SELinux label. For more information consult the NFS chapter in the Red Hat Enterprise Linux Storage Administration Guide.
Red Hat logoGithubRedditYoutubeTwitter

Aprender

Pruebe, compre y venda

Comunidades

Acerca de la documentación de Red Hat

Ayudamos a los usuarios de Red Hat a innovar y alcanzar sus objetivos con nuestros productos y servicios con contenido en el que pueden confiar.

Hacer que el código abierto sea más inclusivo

Red Hat se compromete a reemplazar el lenguaje problemático en nuestro código, documentación y propiedades web. Para más detalles, consulte el Blog de Red Hat.

Acerca de Red Hat

Ofrecemos soluciones reforzadas que facilitan a las empresas trabajar en plataformas y entornos, desde el centro de datos central hasta el perímetro de la red.

© 2024 Red Hat, Inc.