Difference between revisions of "Application Templates"

From OpenVZ Virtuozzo Containers Wiki
Jump to: navigation, search
(adding basic content)
 
m (finish initial write-up)
Line 1: Line 1:
 
===Abstract===
 
===Abstract===
Application Templates (AT's) are commonly found when using Virtualization as a means to try out new software without having to perform a full manual install. Unfortunately, OpenVZ, as of yet, doesn't have any precreated AT's for people to try out, which might be attributed to the lack of documentation on how to create them. The primary goal of this howto is to give an overview of how an AT can be created for OpenVZ without too much trouble.
+
Application Templates (AT's) are commonly found when using Virtualization as a means to try out new software without having to perform a full manual install. Unfortunately, OpenVZ, as of yet, doesn't have any precreated AT's for people to try out, which might be attributed to the lack of documentation on how to create them. The primary goal of this howto is to give an overview of how an AT can be created for OpenVZ without too much trouble. This howto assumes the user is familiar with basic OpenVZ terminology and operation, so basic tasks such as setting VE memory, networking parameters, package repositories, etc are not covered here.
  
 
===Introduction===
 
===Introduction===
Line 6: Line 6:
  
 
===Step 1: The Base===
 
===Step 1: The Base===
Choose the base OS you'd like to use and find an existing VE template to use (or create your [{{fullurl:Category:Templates}} own]). For this document, I'm using the [http://download.openvz.org/template/precreated/contrib/centos-5-x86_64-default-5.2-20081107.tar.gz CentOS 5 x86_64] template
+
Choose the base OS you'd like to use and find an existing VE template to use (or create your [{{fullurl:Category:Templates}} own]). For this document, I'm using the [http://download.openvz.org/template/precreated/contrib/centos-5-x86_64-default-5.2-20081107.tar.gz CentOS 5 x86_64] template and will be installing Ruby-on-Rails.
 +
====Creating the bare VE====
 +
<pre>vzctl create 3000 --ostemplate centos-5-x86_64-default-5.2-20081107 --hostname RoR-AT
 +
vzctl set 3000 --userpasswd root:<whatever> --save</pre>
 +
 
 +
===Step 2: Software Installation===
 +
This is the part where you'll follow the application specific installation procedures. Make sure that you install all the dependancies and do a proper configuration so that the application is usable.
 +
In regards to Ruby-on-Rails, I found a good guide on installing RoR on CentOS [http://wiki.rubyonrails.org/rails/pages/RailsOnCentos here].
 +
 
 +
===Step 3: Package the Software===
 +
Once you have everything installed and configured, packaging is a simple procedure:
 +
*Remove any unecessary files (e.g. /tmp /var/tmp /usr/src/, any downloaded files, etc)
 +
*Stop the VE
 +
:<pre>vzctl stop 3000</pre>
 +
*Create a tar.gz of the /vz/private/$VEID directory
 +
:<pre>tar xfvz /vz/template/cache/centos-5-x86_64-RoR-AT-11152008.tar.gz /vz/private/3000/ </pre>
 +
*Done
 +
 
 +
===Step 4: Deployment/Distribution===
 +
To do rapid deployment of your new AT, you can utilize for/while loops to create multiple VE's as shown [[Demo scripts | here]].
 +
 
 +
As for distribution, please share any of the AT's you create [http://download.openvz.org/template/precreated/contrib/ here]

Revision as of 03:17, 16 November 2008

Abstract

Application Templates (AT's) are commonly found when using Virtualization as a means to try out new software without having to perform a full manual install. Unfortunately, OpenVZ, as of yet, doesn't have any precreated AT's for people to try out, which might be attributed to the lack of documentation on how to create them. The primary goal of this howto is to give an overview of how an AT can be created for OpenVZ without too much trouble. This howto assumes the user is familiar with basic OpenVZ terminology and operation, so basic tasks such as setting VE memory, networking parameters, package repositories, etc are not covered here.

Introduction

There are two ways to create an AT: as a full VE template, or an interactive shell script/installer that installs the software into an existing VE. The second method is more advanced, and will be very specific to the individual applications, so is out of the scope of this document.

Step 1: The Base

Choose the base OS you'd like to use and find an existing VE template to use (or create your own). For this document, I'm using the CentOS 5 x86_64 template and will be installing Ruby-on-Rails.

Creating the bare VE

vzctl create 3000 --ostemplate centos-5-x86_64-default-5.2-20081107 --hostname RoR-AT 
vzctl set 3000 --userpasswd root:<whatever> --save

Step 2: Software Installation

This is the part where you'll follow the application specific installation procedures. Make sure that you install all the dependancies and do a proper configuration so that the application is usable. In regards to Ruby-on-Rails, I found a good guide on installing RoR on CentOS here.

Step 3: Package the Software

Once you have everything installed and configured, packaging is a simple procedure:

  • Remove any unecessary files (e.g. /tmp /var/tmp /usr/src/, any downloaded files, etc)
  • Stop the VE
vzctl stop 3000
  • Create a tar.gz of the /vz/private/$VEID directory
tar xfvz /vz/template/cache/centos-5-x86_64-RoR-AT-11152008.tar.gz /vz/private/3000/ 
  • Done

Step 4: Deployment/Distribution

To do rapid deployment of your new AT, you can utilize for/while loops to create multiple VE's as shown here.

As for distribution, please share any of the AT's you create here