Linux-on-Linux KVM: Which filesystem should I use for guest and host

btrfsfilesystemskvm-virtualizationraid

I'm in the process on playing around with KVM and setting up a linux on a linux-server, so I can

  • reboot the (guest)server
  • encrypt the rootFS of the guest without having to do initramfs-tricks to get remote reboot to work.

I'm thinking about using btrfs as filesystem, since it's a single ssd-disk and no RAID.

Following thoughts:

  • If I use btrfs on the host, i have excellent data-integrity, all the checksums etc.
  • So I can use something fast and simple, maybe even ext2 on the guest?

Or should I do it the other way round?

Best Answer

Running BTRFS on the host for disk images (qcow2, etc) is a really bad idea. The style of disk writes to an image file is the worst IO pattern for btrfs, the tuning KVM page does not contain a lot of tips:

http://www.linux-kvm.org/page/Tuning_KVM

But on this one they are clear:

"Don't use the linux filesystem btrfs on the host for the image files. It will result in low IO performance. The kvm guest may even freeze when high IO traffic is done on the guest."

I use ext4 for local files and a nfs store via ZFS on solaris for remote disk images. We will be switching to zfs based iscsi shares in the near future. If you don't need a nas / central file store and are going to have a relatively stable number of VMs DukeLion's suggestion is best.

We use the cluster for software testing, so we are creating 1000s of VMs each day using qcow2 overlay files. LVM does not support doing that.