KVM – Image Path Suggestions for File System and Mount Options

kvmqcow2qemustorage

As simple KVM server I've got to store raw and qcow2 images on special path like:

/kvm-storage

I want to know what's the best practices for file system and mount options to set this path for achieve better performance.

  • File system is it better to be ext4/xfs or ?
  • Which mount options must be set for that file system.

For example I use ext4 and set largefile4 and noatime

I also set disk bus to virtio and cache bus to none and io mode to native.

  • It's all about to store on standard HDD or SSD or NVMe storage. (Not NFS/ZFS/Cepth or etc…)
  • Tips like using(or not) LLVM or Software raid or Hardware Raid will be great.
  • If I want to have RAID better to guest machine handle or I choose different path like /kvm-storage-0/image.raw and /kvm-storage-1/image.raw and raid it inside vm ?

Best Answer

I'm not sure if I'm able to answer all your questions, but at least some probably yes.

  • The filesystem - If you require the best performance, I'd go with XFS, despite the difference is not so big. However if you require better manageability, EXT4 is probably better as it supports shrink (XFS doesn't).

  • XFS mount parameters - it depends on the underlying HW. If there is some reliable, battery/capacitor equiped RAID controller, you can use noatime,nobarrier options. Without that, probably just noatime.

  • RAW or QCOW2 - The QCOW2 gives you better manageability, however it has to be stored on standard filesystem. So you get slight performance penalty of the double filesystem (on the hypervisor and on the guest). So for performance critical solutions, I'd select raw. But in this case not in form of ordinary file. I'd provide the VM guest separate device (partition, LVM Logical Volume (LV)...)

The rest of your question can be considered too broad as we don't know your HW options.

Related Question