Linux KVM Client filesystem (BTRFS?)

btrfsext4kvm-virtualizationvirtualizationzfs

in our company we have a lot of kvm clients on multiple server, most of the clients are running ubuntu 16.04 as well as their host systems.

The filesystem of choice became EXT4, for clients and hosts. Recently I used some of the awesome snapshot features provided by BTRFS to setup a backup server with incremental backups.

Some research provided the clue one does never use BTRFS for the KVM host, because the fragmentation of the FS slows the clients down until they finally even freeze.

Is there any recommendation / do / don't for using BTRFS on the KVM client?

We are reconsidering our FS choices for clients and hosts,
are there advantages using XFS over EXT4 (client/host or one sided only)?

Best Answer

On google you can find a lot of website who talk about the performance of differents filesystem with KVM.

Take a look at this one : ZFS, BTRFS, XFS, EXT4 and LVM with KVM – a storage performance comparison

According to the author Gionatan Danti :

The tested scenarios are:

1) Qcow2 backend on top of XFS filesystem on top of a raw MD device. Both thin and partial (metadata only) preallocation modes were benchmarked;

2) Logical Volumes backend, both in classical LVM (fat preallocation) and thin (thin lvm target) modes. Moreover, thin lvm was analized with both zeroing on and off;

3) raw images on XFS and EXT4 on top of classical LVM, relaying on filesystem sparse-file support for thin provisioning;

4) raw images on XFS and EXT4 on top of thin LVM, relaying on thin lvm target for thin provisioning. In this case, LVM zeroing was disabled as the to-be-zero blocks are directly managed inside the filesystem structures;

5) raw images BTRFS on top of its mirror+stripe implementation (no MD here). I benchmarked BTRFS with CoW both enabled and disabled (nodatacow mount option)

6) raw images ZFS on top of its mirror+stripe implementation (no MD again)

He conclude by :

For VMs storage, stay well away from BTRFS: not only it is marked a “Tech Preview” from RedHat (read: not 100% production ready), but it is very slow when used as a VM images store.

Another blog talk about BTRFS, you can read on a lot of forums that Copy On Write (COW) need to be disable for getting better performances with KVM.

Chris Irwin talk about the benefits of BTRFS and talk about an alternative :

There are other tools, or you could roll your own cron-job. So what about ZFS? I thought ZFS did all these things?

Yes, it does Why not just use ZFS?

Go ahead

link : live with btrfs

Another way to know if it's okay for your use is testing by yourself if the performance is good and if it is reliable without copy on write.

If BTRFS is not the best for you, you can try ZFS. You have the same Backup fonctionality and lot of other improvements but it a bit tricky to implement in linux.