The libvirt can’t migrate the virtual machine(domain) it is because the libvirt cannot access the disk image(s):
As part of our server management services, we are delighted to assist you and fix the errors with our technical team support24/7.
One of our clients got the same issue, he tried to use a guest virtual machine informed that he was unable to migrate because libvirt cannot access the disk image(s):
Error:
# virsh migrate qemu qemu+tcp://name_of_host/system
error: Unable to allow access for disk path /var/lib/libvirt/images/qemu.img: No such file or directory
Fixing the error
Let’s have a glance at the reason behind the error caused
Cause for this Error:
Generally, migration only transfers the in-memory state of a running guest (such as memory or CPU state). Although disk images are not transferred during migration, they need to remain accessible at the same path by both hosts.
The solution to fix the error.
Set up and mount shared storage at the same location on both hosts. The simplest way to do this is by using NFS:
Follow the steps
Set up an NFS server on host serving as shared storage
Run the command:
# mkdir -p /exports/images
# cat >>/etc/exports <<EOF
/exports/images 192.168.122.0/24(rw,no_root_squash)
EOF
Now you need to mount the exported directory which is at the common location on all hosts running libvirt.
Run the command:
# cat >>/etc/fstab <<EOF
123.123.123.123:/exports/images /var/lib/libvirt/images nfs auto 0 0
EOF
# mount /var/lib/libvirt/images
Note: replace Ip with the address of the NFS server.
During the migration process, if you don’t set the configuration properly the guest virtual machine may lose access to its disk images. this happens when the source host’s libvirt daemon may change the owner, permissions, and SELinux labels on the disk images after it successfully migrates the guest to its destination.
You will not able to make the changes if the libvirt detects that the disk images are mounted from a shared storage location.
Conclusion
In brief, follow the steps to fix the error unable to allow access for disk path in libvirtd. For more assistance, you can contact our technical team support.