Linux-KVM: file server as guest or host

kvm-virtualizationvirtualization

I'm planning on building an Ubuntu server that primarily needs to be a file server, but due to budgetary constraints will likely get used for running virtual images for a couple of different development / server projects (probably rarely concurrently; will be mostly testing).

I have looked into various virtualisation solutions (Xen, KVM, VirtualBox) and am currently thinking I will go with KVM, although I'm new to this in a server context (I've used Virtual PC on Windows extensively).

My question is:
Should I go "the whole hog" and have everything virtualised or should I just virtualise the additional OSs and keep the file server at the host level?

I would instinctively have gone for virtualising everything, but if I'm using a virtual server for the file server I presume this would result in some massive single file on the host that contained all my file servers files. I was just concerned this might cause potential issues (I know fairly large files are fine but I wasn't sure how big would be okay and if say 500Gb might start to become a problem!)

The other thing is that perhaps I'm missing a trick here, due to my relative new-ness with KVM and server virtualisation. (at the risk of sounding very uninformed…) Is it necessary that the files the file server reside in that image or perhaps can they reside at the host OS level and still have the file server responsible for serving them to my network?


More specifics in case they help:

Intended Host OS: Ubuntu 9.10 Server

Guest OSs:
most are likely to be Ubuntu 9.10 Server but ideally I'm hoping to use Windows 7 for testing on a particular project.

Guest OS uses anticipated to include: (potentially) file server; a mediawiki install (plus a test version); web server (Apache) for some simple internal use webpages that can't be on the same machine as the mediawiki machine; Win7 test machine;

For all access I'm planning on connecting remotely with SSH (although I'll be in the same location as the server the majority of the time


Any (constructive) advice gratefully received!

Thanks,
Neil

Best Answer

KVM and possibly the other solutions, allow you to present an entire block device to the guest OS. You could, for example, set up a dedicated LVM partition (or even complete disk drive) on the host system for your file server files, and present that to your file-server virtual machine as a hard drive mounted at /srv, for example.

That way you haven't got one huge file for your server - just a partition on the host's disks. That would take care of the files residing on the host but being served by the virtual file server to your network.

I've got a very similar setup, also on Ubuntu 9.10 with KVM, where I've got an LDAP directory and 6 virtual servers running atop 2 physical servers. I was torn with the same situation as yourself - do I set up 2 virtual machines to host the LDAP, or run it on the physical machines? My answer was because the physical machines also need access to LDAP, I'll host it on the physical boxes. If I'd done it the other way around, and the virtual LDAP server failed, the physical servers wouldn't be able to use it. But if the physical server fails, the virtual machines will have failed also so it doesn't matter that LDAP isn't working!

In my setup, the whole virtual machines are on LVM partitions at the host level, because they're replicated between the 2 physical machines using DRBD, so if one physical box dies, they can be bought up quickly on the other. The complete LVM partition is presented to the VM as a SCSI hard drive, and the VM then partitions that "hard drive" also using LVM.