Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Xen vs KVM
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
redgsturbo
Apprentice
Apprentice


Joined: 24 Jun 2005
Posts: 283

PostPosted: Mon Nov 10, 2008 10:13 pm    Post subject: Xen vs KVM Reply with quote

Ok... so I'm building a virtual server... either Xen or KVM. Eventually, I need this to be high availibility.. as in, live migration on one host's failure. I know Xen supports this, but does KVM or if not is it in KVM's roadmap? Any thoughts on what path to take?
Back to top
View user's profile Send private message
bombcar
Guru
Guru


Joined: 08 Apr 2003
Posts: 446
Location: Lincoln Acres, CA

PostPosted: Tue Nov 11, 2008 4:37 am    Post subject: Reply with quote

I've been using xen on CentOS and it works, but god, some of the documentation is about as clear as mud. Setting up a bridged-NAT network was more pain than I really needed.
Back to top
View user's profile Send private message
bbgermany
Veteran
Veteran


Joined: 21 Feb 2005
Posts: 1792
Location: Oranienburg/Germany

PostPosted: Tue Nov 11, 2008 8:31 am    Post subject: Reply with quote

I tried both, and on my Core2Duo E8400 KVM runs the way faster then Xen. It doesnt really matter which one you use, they are both quite good. Setting up network (bridge/nat) seems to be a bit easier in KVM then in Xen.

bb
_________________
1st: i5-4570, 16GB, 1.75TB
2nd: i5-4570, 16GB, 620GB
3rd: i5-4570, 16GB, 10,5TB
4th: Asus N61VN, 8GB, 240GB
5th: C2D T7200, 2GB, 16GB USB + NFS
Back to top
View user's profile Send private message
redgsturbo
Apprentice
Apprentice


Joined: 24 Jun 2005
Posts: 283

PostPosted: Tue Nov 11, 2008 1:45 pm    Post subject: Reply with quote

I've played a little with Xen a good while back. I have played with KVM on my desktop in the past 24 hrs. Does KVM support live migration specifically for high availability? My hope is to have multiple servers sharing a glusterfs storage area and run VM's from there such that a failure in hardware does not stop the show. I know Xen can do this... KVM seems to be hard to get a clear answer. I'd assume it will eventually support it as ubuntu and redhat threw their weight behind KVM, but does it right now? Finally, if KVM is fully virtualized, how can it be way faster than Xen in paravirtualized mode? Or are you comparing KVM full virtualiztion to Xen HVM? OR, does KVM support paravirtualization or otherwise "vm aware" guests and thus speed up a good bit?
Back to top
View user's profile Send private message
bbgermany
Veteran
Veteran


Joined: 21 Feb 2005
Posts: 1792
Location: Oranienburg/Germany

PostPosted: Tue Nov 11, 2008 5:53 pm    Post subject: Reply with quote

Hi,

according to the homepage of kvm it supports live migration: http://kvm.qumranet.com/kvmwiki/Migration

bb
_________________
1st: i5-4570, 16GB, 1.75TB
2nd: i5-4570, 16GB, 620GB
3rd: i5-4570, 16GB, 10,5TB
4th: Asus N61VN, 8GB, 240GB
5th: C2D T7200, 2GB, 16GB USB + NFS
Back to top
View user's profile Send private message
trikolon
Apprentice
Apprentice


Joined: 04 Dec 2004
Posts: 297
Location: Erlangen

PostPosted: Wed Nov 12, 2008 8:31 am    Post subject: Reply with quote

Hi,
currently i am using xen 3.3.0 with a 2.6.27 kernel (from the kernel sub-forum) and everything is configured and runs. but i dont like, that there is no up-to-date kernel in portage, cpu freq scaling is not supported (at least together with acpi an the patchset i used)..

so i am thinking about changing to kvm. as far as i read, i have to generate my bridges an virtual ethernet-devices through the /etc/conf.d/net script, right? very interesting would be, how fast and stable kvm is? the benchmarks and articels found in google are not so young. i am using ipfire aus a gateway/firewall, ubuntu as an DMZ server and i want to install a windows xp "domain".

some user experiences would be so great. thx,
ben
Back to top
View user's profile Send private message
redgsturbo
Apprentice
Apprentice


Joined: 24 Jun 2005
Posts: 283

PostPosted: Fri Nov 14, 2008 2:53 pm    Post subject: Reply with quote

bbgermany wrote:
Hi,

according to the homepage of kvm it supports live migration: http://kvm.qumranet.com/kvmwiki/Migration

bb


live migration yes, but does it support high availability live migration?
Back to top
View user's profile Send private message
bbgermany
Veteran
Veteran


Joined: 21 Feb 2005
Posts: 1792
Location: Oranienburg/Germany

PostPosted: Fri Nov 14, 2008 4:36 pm    Post subject: Reply with quote

redgsturbo wrote:
live migration yes, but does it support high availability live migration?


do you mean like a cluster? you should check out iscsi and drbd (iirc it was spelled like this). i think this could do the trick.

bb
_________________
1st: i5-4570, 16GB, 1.75TB
2nd: i5-4570, 16GB, 620GB
3rd: i5-4570, 16GB, 10,5TB
4th: Asus N61VN, 8GB, 240GB
5th: C2D T7200, 2GB, 16GB USB + NFS
Back to top
View user's profile Send private message
redgsturbo
Apprentice
Apprentice


Joined: 24 Jun 2005
Posts: 283

PostPosted: Fri Nov 14, 2008 4:56 pm    Post subject: Reply with quote

bbgermany wrote:
redgsturbo wrote:
live migration yes, but does it support high availability live migration?


do you mean like a cluster? you should check out iscsi and drbd (iirc it was spelled like this). i think this could do the trick.

bb


that covers the shared storage... but that doesn't cover the seamless and automated VM migration and such. I am going to use glusterfs for the shared storage though
Back to top
View user's profile Send private message
nativemad
Developer
Developer


Joined: 30 Aug 2004
Posts: 911
Location: Switzerland

PostPosted: Fri Nov 14, 2008 5:27 pm    Post subject: Reply with quote

I know, i'm a bit ot, but have you got good performance/reliability with glusterfs as shared disk? I hated fuse when i tried it.... but maybe it was a pebkac? :roll:
_________________
Power to the people!
Back to top
View user's profile Send private message
bbgermany
Veteran
Veteran


Joined: 21 Feb 2005
Posts: 1792
Location: Oranienburg/Germany

PostPosted: Fri Nov 14, 2008 8:12 pm    Post subject: Reply with quote

redgsturbo wrote:
that covers the shared storage... but that doesn't cover the seamless and automated VM migration and such. I am going to use glusterfs for the shared storage though


you should try it out, since i dont have enough machines to test this.

bb
_________________
1st: i5-4570, 16GB, 1.75TB
2nd: i5-4570, 16GB, 620GB
3rd: i5-4570, 16GB, 10,5TB
4th: Asus N61VN, 8GB, 240GB
5th: C2D T7200, 2GB, 16GB USB + NFS
Back to top
View user's profile Send private message
dtjohnst
Apprentice
Apprentice


Joined: 23 Apr 2006
Posts: 178

PostPosted: Mon Nov 17, 2008 1:18 am    Post subject: Reply with quote

I just tried KVM. Wow it sucked. Maybe I did something wrong, but it was slllloooowwww. I didn't really do anything with X, no hardware accel or anything, because I planned on going headless and doing all my work remotely via the Microsoft Terminal Services client. I got KVM installed, installed the guest (Windows Server 2008 Standard), bridge the connection.......and via RDP it was horrible. Clicking on the start menu took a good 30 seconds to open, window closes/moves/resizes were painful, etc. Would it work better with hardware acceleration working? If so, I'm kinda screwed. Newer nvidia card means no nvidia drivers and KVM at the same time, unless someone knows some other way to get KVM working without PARAVIRT in my kernel...

It's not the machine, it's got the guts to run them both. I have VMWare running 2 Server 2008 guests and a linux guest on an identical hardware platform. I was really hoping to be able to cut out VMWare though. Xen is next on my list to try if no one has any suggestions to improve performance on KVM.
Back to top
View user's profile Send private message
redbottle
n00b
n00b


Joined: 15 Mar 2007
Posts: 25

PostPosted: Tue Nov 18, 2008 6:38 am    Post subject: Reply with quote

How much ram did you give to the guest in kvm? My hardware's nothing special and kvm is quick for me.
Back to top
View user's profile Send private message
bbgermany
Veteran
Veteran


Joined: 21 Feb 2005
Posts: 1792
Location: Oranienburg/Germany

PostPosted: Tue Nov 18, 2008 8:24 am    Post subject: Reply with quote

I have 8GB of RAM and each KVM host got 2GB. It works like a charm and damn fast. Server 2008 installation was done in 25min with updates.

bb
_________________
1st: i5-4570, 16GB, 1.75TB
2nd: i5-4570, 16GB, 620GB
3rd: i5-4570, 16GB, 10,5TB
4th: Asus N61VN, 8GB, 240GB
5th: C2D T7200, 2GB, 16GB USB + NFS
Back to top
View user's profile Send private message
dtjohnst
Apprentice
Apprentice


Joined: 23 Apr 2006
Posts: 178

PostPosted: Tue Nov 18, 2008 7:05 pm    Post subject: Reply with quote

Well, traditionally we ran Windows Server on 512MB RAM virtualized over VMWare on bare metal at my last IT job, so I gave it 784MB I think it was? Should've been enough. I don't think the problem was lack of memory. I think it was lack of hardware accel. I think it was redraw that was slow. But with nvidia needing PARAVIRT off in the kernel, I couldn't get it to run.
Back to top
View user's profile Send private message
bbgermany
Veteran
Veteran


Joined: 21 Feb 2005
Posts: 1792
Location: Oranienburg/Germany

PostPosted: Tue Nov 18, 2008 9:25 pm    Post subject: Reply with quote

why do you need PARAVIRT. its for the guest only if i have understood this correctly. its not for the host, and the guest uses a basic cirrus logic card inside.

bb
_________________
1st: i5-4570, 16GB, 1.75TB
2nd: i5-4570, 16GB, 620GB
3rd: i5-4570, 16GB, 10,5TB
4th: Asus N61VN, 8GB, 240GB
5th: C2D T7200, 2GB, 16GB USB + NFS
Back to top
View user's profile Send private message
redbottle
n00b
n00b


Joined: 15 Mar 2007
Posts: 25

PostPosted: Tue Nov 18, 2008 9:55 pm    Post subject: Reply with quote

I'm a little confused by your posts, dtjohnst. As bbgermany said, you shouldn't need PARAVIRT enabled, and afaik kvm doesn't support paravirtualization. Your processor has to support virtualization in hardware for kvm to work. You also have to have the kvm module loaded. Otherwise you're just using qemu which is of course very slow.

Just for reference, I have an nvidia card and an xp guest running on 512 megs of ram, and everything works very smoothly.
Back to top
View user's profile Send private message
bbgermany
Veteran
Veteran


Joined: 21 Feb 2005
Posts: 1792
Location: Oranienburg/Germany

PostPosted: Tue Nov 18, 2008 10:01 pm    Post subject: Reply with quote

@redbottle:

there is paravirt support for KVM available in recent kernels:

Code:

--- Paravirtualized guest support
[ ]   Xen guest support (NEW)
[ ]   KVM paravirtualized clock (NEW)
[ ]   KVM Guest support (NEW)
[ ]   Enable paravirtualization code (NEW)


This is out of gentoo-sources-2.6.27-r2

bb
_________________
1st: i5-4570, 16GB, 1.75TB
2nd: i5-4570, 16GB, 620GB
3rd: i5-4570, 16GB, 10,5TB
4th: Asus N61VN, 8GB, 240GB
5th: C2D T7200, 2GB, 16GB USB + NFS
Back to top
View user's profile Send private message
redbottle
n00b
n00b


Joined: 15 Mar 2007
Posts: 25

PostPosted: Tue Nov 18, 2008 10:34 pm    Post subject: Reply with quote

Fair enough, bb. From some quick reading, however, it looks like it's very limited paravirtualization and doesn't negate the need for your processor to support virtualization in hardware.
Back to top
View user's profile Send private message
dtjohnst
Apprentice
Apprentice


Joined: 23 Apr 2006
Posts: 178

PostPosted: Tue Nov 18, 2008 11:04 pm    Post subject: Reply with quote

bbgermany wrote:
why do you need PARAVIRT. its for the guest only if i have understood this correctly. its not for the host, and the guest uses a basic cirrus logic card inside.

bb


Oh. Uhh. That's cool. Do you have a link to a HOWTO explaining it? I was basing my build on a variety of sources, and none of them were very clear. I was under the impression that PARAVIRT was needed on the host to provide for support to run the guests.

EDIT: My processor certainly does support virtualization btw. Says so on the box, in the bios, and in my cpuinfo flags. Are there any issues running it with a Hardened kernel? I plan on having all my guests accessible to the outside world as well as the host, so if it works on hardened that's even better.
Back to top
View user's profile Send private message
bbgermany
Veteran
Veteran


Joined: 21 Feb 2005
Posts: 1792
Location: Oranienburg/Germany

PostPosted: Wed Nov 19, 2008 7:29 am    Post subject: Reply with quote

Im not sure about the hardened profile/toolchain. you should go to #gentoo-hardened at freenode to ask for this issue. for getting KVM running, you should have a look at this:
google cached KVM gentoo-wiki entry: http://64.233.183.132/search?q=cache:Zw8C0E6-l9sJ:da.gentoo-wiki.com/KVM+gentoo-wiki+kvm&hl=de&ct=clnk&cd=3&gl=de&client=firefox-a

i was just trying KVM and comparing some subjective speed issues. im here for questions as well :D

bb
_________________
1st: i5-4570, 16GB, 1.75TB
2nd: i5-4570, 16GB, 620GB
3rd: i5-4570, 16GB, 10,5TB
4th: Asus N61VN, 8GB, 240GB
5th: C2D T7200, 2GB, 16GB USB + NFS
Back to top
View user's profile Send private message
dtjohnst
Apprentice
Apprentice


Joined: 23 Apr 2006
Posts: 178

PostPosted: Thu Nov 20, 2008 3:50 am    Post subject: Reply with quote

Yeah I was using that document as one of my references. I guess what threw me for a loop was
Quote:
If you have kernel support compiled into your kernel then you are ready to go, but if you are using kernel modules instead you are going to need to load them first.


At the time the only options that made sense to "compile in" or configure as modules were the paravirt ones. Although re-reading it now, it does seem to indicate more CONFIG_KVM options. Maybe I'll get back to it. I'm got VMWare running now and I'm actually pretty happy with it.
Back to top
View user's profile Send private message
redgsturbo
Apprentice
Apprentice


Joined: 24 Jun 2005
Posts: 283

PostPosted: Fri Nov 21, 2008 4:15 pm    Post subject: Reply with quote

regarding xen, the kernel is ancient. anyone have issues with running a xen patched newer kernel? what about hardened and selinux patched?
Back to top
View user's profile Send private message
redgsturbo
Apprentice
Apprentice


Joined: 24 Jun 2005
Posts: 283

PostPosted: Fri Nov 21, 2008 4:23 pm    Post subject: Reply with quote

regarding xen, the kernel is ancient. anyone have issues with running a xen patched newer kernel? what about hardened and selinux patched?
Back to top
View user's profile Send private message
sgao
Tux's lil' helper
Tux's lil' helper


Joined: 22 Apr 2006
Posts: 149

PostPosted: Wed Dec 17, 2008 6:38 am    Post subject: Reply with quote

trikolon wrote:
Hi,
currently i am using xen 3.3.0 with a 2.6.27 kernel (from the kernel sub-forum) and everything is configured and runs. but i dont like, that there is no up-to-date kernel in portage, cpu freq scaling is not supported (at least together with acpi an the patchset i used)..

so i am thinking about changing to kvm. as far as i read, i have to generate my bridges an virtual ethernet-devices through the /etc/conf.d/net script, right? very interesting would be, how fast and stable kvm is? the benchmarks and articels found in google are not so young. i am using ipfire aus a gateway/firewall, ubuntu as an DMZ server and i want to install a windows xp "domain".

some user experiences would be so great. thx,
ben


I am running kvm for more than a year on a machine with 2G memory. Each guest uses 512MB. I can have two or three guests running at the same time. Both guests run very fast. I've installed XP, Solaris, FreeBSD, Gentoo guests.

Here is part of my net config:
Quote:

config_eth0=(
# "192.168.1.10 broadcast 192.168.1.255 netmask 255.255.255.0"
)
dns_domain_eth0="domain.com"
dns_servers_eth0="192.168.1.1"

bridge_br0="eth0"
config_eth0=( "null" )
config_br0=( "192.168.1.10/24")
#config_br0=( "dhcp" )
RC_NEED_br0="net.eth0"
brctl_br0=( "setfd 0" "sethello 0" "stp off" )
routes_br0=( "default gw 192.168.1.1" )




/etc/kvm/qemu-ifup
Quote:

#!/bin/sh
#
if test $(/sbin/ifconfig | grep -c $1) -gt 0; then
/sbin/brctl delif br0 $1
ifconfig $1 down
fi

/sbin/ifconfig $1 0.0.0.0 promisc up
/sbin/brctl addif br0 $1


To start a guest, run:
/usr/local/kvm/bin/qemu-system-x86_64 -hda /kvm/guest1.img -boot c -m 512 -localtime -net nic,vlan=0,macaddr=52:54:0:xx:xx:xx,model=rtl8139 -net tap,vlan=0,ifname=tap0,script=/etc/kvm/qemu-ifup &
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum