22.2. Share storage example: NFS for a simple migration


This example uses NFS to share guest images with other KVM hosts. This example is not practical for large installations, this example is only for demonstrating migration techniques and small deployments. Do not use this example for migrating or running more than a few guests.
For advanced and more robust shared storage instructions, see Part V, “Virtualization Storage Topics”
  1. Export your libvirt image directory

    Add the default image directory to the /etc/exports file:
    /var/lib/libvirt/images *.example.com(rw,no_root_squash,async)
    
    Copy to Clipboard Toggle word wrap
    Change the hosts parameter as required for your environment.
  2. Start NFS

    1. Install the NFS packages if they are not yet installed:
      # yum install nfs
      
      Copy to Clipboard Toggle word wrap
    2. Open the ports for NFS in iptables and add NFS to the /etc/hosts.allow file.
    3. Start the NFS service:
      # service nfs start
      
      Copy to Clipboard Toggle word wrap
  3. Mount the shared storage on the destination

    On the destination system, mount the /var/lib/libvirt/images directory:
    # mount sourceURL:/var/lib/libvirt/images /var/lib/libvirt/images
    
    Copy to Clipboard Toggle word wrap

    Warning

    Whichever directory is chosen for the guests must exactly the same on host and guest. This applies to all types of shared storage. The directory must be the same or the migration will fail.
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat