Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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? Ponder *ponder*

share|improve this question

2 Answers 2

up vote 6 down vote accepted

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.

share|improve this answer
    
Really good answer, thanks. –  Fabian Zeindl May 29 '12 at 18:59
    
A follow-up question: When using encryption, should i use raw-crypt-lvm-diskImage, or raw-lvm-crypt diskImage or raw-lvm-diskImage-crypt. I don't care if all vms share one password, i merely ask because of performance etc. –  Fabian Zeindl May 31 '12 at 11:54
    
I have not needed to do encryption, so can't say a ton about that. We use it for a internal testing lab, no need to encrypt testing VMs. –  n8whnp Jun 25 '12 at 17:20

It all depends on what you want to achieve.

I would not recommend use ext2 for root fs in any server - virtual or physical. You may get slower performance in some cases and filesystem inconsistencies is still possible, making reboots incredibly slow.

If you want simplicity and performance - I'd suggest you to put guest image on lvm logical volume and use btrfs/ext4/xfs in guest.

share|improve this answer
    
and what on the host? –  Fabian Zeindl May 20 '12 at 15:14
    
raw lvm logical volume maybe with encryption –  DukeLion May 20 '12 at 15:16
    
+1 for the LVM approach –  dyasny May 20 '12 at 16:19
    
Hm, that way sounds really nice, but as far as I know you can to the volume management with btrfs as well. So maybe just btrfs instead of the lvm? –  Fabian Zeindl May 20 '12 at 19:02
1  
btrfs is a filesystem approach, having more unneeded features and functionality. LVM is dealing with plain block devices. There's nothing particularly bad with btfs, but with LVM it will be more simple and efficient. –  DukeLion May 21 '12 at 4:20

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.