• Some users have recently had their accounts hijacked. It seems that the now defunct EVGA forums might have compromised your password there and seems many are using the same PW here. We would suggest you UPDATE YOUR PASSWORD and TURN ON 2FA for your account here to further secure it. None of the compromised accounts had 2FA turned on.
    Once you have enabled 2FA, your account will be updated soon to show a badge, letting other members know that you use 2FA to protect your account. This should be beneficial for everyone that uses FSFT.

Advice on my KVM setup

Arioch5

n00b
Joined
Jun 10, 2009
Messages
10
I'm setting up a KVM server at home and wanted to run my ideas past the community to see if there's anything I'm missing, as well as ask some questions. I've used KVM before, but never with IOMMU and never where disk/network access was very important. I'm open to suggestions and I'll be happy to provide more info on the setup if needed. The new hardware should be here in 7-10 days (after the Holiday).

Background
I've been using Sage TV since somewhere around version 3 (windows version). Since Google bought SageTV almost a year ago now, I've been needing to migrate to something else. I have two sage extenders that I would like to continue to use during this transition. I plan to transition to mythtv, XBMC, plex, or similar that will support a low power linux front end like the Raspberry Pi.

I've just purchased an FX-8120, 16GB of ram, a 90GB Sata III SSD, and a Gigabyte board that supports IOMMU. The IOMMU will be necessary for the single PCI Hauppauge 350 analog tuner.

Disk Setup
My current plan is to use LVM partitions on both the SSD and a 500GB spinning disk.
On the SSD:
  • KVM Host
  • MythTV Backend
  • XBMC Test Machine
  • Plex Test Machine
  • Fedora development machine (work related)
  • Misc - small VM for playing around on (Arch/Gentoo)

That's 6 machines, all of which might not exist at the same time. I don't expect to always run Myth/XBMC/Plex at the same time. After I figure out the replacement for SageTV I expect to combine the Myth/XBMC/Plex into a single VM. Leaving plenty of room for a Zoneminder VM in the future.

On the Spinning Disk:
  • SageTV - Windows XP
  • Bulk Storage with Samba/NFS shared off the host

This leaves the spinning drive with basically just Sage and TV storage as it's currently used now only virtual. I hope to share the bulk LVM partition via the Host so that as I move to Myth the Linux VM's can easily access the storage as well.

Disk Setup Questions:
  • Does TRIM support work on LVM raw virtio disks?
  • Will using VirtIO raw disks be the best solution on the SSD?
  • Which filesystems should I be using? EXT4 on the SSD and EXT2 on the Bulk TV shows?

Network Setup
I have GigE run through the house and the host will be on that. I plan to setup the Guests with a Bridge to the eth0 of the host as all the machines will be accessed via the LAN.

Network Questions:
  • Do the Myth/Sage VM's need a seperate bridge to the Host so that network access between them doesn't actually travel across the NIC? As I understand it, Guest-to-Host communications are much faster if the entire interface is virtual.


Misc
That's as far as I've currently got figured out. I would love to hear any advice about what I might do differently. If this looks good I'd love to hear that too. I'll have more questions about backing up the LVM partitions to my NAS but that will come at a later time after I get the installs complete.
 
Last edited:
Is there a better place I should ask this?
I'll figure some of it out via trial and error, but surly someone has used an SSD and knows how networking works.
 
So that confirms that ext4 will use trim. But I'm not sure if the VM will see the drive as an SSD or just a regular hard drive. That's the final question. If the VM can see the drive as an SSD then the guest will send TRIM and both ext4 and LVM support it.

Anyone use an SSD with KVM before?
 
From what I understand, I dont think ext4 will ever "see" your drive as an SSD. ext4 requires the discard mount option to enable TRIM. Once you delete something the kernel will send the TRIM command and I believe it is best effort, it sends it and moves on. If you mount a HDD with discard, I think the command will just be ignored by the drive.

I also think your setup is unusual because there is not much talk of KVM around here; mostly ESXi and some Xen from what I have witnessed.

So that confirms that ext4 will use trim. But I'm not sure if the VM will see the drive as an SSD or just a regular hard drive. That's the final question. If the VM can see the drive as an SSD then the guest will send TRIM and both ext4 and LVM support it.

Anyone use an SSD with KVM before?
 
I also think your setup is unusual because there is not much talk of KVM around here; mostly ESXi and some Xen from what I have witnessed.

That's what I was suspecting.

Don't worry about the software. Assume I'm not doing MythTV or the like. If anyone has KVM support I'd be interested to just know about the SSD.

Oh and as an update, a friend of mine familiar with KVM says a single bridge should get me access to the host w/o using the NIC. That's what I expected, but I'll report back actual results when It's built. 1/2 the hardware comes in today and the other 1/2 tomorrow.
 
Just wanted to post an update for anyone doing this in the future.

The short answer is I've been running and recording off the PCI card for about a week now and it's working great. The key was vfio for KVM, it allows a much more intelligent pass through. The following two links are what you need for it. If you read this 8 or 12 months from now it might already be in the upstream kernel.

git://github.com/awilliam/linux-vfio.git (iommu-group-vfio-next-20120529)
git://github.com/awilliam/qemu-vfio.git (iommu-group-vfio)

Long answer, read this: http://marc.info/?l=kvm&m=133884447202018&w=2
 
Do the Myth/Sage VM's need a seperate bridge to the Host so that network access between them doesn't actually travel across the NIC? As I understand it, Guest-to-Host communications are much faster if the entire interface is virtual.
just bridge the nic.

remove all the ip/subnet info from eth0 and create vbrX scripts for each VM (or just one). its logically simpler to do this with openVSwitch but the initial setup is a bit more and frankly unnecessary for your config.
 
Back
Top