Show Table of Contents
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”
Export your libvirt image directory
Add the default image directory to the/etc/exportsfile:/var/lib/libvirt/images
*.example.com(rw,no_root_squash,async)Change the hosts parameter as required for your environment.Start NFS
- Install the NFS packages if they are not yet installed:
# yum install nfs
- Open the ports for NFS in
iptablesand add NFS to the/etc/hosts.allowfile. - Start the NFS service:
# service nfs start
Mount the shared storage on the destination
On the destination system, mount the/var/lib/libvirt/imagesdirectory:# mount
sourceURL:/var/lib/libvirt/images /var/lib/libvirt/imagesWarning
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.

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.