OpenVZ Forum


Home » General » Support » Existing Templates
Existing Templates [message #646] Wed, 04 January 2006 03:09 Go to next message
AndyS is currently offline  AndyS
Messages: 3
Registered: January 2006
Junior Member
Hello all, just downloaded and installed OpenVZ, and i must say its a big improvement over other VPS systems that i have tested IMHO.

Just a quickie thou... I have currently installed the Fedora and CentOS templates supplied, and built the cache however noticed a few vital (well, not quite vital) utils are missing.

To add these, is it just a case of adding the necessary package name into either default.list or minimal.list files for example;

to include mysql to the default.list, just add the line mysql-server somewhere. or will i need to find all the dependency files as well.

I know its quite a novice question, and prob has been answered somewhere in the manuals. But i' ve read so much, i prob missed it a hundred and one times Surprised

Andy
Re: Existing Templates [message #715 is a reply to message #646] Sat, 07 January 2006 12:27 Go to previous messageGo to next message
kir is currently offline  kir
Messages: 1645
Registered: August 2005
Location: Moscow, Russia
Senior Member

You are right, all you have to do is to add, say, mysql-server into some .list file and run vzpkgcache. Deps will be resolved on the fly - that's the beauty of our template tools. Razz

You can also create a new .list file, say, full.list, based on default.list or minimal.list.


Kir Kolyshkin
http://static.openvz.org/userbars/openvz-developer.png
Re: Existing Templates [message #716 is a reply to message #646] Sat, 07 January 2006 12:28 Go to previous messageGo to next message
kir is currently offline  kir
Messages: 1645
Registered: August 2005
Location: Moscow, Russia
Senior Member

Another possibility - if you do not need mysql-server in every VPS - is to install it right after creating a VPS. You do like this:

vzctl start NNN
vzyum NNN install mysql-server

and you are all set Smile


Kir Kolyshkin
http://static.openvz.org/userbars/openvz-developer.png
Re: Existing Templates [message #725 is a reply to message #646] Sat, 07 January 2006 14:52 Go to previous messageGo to next message
kir is currently offline  kir
Messages: 1645
Registered: August 2005
Location: Moscow, Russia
Senior Member

AndyS wrote on Wed, 04 January 2006 06:09

Hello all, just downloaded and installed OpenVZ, and i must say its a big improvement over other VPS systems that i have tested IMHO.


Can you tell which ones have you tried, and why you found OpenVZ better than those?


Kir Kolyshkin
http://static.openvz.org/userbars/openvz-developer.png
Re: Existing Templates [message #726 is a reply to message #646] Sat, 07 January 2006 16:15 Go to previous messageGo to next message
AndyS is currently offline  AndyS
Messages: 3
Registered: January 2006
Junior Member
Quote:

Can you tell which ones have you tried, and why you found OpenVZ better than those?


Sure. I've tested most that i've come across, since the early days of FreeVSD, including Vserver, FreeVPS and so forth.

The main problem with all systems is **minor bugs** - However, if your trying to setup a professional hosting business, these bugs are more like major ones.

I find OpenVZ Much better as its quick to install and setup. I had it installed on a sandbox, 2 templates installed and 5 VPS's up and running in just over an hour.

It appears all VPS report correct stats. e.g, quotas, memory allocaton etc. This was a major problem using VServer.

VPS's remained up and running 2 days after booting them. Luckly their is the --onboot command, but this has not been needed so far. unlike vserver where the --onboot didn't work and i needed to manually boot 2 our of 3 servers manually on a daily bases

Installation of Webmin and Usermin works 100% - Using Vserver and others e.g FreeVPS this was hell to run.

I even got CPanel installed (i admit, i could not test it as i dont have a licnece, but it installed with minimal errors)

Ones that i've tested since the early days are FreeVPS, OpenVPS, FreeVSD, VServer, UML, Xen to name a few. All have errors from speed through to incorrect stats.

Im not yet up and running with a vps business yet, because of the above errors. Although with OpenVZ this could be possable sometime this year.

One downfall which i was hoping to see in OpenVZ is name-based servers instead of just IP Based. Only because when i start offering VPS i want to offer a 1 week trial. As you can guess, doing so people are going to sign up left right and center, costing me an arm and a leg buying new IP Addys.
Re: Existing Templates [message #728 is a reply to message #726] Sat, 07 January 2006 16:30 Go to previous messageGo to next message
vmvmvm is currently offline  vmvmvm
Messages: 51
Registered: January 2006
Member
Are named-based VPS really even possible? Do other VPS systems allow them?

It seems to me that http is the only protocal this would work for.

ssh, mail, etc. have no way to determine the host

You can NAT things out over the same IP but I did not know it was possible to do it incoming (unless each VPS is using a different port).

Re: Existing Templates [message #730 is a reply to message #646] Sun, 08 January 2006 05:39 Go to previous messageGo to next message
phpfreak is currently offline  phpfreak
Messages: 47
Registered: January 2006
Member
Here's how I found out how to create some easily customized templates.

1.) create a temporary ve and start it up:
vzctl create 1000 --ostemplate centos-4-i386-default
vzctl start 1000
vzctl enter 1000
(now type: su -)

2.) Now that you have your VE created, go ahead and make all of your customizations. Install whatever you want, custom compile anything, tweak out the various things you like, install custom firewall scripts etc. Then exit out.

exit
exit

3.) Shut down the VE
vzctl stop 1000

4.) Now, cd into the vz private directory on the host:

cd /vz/private/1000

5.) Next, tarball the root of the VE:

tar czpf /vz/template/cache/centos-4-i386-mycoolvz.tar.gz *

Now your template is ready to go. You can create a new copy of this VE anytime you want. Don't worry about the hostname, IP's or root passwords because you can reset those when you create a copy of your VE later on.

Here's a tip for you though, something I think works. If you don't name the template tarball such as 'centos-4-i386-xxx' and just name it 'myvz.tar.gz' when you create the VE you'll get a message that it could not find the distro type or something to that effect. That means that it won't use the template inside the centos directory to run the install-pre and install-post items and it wont obey the package lists in the spec files. In other words, it's an easy way to avoid having anything reinstalled on your VE that you uninstalled in your custom setup, when you go to recreate it.

Hope that info helps. I may be smoking crack, but it works well for me Smile



Re: Existing Templates [message #735 is a reply to message #730] Sun, 08 January 2006 06:17 Go to previous messageGo to next message
vmvmvm is currently offline  vmvmvm
Messages: 51
Registered: January 2006
Member
Hi,

I've been doing the same thing and it seems to work very well.

However I am curious :

1. are their special openvz files in the filesystem that should also be updated? It seems to work either way...

2. when openvz sets the ip, hostname, etc. is it running commands to do so? Does it just rely on the fact that most linux's will use /etc/resolv.conf for nameservers, etc.?

No real reason for asking - just curious.



Re: Existing Templates [message #737 is a reply to message #735] Sun, 08 January 2006 06:25 Go to previous messageGo to next message
phpfreak is currently offline  phpfreak
Messages: 47
Registered: January 2006
Member
Yeah, it runs scripts.

Check out /etc/sysconfig/vz-scripts/dists/scripts

Depending on the distro of your VE, it runs scripts ip_add.sh ip_del.sh and such. You can also look in the /etc/sysconfig/vz-scripts/dists directory for a list of distros and what scripts they use from the scripts directory.

By default i think they use some redhat / centos / fedora variant and it manages to work since I typically use CentOS for anything.



Re: Existing Templates [message #738 is a reply to message #726] Sun, 08 January 2006 12:51 Go to previous messageGo to next message
dev is currently offline  dev
Messages: 1693
Registered: September 2005
Location: Moscow
Senior Member

we have Name Based Hosting in Virtuozzo, but it's commercial yet so far Sad(

http://static.openvz.org/userbars/openvz-developer.png
Re: Existing Templates [message #739 is a reply to message #738] Sun, 08 January 2006 13:49 Go to previous messageGo to next message
vmvmvm is currently offline  vmvmvm
Messages: 51
Registered: January 2006
Member
Hi,

Is the named-based just for http or for everything?

Can multiple ve's use the same IP but still have their own ssh, ftp, etc. on standard ports?

I don't see how that would work.

Re: Existing Templates [message #741 is a reply to message #739] Sun, 08 January 2006 14:40 Go to previous messageGo to next message
dev is currently offline  dev
Messages: 1693
Registered: September 2005
Location: Moscow
Senior Member

It's for HTTP/FTP/POP3/SMTP.
each VPS has it's own private IP with HTTP/FTP/SSH daemons.


http://static.openvz.org/userbars/openvz-developer.png
Re: Existing Templates [message #746 is a reply to message #730] Mon, 09 January 2006 06:56 Go to previous messageGo to next message
kir is currently offline  kir
Messages: 1645
Registered: August 2005
Location: Moscow, Russia
Senior Member

Quote:

Don't worry about the hostname, IP's or root passwords because you can reset those when you create a copy of your VE later on.


Minor remark: it is even better to get rid of it before you create a tarball. Just do something like
vzctl set NNNN --ipdel all --save
vzctl exec NNNN usermod -L root

before doing 'vzctl stop' in your example


Kir Kolyshkin
http://static.openvz.org/userbars/openvz-developer.png
Re: Existing Templates [message #748 is a reply to message #735] Mon, 09 January 2006 07:21 Go to previous messageGo to next message
kir is currently offline  kir
Messages: 1645
Registered: August 2005
Location: Moscow, Russia
Senior Member

vmvmvm wrote on Sun, 08 January 2006 09:17


1. are their special openvz files in the filesystem that should also be updated? It seems to work either way...



No. OpenVZ tries to be as much as a real system, so no special stuff is needed. Also, see below

Quote:

2. when openvz sets the ip, hostname, etc. is it running commands to do so? Does it just rely on the fact that most linux's will use /etc/resolv.conf for nameservers, etc.?



For doing these operations, vzctl relies on a set of scripts in /etc/sysconfig/vz-scripts/dists/scripts/, and a few configs in the /etc/sysconfig/vz-scripts/dists/. vzctl first gets the value of OSTEMPLATE variable from VPS config file, then reads the appropriate config file, then executes the proper script.

So, for this to work properly, OSTEMPLATE should be set in VPS config (and should be valid, e.g. start from the word 'gentoo' for gentoo-based VPS), and a config file and a set of scripts for this OSTEMPLATE should exist.


Kir Kolyshkin
http://static.openvz.org/userbars/openvz-developer.png
Re: Existing Templates [message #750 is a reply to message #741] Mon, 09 January 2006 07:36 Go to previous messageGo to next message
vmvmvm is currently offline  vmvmvm
Messages: 51
Registered: January 2006
Member
dev wrote on Sun, 08 January 2006 09:40

It's for HTTP/FTP/POP3/SMTP.
each VPS has it's own private IP with HTTP/FTP/SSH daemons.



Do I understand correctly.

I can have one outside IP (routable) and then accept ftp, ssh, pop3, smtp etc. by domain name and route it to it's own internal IP?

I new this was possible with http due to the HTTP 1.1 host header. However I do not understand how the other protocals know which IP to route it to based on the domain name.

Or do I misunderstand what you mean?
Re: Existing Templates [message #751 is a reply to message #750] Mon, 09 January 2006 07:40 Go to previous messageGo to next message
dev is currently offline  dev
Messages: 1693
Registered: September 2005
Location: Moscow
Senior Member

You understand everything correct except for SSH. It doesn't work out of the box for such VPSs Sad
Actually even with ssh it's possible to redirect some predifened users to VPSs, but it won't connect with any credentials configured in VPS, only with those configure by host admin.


http://static.openvz.org/userbars/openvz-developer.png
Re: Existing Templates [message #752 is a reply to message #750] Mon, 09 January 2006 07:41 Go to previous message
dev is currently offline  dev
Messages: 1693
Registered: September 2005
Location: Moscow
Senior Member

I forgot to add, that for FTP and POP3 logins you will have to use full user name (user@domain)


http://static.openvz.org/userbars/openvz-developer.png
Previous Topic: Host: CentOS4, Guest: Debian, apt-get not working, strange problems
Next Topic: 061.1 Kernel RPM Error
Goto Forum:
  


Current Time: Sun Jul 21 14:24:59 GMT 2024

Total time taken to generate the page: 0.02419 seconds