Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Virtual Server Seperation suggestions.
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
tuxman
n00b
n00b


Joined: 11 Oct 2004
Posts: 54
Location: Ottawa,Canada

PostPosted: Thu Jun 11, 2009 3:48 am    Post subject: Virtual Server Seperation suggestions. Reply with quote

Hey all...

I currently have a Gentoo hosting server running with the typical services.. apache/ftp/dns/smtp/pop3/mysql.
I have recently taken on a new project and it requires postgres and and apache, but it also requires people to be able to ssh into the box to do some managemnet of the DB. They have their own box but it is ancient and frankly it's a POS workstaiton not a true server, so I want to migrate it into my server, but I want to keep them seperate from my stuff. Their load is minimal, so purchasing a new server dedicated to them is really a waste of rack space but I would feel much better if it was on my box with raid rather than the 40gig IDE that has been running for who knows how long :)

I was thinking VPS, but I have no experience with it and I'm not sure if it will do what I want to do. I would like to give them their own ip, and isntall apache/php/ssh and postgress into their environment and keep everything seperate from my stuff and just share the hardware. I realize this would eat up more space as I would have apache installed twice but this way there will be no way they could interfear with my existing stuff.

is VPS for me ? I've tried virtualbox with a windows install and it seems to work ok but I really don't need the whole gui thing thus the VPS idea seemed to be a better fit ????

I'm looking for some opinions on how people would do this, and what options are available to me. Any idea is appreciated.

Thanks all for your advice.
Back to top
View user's profile Send private message
vaguy02
Guru
Guru


Joined: 25 Feb 2005
Posts: 424
Location: Hopefully in one place

PostPosted: Thu Jun 11, 2009 11:54 am    Post subject: Reply with quote

tuxman,

I'm a big supporter of virtualization in most cases, not all. But in your case, I would agree that virtualization is probably the best idea. I run multiple VMWare Server boxes on my network, the host OS is gentoo with the VM's being just about anything from Linux to Windows and between. Luckly VMWare Server is free and in the portage, although you do have to "sign-up" from VMWare to get a license, but it is doesn't cost anything. If you do a bridged network, you will be able to assign each VM a different IP from the router device. VMWare Server has a web interface on the host side, through this web interface (standard - https://hostserver:8333). You can create, configure, power on/off, and mount iso's as CDROM devices on any of the VMs.

Let me know if you have any specific questions,
Vaguy02
_________________
Linux Registered User #458185

Intel Quad-Core w/ 4gigs Ram w/ 8800 GTX - Windows 7 RC
2x (Intel Dual-Core w/ 2gigs Ram - Gentoo)
Mac G5 Dual-Core w/ 2gigs Ram - OS 10.5
Back to top
View user's profile Send private message
tuxman
n00b
n00b


Joined: 11 Oct 2004
Posts: 54
Location: Ottawa,Canada

PostPosted: Thu Jun 11, 2009 6:37 pm    Post subject: Reply with quote

Thanks for the info...

Forgive me for being possibly stupid... but if you were in my case would you install VMWare and put in 1 virtural server for this new project, or would you put in 2 and migrate my existing stuff into a virtual server leaving the root server clean and process free ?

When setting up a new VM, is it a case of setting up a VM and then installing everything from scratch ? (not that I intend to install new VM's every day but I'm just curious)

Also does VMWare provide mgmt tools other than the web interface too for instance restart the VM ? I'm only guessing but I would imagine that I could ssh into the VM and deal with apache and postgres etc from there the same way I would normally ?

Do I need to set asside unpartitioned space for the VM to use or does it use existing space ?

Is there any really good Wiki/howto that you would suggest me looking at to get started or jsut dive in with both feet and emerge the VMWare out of portage :)

Sorry for all the questions, I'm just trying to gather as much info as I can before I jump into this.. I am upgrading my server to a new box so this is the perfect time to do things right and set up the VM the way it should be done rather than a half good install :)
Back to top
View user's profile Send private message
ianw1974
Guru
Guru


Joined: 18 Oct 2006
Posts: 387
Location: UK and Poland

PostPosted: Thu Jun 11, 2009 7:38 pm    Post subject: Reply with quote

I've just separated out my server into multiple virtual hosts. Originally it was a mail server, web server, proxy server and backup server all in one.

Now, it's running Xen virtualisation (not the Citrix one) and I have four virtual servers now. One is the mail server, one is the web server, one is the proxy server and one is the backup server. Since I had upgraded the server from 2GB of ram to 6GB of ram, I split the memory as follows:

mail: 2GB
web: 512MB
proxy: 512MB
backup: 1GB

whilst 512MB would probably be enough for the backup server, I may also add server monitoring to this server so I planned ahead and gave it 1GB. I still have 2GB of spare ram which will either mean I can allocate 1GB for another machine, but I think I'd still need to leave headroom for the Xen server in case it needed it so effectively I'll count 1GB as spare.

None of this runs any gui stuff, purely CLI and SSH.
_________________
Ian Walker

Light travels faster than sound. This is why some people appear bright until you hear them speak.........

Linux Systems Limited | Masternode Monitoring
Back to top
View user's profile Send private message
vaguy02
Guru
Guru


Joined: 25 Feb 2005
Posts: 424
Location: Hopefully in one place

PostPosted: Thu Jun 11, 2009 7:43 pm    Post subject: Reply with quote

tuxman,

No problem at all with all the questions. Let me see if I can manage to answer all of them. Personally. I would go with 2 VM's, and leave the host as clean and free of large programs as possible. It will help the base system to be more efficient, plus it cuts down on the number of updates the host system has to do. I'd rather reboot a VM because of a fix, than a host because of a fix.

Actually, there are two answers to this next question. With the standard VMware server, it will allow you to install a OS in a VM just like a normal computer would, basically step by step through the gentoo handbook. But there is another method (not really supported or recommended) but you can (with the VM powered off), make a copy of the VM. Then rename it, then attach it to the VMWare Server interface. It will ask you if this is a different/new VM and make the correct changes, although everything inside the OS will be the same, IP addresses etc. So you can see how you would run into problems.

You can setup SSH inside the VM, and restart it through the SSH session, or in the web interface there is a "manual" reset function that basically works the same as the reset button on your computer would. You will be able to ssh into your VM, setup apache, bind, dhcpd, mysql, anything that you can do in a regular machine can be done in the VM, and it will be on the VM's ip. So your host could be 192.168.0.2 and your VM could be 192.168.0.3. If you VM is running apache, you would hit http://192.168.0.3/. It handles pretty much like a real machine with a couple of specific exceptions.

Nope, VMWare server uses existing Partitioned space for it's VMs. Which is actually very interesting because in the powered off state, it's just a rather large set of files on your hard-drive, which you can backup using a cron job on the host machine.

As for guides, most of all the guides that I've seen are for VMware Server 1.x. But I would recommend using VMware Server 2.x (that's the one I use and I'm pretty happy with it for the most part). It's a pretty easy install, if memory serves me right. I'm actually planning on reimaging one of my host machines tonight, I'll try to remember to write down the steps.

Vaguy02

Edit: No I don't work for VMware :), but I have taken several of their classes for my job.
_________________
Linux Registered User #458185

Intel Quad-Core w/ 4gigs Ram w/ 8800 GTX - Windows 7 RC
2x (Intel Dual-Core w/ 2gigs Ram - Gentoo)
Mac G5 Dual-Core w/ 2gigs Ram - OS 10.5
Back to top
View user's profile Send private message
drescherjm
Advocate
Advocate


Joined: 05 Jun 2004
Posts: 2790
Location: Pittsburgh, PA, USA

PostPosted: Fri Jun 12, 2009 3:30 am    Post subject: Reply with quote

Check out openvz.

I recommend you install either a 2.6.26 or 2.6.27 openvz kernel even though the "stable" version is 2.6.18. I have been using 2.4.24 through 2.6.27 over the last 2 years on more than 1/2 dozen machines. The only problem is you can not have kernel preemption on.

http://wiki.openvz.org/Main_Page

At home I run a mail server, ldap samba pdc, cvs/svn servers in their own containers. And at work I do much of the same.

https://forums.gentoo.org/viewtopic-t-532363-highlight-openvz+vserver.html

BTW, Dainel Robbins has prebuilt openvz guests on his site:

http://www.funtoo.org/
_________________
John

My gentoo overlay
Instructons for overlay
Back to top
View user's profile Send private message
vaguy02
Guru
Guru


Joined: 25 Feb 2005
Posts: 424
Location: Hopefully in one place

PostPosted: Fri Jun 12, 2009 4:10 am    Post subject: Reply with quote

Just in case anyone is wondering, this is how you get Vmware-server 2.0.1 working on Gentoo Linux 2.6.29-r5 (x86). It's after midnight here, I'm going to bed. I will clean this up and make it look better tomorrow. But hopefully it will help someone.

Vaguy02
------------------------------------------

Download Version 2.0.1 from Vmware site (free download with reg, x86 version)
tar xvf vmware-server-2.0.1-156745.i386.tar.gz
cd vmware-server-distrib

(Due to 2.6.29 incompatibility)
download http://www.saarlinux.de/blog/wp-content/uploads/2009/03/vmware-server-modules-2629tar.gz

place it and extract in vmware-server-distrib/lib/modules/source/*

mkdir /etc/rc0-6.d

as root: ./vmware-install.pl


(default options)

When license up press "q". Then accept "yes"

(default options)

Note: VM files will be in /var/lib/vmware/Virtual Machines

Enter Serial from site: ....

Done.

Then try to connect to your new web-interface on https://hostname:8333
(may get error about cert, since it's self signed.)
_________________
Linux Registered User #458185

Intel Quad-Core w/ 4gigs Ram w/ 8800 GTX - Windows 7 RC
2x (Intel Dual-Core w/ 2gigs Ram - Gentoo)
Mac G5 Dual-Core w/ 2gigs Ram - OS 10.5
Back to top
View user's profile Send private message
tuxman
n00b
n00b


Joined: 11 Oct 2004
Posts: 54
Location: Ottawa,Canada

PostPosted: Mon Jun 15, 2009 12:17 am    Post subject: Reply with quote

hey all I decided to give VMware a try ...

I got vmware installed.. I have 2 issues.

1) I'm getting constant crashes in what looks like the java modules in the webgui.. all sorts of NullPointerException: Operation failed errors...

2) I can't seem to get a linux guest to boot.. no matter what I do the kernel can't find the root fs. the livecd finds it just fine and the drives show up etc etc.. it's all configured but when I try to have it boot through grub it fails like I'm missing the kernel driver needed for the disk controller or perhaps the required chipset drivers (if it was a real machine)...

Any suggestions ?
Back to top
View user's profile Send private message
drescherjm
Advocate
Advocate


Joined: 05 Jun 2004
Posts: 2790
Location: Pittsburgh, PA, USA

PostPosted: Mon Jun 15, 2009 10:14 am    Post subject: Reply with quote

Quote:
Any suggestions ?


Do not use vmware server. Version 1 is ancient. Version 2 is buggy. Both versions are slow. Its only useful if you want free virtulization for windows guests and you need smp. For linux on linux use a VPS (either openvz or vserver) if you are not going to have GUI guests or use kvm or virtualbox if you really want GUI in your guests.
_________________
John

My gentoo overlay
Instructons for overlay
Back to top
View user's profile Send private message
vaguy02
Guru
Guru


Joined: 25 Feb 2005
Posts: 424
Location: Hopefully in one place

PostPosted: Mon Jun 15, 2009 10:26 am    Post subject: Reply with quote

tuxman,

Not sure about 1, never had that happen to me. I've run the web console in both IE and Firefox, never had any javascript errors.

Regarding two, try adding support in the kernel for
Device Drivers -> [*] Fusion MPT device support -> [*] all the below

vaguy02
_________________
Linux Registered User #458185

Intel Quad-Core w/ 4gigs Ram w/ 8800 GTX - Windows 7 RC
2x (Intel Dual-Core w/ 2gigs Ram - Gentoo)
Mac G5 Dual-Core w/ 2gigs Ram - OS 10.5
Back to top
View user's profile Send private message
drescherjm
Advocate
Advocate


Joined: 05 Jun 2004
Posts: 2790
Location: Pittsburgh, PA, USA

PostPosted: Mon Jun 15, 2009 10:32 am    Post subject: Reply with quote

Quote:
I've run the web console in both IE and Firefox, never had any javascript errors.


I have them at minimum 2 or 3 times a week on the windows laptop. Somedays I can not even connect to vmware server. Sometimes I can get it back by flushing my FF cache sometimes a reboot of my gentoo server is necissary. In either case the IO performance of vmware server is bad so I am waiting for a real replacement to run windows guests on my gentoo box as for linux guests openvz runs very well and has very low overhead. The good thing is this wait may be over soon as virtualbox has smp support in development.
_________________
John

My gentoo overlay
Instructons for overlay
Back to top
View user's profile Send private message
linuxtuxhellsinki
l33t
l33t


Joined: 15 Nov 2004
Posts: 700
Location: Hellsinki

PostPosted: Mon Jun 15, 2009 9:23 pm    Post subject: Reply with quote

drescherjm wrote:
In either case the IO performance of vmware server is bad so I am waiting for a real replacement to run windows guests on my gentoo box


Try XEN with pv-drivers.
_________________
1st use 'Search' & lastly add [Solved] to
the subject of your first post in the thread.
Back to top
View user's profile Send private message
drescherjm
Advocate
Advocate


Joined: 05 Jun 2004
Posts: 2790
Location: Pittsburgh, PA, USA

PostPosted: Mon Jun 15, 2009 9:28 pm    Post subject: Reply with quote

I have used xen in the past with success however the kernels became a problem. I mean the xen kernels are way, way behind kernel.org kernels and this presented me problems with current hardware.

Also openvz is still faster because the overhead is much lower. In this case you get near native disk performance.
_________________
John

My gentoo overlay
Instructons for overlay
Back to top
View user's profile Send private message
ocbMaurice
Tux's lil' helper
Tux's lil' helper


Joined: 14 Feb 2003
Posts: 90
Location: Switzerland

PostPosted: Tue Jun 16, 2009 10:28 pm    Post subject: Reply with quote

I'm running vmware-server on my Atom-330 Server (2GB RAM).
You don't have to compile it yourself. There is a vmware overlay.

Code:
emerge -a layman
layman -a vmware
layman -S

http://www.gentoo.org/proj/en/overlays/userguide.xml

If you have a recent kernel (>2.6.25)

/usr/src/linux/.config:
CONFIG_FUSE_FS=y

/etc/portage/package.keywords:
app-emulation/vmware-server ~amd64
app-emulation/vmware-modules ~amd64


Code:
emerge -a vmware-server
/opt/vmware/server/bin/vmware-config.pl
/etc/init.d/vmware start


The rest can be done via web-interface:
https://localhost:8333/

I'm a web-developer and use my server to host multiple Sites (Plesk-Like).
For me there are various reasons, not to virtualize the main server stuff.
I mainly use vmware for additional services (and development).
I.e. some virtual hosts are proxied to the vmware (they only get internal IPs).

It's up to you how you want to do it. There are always multiple ways.

Here's a nice trick to copy an existing machine (either vmware or real PC).
Create a new vmware instance with the same harddisk size as the source (equal or more).
Then boot the new instance with a linux boot cd (like the gentoo minimal install cd).
Start the network (remember the ip), setup a root password and start ssh.

The source machine should also be booted from a boot cd (safety reasons).
It will mostly also work while the system is running (fsck should take care of that).
Code:
dd if=/dev/sda | gzip -c - | ssh -c blowfish root@{DEST_IP} "gzip -d -c - | dd of=/dev/sda"

You can watch the progress of dd by sending a USR1 signal to it.

When finished you should be able to mount the copied system.
Then make sure that your kernel has the needed modules compiled for vmware.

hth, Maurice
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security 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