Use this when KVM VMs store disks on NFS.
NFS · KVM Storage
NFS for KVM stores qcow2 or raw disk images on a network share mounted on every host, giving simple shared storage for live migration. Use NFSv4.1 or later, a dedicated network and hard mounts.
1. NFS pools (netfs) host qcow2/raw files.
2. Hard mounts.
3. Same path on all hosts for migration.
4. SELinux: virt_use_nfs boolean.
5. Dedicated network.
VM disk file → NFS → server
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Common mistakes Narrow the fault
- Libvirt NFS pool not set to autostart.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- Mount on every host for migration.
- Use NFSv4.1+ and hard mounts.
- Network latency becomes disk latency.
virsh pool-info <nfs-pool>— netfs poolnfsstat -m— mount optionsfindmnt -t nfs4— mounted
ReferenceHow it works1 section · depth on demand
How it works
In libvirt, an NFS storage pool (type netfs) mounts the export on the host and manages volumes (disk images) inside it. For live migration every host needs the same pool mounted at the same path. File ownership matters: qemu runs as a specific user, so the export must allow it (watch root_squash and SELinux labels such as virt_use_nfs).
ReferenceImportant terms & boundaries2 sections · depth on demand
In depth
NFS as a libvirt storage pool
libvirt's storage documentation describes the netfs pool type. It mounts a network export from a host and path; the default protocol is auto, which generally tries NFS first. Starting the pool mounts the share, autostart mounts it when libvirt starts, and pool-destroy only unmounts it, without touching the data.
# cat nfs-pool.xml
<pool type="netfs">
<name>nfs-images</name>
<source>
<host name="10.0.0.20"/>
<dir path="/export/kvm"/>
<format type="nfs"/>
</source>
<target>
<path>/var/lib/libvirt/images/nfs</path>
</target>
</pool>
# virsh pool-define nfs-pool.xml
# virsh pool-start nfs-images && virsh pool-autostart nfs-images
# virsh pool-list --all
Name State Autostart
----------------------------------
nfs-images active yes
# virsh vol-list nfs-images
Operational points
| Topic | Guidance |
|---|---|
| Live migration | All hosts must mount the same export at the same path |
| Permissions | qemu runs as a dedicated user; exports with root_squash must allow that UID/GID |
| SELinux | Set virt_use_nfs on RHEL-family hosts |
| Mount options | Keep hard for VM disks; soft timeouts risk silent corruption |
| Disk format | qcow2 for snapshots and thin images; raw for the lowest overhead |
Troubleshooting
| Symptom | Check |
|---|---|
| Pool fails to start | mount -t nfs by hand from the host; firewall; export ACL |
VM fails to start, Permission denied | File ownership on the export, SELinux label or boolean |
| VM pauses with I/O error | NFS server unreachable; virsh domblkerror <vm> |
| Migration fails on disk path | Different mount path on the target host |
Documented example, not captured output.
Pool definition
virsh pool-define-as nfspool netfs --source-host nas01 --source-path /export/vms --target /var/lib/libvirt/images/nfs
virsh pool-start nfspool ; virsh pool-autostart nfspool
Documented example, not captured output.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Hypervisor Storage → KVM Storage → NFS. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://pve.proxmox.com/pve-docs/chapter-pvesm.html · confidence 94%