OpenVZ Forum


Home » General » Discussions » Using OpenVZ as a development environment
Using OpenVZ as a development environment [message #4222] Mon, 03 July 2006 08:56 Go to next message
bobmcgraw is currently offline  bobmcgraw
Messages: 5
Registered: June 2006
Location: London, UK
Junior Member
Hi all. I'm looking at using OpenVZ to create a simulated live environment for our coders.

Ideally, I'd like to replicate each existing live machines in a VPS per developer. From an admin side, I'd like to build a template for each machine, which will have varying versions of Apache, MySQL & PHP. This all appears possible but I’m unsure on what is the way forward from starting out with the template ‘fedora-core-5-i386-minimal’ and then moving to having templates my-db-server1 my-www-server1 etc that I can re-use.

Is all this possible and what would be the process? Is there anyway that I can copy an existing VPS I have configured (some packages have been installed from source).

Thanks in advance,
Bob

Re: Using OpenVZ as a development environment [message #4223 is a reply to message #4222] Mon, 03 July 2006 09:06 Go to previous messageGo to next message
kir is currently offline  kir
Messages: 1645
Registered: August 2005
Location: Moscow, Russia
Senior Member

(1) Install everything that is needed into a VE

(2) Remove VE-specific settings, such as root password and IP address (assuming VEID is 123):
vzctl set 123 --ipdel all --save
vzctl exec 123 /usr/sbin/usermod -L root


(3) Stop the VE:
vzctl stop 123


(4) Tar its private area, like this (assuming VEID is 123):
cd /vz/private/123
tar czf /vz/template/cache/fedora-core-5-i386-my_db_server.tar.gz .


(5) You can now use your new template to create more VEs:
vzctl create 456 --ostemplate fedora-core-5-i386-my_db_server


Please note that your OS template name should start with fedora-core-5, otherwise vzctl will not be able to guess how to set up networking and other parameters inside a VE. In other words, template name should start with linux distro name you use for it.

HTH


Kir Kolyshkin
http://static.openvz.org/userbars/openvz-developer.png
icon14.gif  Re: Using OpenVZ as a development environment [message #4230 is a reply to message #4223] Mon, 03 July 2006 11:53 Go to previous messageGo to next message
bobmcgraw is currently offline  bobmcgraw
Messages: 5
Registered: June 2006
Location: London, UK
Junior Member
Great stuff. That works like a charm! Thanks for the quick response.

From a maintenance perspective, If I create 2 VE's today, then need to apply a few updates tomorrow. Following these procedures will update existing VE's also?

Thanks,
Bob
Re: Using OpenVZ as a development environment [message #4232 is a reply to message #4230] Mon, 03 July 2006 12:14 Go to previous messageGo to next message
kir is currently offline  kir
Messages: 1645
Registered: August 2005
Location: Moscow, Russia
Senior Member

OS template is used to create new VEs; existing VEs are not affected by new/changed OS templates. So you need to update VEs separately.

Kir Kolyshkin
http://static.openvz.org/userbars/openvz-developer.png
Re: Using OpenVZ as a development environment [message #4297 is a reply to message #4232] Wed, 05 July 2006 09:03 Go to previous messageGo to next message
bobmcgraw is currently offline  bobmcgraw
Messages: 5
Registered: June 2006
Location: London, UK
Junior Member
Hi,

I have created a template 'baseinstall' as you have described. This has the basic set-up (users etc) across my servers.

From this I have created a number of (db|fs|www) templates.

When I try to then install apps on the db template, for example:

vzyum 102 install flex
Warning: Set baseinstall for fedora-core-5-i386 OS template not found


I won't install.... please can you advise?

Thanks,
Bob
Re: Using OpenVZ as a development environment [message #4299 is a reply to message #4297] Wed, 05 July 2006 09:24 Go to previous messageGo to next message
kir is currently offline  kir
Messages: 1645
Registered: August 2005
Location: Moscow, Russia
Senior Member

This is just a warning and can be safely ignored. Or are there other problems?

Kir Kolyshkin
http://static.openvz.org/userbars/openvz-developer.png
Re: Using OpenVZ as a development environment [message #4306 is a reply to message #4299] Wed, 05 July 2006 10:40 Go to previous messageGo to next message
bobmcgraw is currently offline  bobmcgraw
Messages: 5
Registered: June 2006
Location: London, UK
Junior Member
It didn't install, it gives the warning then exits.

root@hn1 vz]# vzyum 102 install flex
Warning: Set baseinstall for fedora-core-5-i386 OS template not found
[root@hn1 vz]# vzctl exec 102 lex --help
bash: lex: command not found
[root@hn1 vz]#


However, from strace I found a missing file.... I found the below fix works (and removes the warning):

cp /vz/template/fedora-core/5/i386/config/minimal.list /vz/template/fedora-core/5/i386/config/baseinstall.list


Cheers
Re: Using OpenVZ as a development environment [message #4668 is a reply to message #4306] Fri, 21 July 2006 08:53 Go to previous messageGo to next message
bobmcgraw is currently offline  bobmcgraw
Messages: 5
Registered: June 2006
Location: London, UK
Junior Member
Hi.

Regarding resources.

Would it be dangerous to set all memory barrier::limit UBC settings for all VPS's to that of the HN?

I want to allow VPS's to utilize all the server resource if possible.

Thanks in advance!
Bob
Re: Using OpenVZ as a development environment [message #4824 is a reply to message #4223] Thu, 27 July 2006 11:23 Go to previous message
alt0v14 is currently offline  alt0v14
Messages: 52
Registered: July 2006
Location: Ukraine Simferopol
Member
kir wrote on Mon, 03 July 2006 05:06

(1) Install

Please note that your OS template name should start with fedora-core-5, otherwise vzctl will not be able to guess how to set up networking and other parameters inside a VE. In other words, template name should start with linux distro name you use for it.

HTH


alternate method look at /etc/debian_version /etc/readhat_release /etc/slackware_version and so on Smile
Previous Topic: Control Panels
Next Topic: openvz and new kernels
Goto Forum:
  


Current Time: Tue Jun 06 05:16:59 GMT 2023

Total time taken to generate the page: 0.01500 seconds