Jump to content


darkside34

Member Since 27 Mar 2012
Offline Last Active Nov 30 2012 04:18 PM
-----

Topics I've Started

Your lack of KVM disturbs me.....

27 March 2012 - 01:08 AM

So, I have to ask, am I the only person that runs KVM on a home server?


I should probably preface;


I didn't come here to knock WHS and ESXi (we use ESXi at work for our primary hyper-visor cluster and I love it dearly), but I feel like I would be doing the open source community a disservice if I didn't evangelize at least a little bit.


So, my story for those interested;


First off, I did give ESXi 5 a try....mostly because my boss was curious about all the client-side improvements (which are massive) as was I. My original plan was to go with ESXi and buy a 2nd device (micro proliant or something of the sort) to serve out hard drives over iSCSI. However on my only-been-in-the-industry-for-6-months budget, this wasn't a reality. I had inherited 6 1tb 5400rpm hard drives from a friend, and was planning on sticking them all in said nas, but eventually talked myself out of it (good thing too, 5 of them were DOA.....not that I bothered to check).


At the point in the build where I received the hard drives, a double-hard-drive failure had killed all of my virtual machines, so I was eager to give something new a try. VMware is a fork of KVM, so I chose it over Xen, mostly because I wouldn't loose any capabilities I had with ESXi (and would gain a few as I found out).


So, I loaded it with ever-trusty Debian, and started my journey.


I had decided early on that I was ditching hardware raid altogether. MD raid on linux has amazing manageability, and plenty of speed to back that up as well. Originally I was booting my system from a 16gb flash drive on the internal USB port, but this wasn't cutting it so I sunk $70 into a mid-end 32gb SSD. I took the 1tb 7200rpm hitachi drive that survived the raid-5 holocaust generated by my old raid controller, and the one good 1tb 5400rpm drive from my friends collection and stuck them in a software raid-1. This isn't anywhere near my final configuration, I am going to buy 3x seagate 7200rpm 1tb drives here shortly, but for now it suffices. (This server has 4 internal warmswap drive bays, if I ever need more room Ill just buy a JBOD esata card and throw some drives in an external cage, make a new raid array, and add it to my lvm volume group).

Also, the benefits of LVM alone easily justify linux for a home server. There is nothing like rebuilding a raid-1 into a raid-5 without taking the data offline. :)

The KVM setup is where the LVM really comes in handy however. I actually run all of my VMs on block level storage on their own LVM logical volumes. This allows for super-fast performance compared to .vmdks or .qcow since it circumvents the file-system's read/write queue, and it allows for LVM snapshots to be used. It also allows me to dynamically expand discs whilst the independent file-systems are live, meaning I don't have to deal with the hassle of adding more virtual discs to a host that is running out of space. It also means I can do my backups in bash, like this: http://pastebin.com/i0M5p78Z (disclaimer; I've worked on that script for 30 minutes and it is nowhere near done, it does work however)


When I started working with this setup, I was using virsh (command line utility) to manage all of my VMs, but eventually a friend convinced me that I had to give virt-manager a try. So I daemonized a VNC session running on a different TTY just to run virt-manager (and the crashplan gui) screen-shots of both are below. (note these tools can all be run remotely if you have a spare linux box with x sitting around)


All in all this was a fairly simple task (did run into one issue where I couldn't mount an ISO over a symlink that had me chasing my tail [literally] for an hour) and I'm pretty confident the average power user could accomplish everything I have accomplished here rather easily. I am very impressed with the ease and performance of KVM, and we are actually considering building some small business hyper-visors around it at work following my little experiment. In either case, I hope someone gets something out of this write-up, and if anyone wants to give this a try but needs some help or a second set of eyes, just shoot me a PM or catch me on IRC (irc.freenode.net, normally hang out in #debian, #cisco, #vmware, and ##/r/sysadmin under the name 'cerettala', private chats are welcome)

Obligatory Specs:

IBM system x3100 M4

E3-1220 Xeon processor
16GB buffered ECC RAM
dual gigabit NIC (intel chipset)

Picture of the system itself: https://lh5.googleus...0207_175634.jpg
Virt manager screens: (sorry about the resolution, these were taken on my 1366x768 notebook) https://lh5.googleus...rt-manager1.png
https://lh4.googleus...rt-manager2.png