Difference between revisions of "Creating a CentOS 5.0 Template"
Josh.hogle (talk | contribs) |
Josh.hogle (talk | contribs) |
||
Line 3: | Line 3: | ||
<p class=MsoNormal><b style='mso-bidi-font-weight:normal'><u><span | <p class=MsoNormal><b style='mso-bidi-font-weight:normal'><u><span | ||
style='font-size:14.0pt;font-family:Tahoma'>Creating a <span class=SpellE>CentOS</span> | style='font-size:14.0pt;font-family:Tahoma'>Creating a <span class=SpellE>CentOS</span> | ||
− | 5.0 Template for <span class=SpellE>OpenVZ</span | + | 5.0 Template for <span class=SpellE>OpenVZ</span></span></u></b></p> |
− | <p class=MsoNormal><span style='font-size:10.0pt;font-family:Tahoma' | + | <p class=MsoNormal><span style='font-size:10.0pt;font-family:Tahoma'> </span></p> |
<ol style='margin-top:0in' start=1 type=1> | <ol style='margin-top:0in' start=1 type=1> | ||
Line 13: | Line 13: | ||
that you wish to package.<span style='mso-spacerun:yes'> </span>This | that you wish to package.<span style='mso-spacerun:yes'> </span>This | ||
could be a minimal <span class=SpellE>distro</span> or the default <span | could be a minimal <span class=SpellE>distro</span> or the default <span | ||
− | class=SpellE>distro</span> or even something custom. | + | class=SpellE>distro</span> or even something custom.</span></li> |
<li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list .5in'><span | <li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list .5in'><span | ||
style='font-size:10.0pt;font-family:Tahoma'>Once the OS has been | style='font-size:10.0pt;font-family:Tahoma'>Once the OS has been | ||
installed, you need to <b style='mso-bidi-font-weight:normal'>tar</b> the | installed, you need to <b style='mso-bidi-font-weight:normal'>tar</b> the | ||
− | contents of the OS. | + | contents of the OS.</span></li> |
<ol style='margin-top:0in' start=1 type=a> | <ol style='margin-top:0in' start=1 type=a> | ||
<li class=MsoNormal style='mso-list:l0 level2 lfo1;tab-stops:list 1.0in'><span | <li class=MsoNormal style='mso-list:l0 level2 lfo1;tab-stops:list 1.0in'><span | ||
style='font-size:10.0pt;font-family:Tahoma'>First, create a file called <b | style='font-size:10.0pt;font-family:Tahoma'>First, create a file called <b | ||
style='mso-bidi-font-weight:normal'>/<span class=SpellE>tmp</span>/exclude | style='mso-bidi-font-weight:normal'>/<span class=SpellE>tmp</span>/exclude | ||
− | </b>and add the following lines to it: | + | </b>and add the following lines to it:</span></li> |
</ol> | </ol> | ||
</ol> | </ol> | ||
<p class=MsoNormal style='margin-left:.75in;text-indent:-.25in'><span | <p class=MsoNormal style='margin-left:.75in;text-indent:-.25in'><span | ||
− | style='font-size:10.0pt;font-family:"Courier New"' | + | style='font-size:10.0pt;font-family:"Courier New"'> </span></p> |
<p class=MsoNormal style='margin-left:1.25in;text-indent:-.25in'><span | <p class=MsoNormal style='margin-left:1.25in;text-indent:-.25in'><span | ||
− | style='font-size:10.0pt;font-family:"Courier New"'>.<span class=SpellE>bash_history</span | + | style='font-size:10.0pt;font-family:"Courier New"'>.<span class=SpellE>bash_history</span></span></p> |
<p class=MsoNormal style='margin-left:1.25in;text-indent:-.25in'><span | <p class=MsoNormal style='margin-left:1.25in;text-indent:-.25in'><span | ||
class=SpellE><span style='font-size:10.0pt;font-family:"Courier New"'>lost+found</span></span><span | class=SpellE><span style='font-size:10.0pt;font-family:"Courier New"'>lost+found</span></span><span | ||
− | style='font-size:10.0pt;font-family:"Courier New"' | + | style='font-size:10.0pt;font-family:"Courier New"'></span></p> |
<p class=MsoNormal style='margin-left:1.25in;text-indent:-.25in'><span | <p class=MsoNormal style='margin-left:1.25in;text-indent:-.25in'><span | ||
− | style='font-size:10.0pt;font-family:"Courier New"'>/dev/* | + | style='font-size:10.0pt;font-family:"Courier New"'>/dev/*</span></p> |
<p class=MsoNormal style='margin-left:1.25in;text-indent:-.25in'><span | <p class=MsoNormal style='margin-left:1.25in;text-indent:-.25in'><span | ||
− | style='font-size:10.0pt;font-family:"Courier New"'>/<span class=SpellE>mnt</span>/* | + | style='font-size:10.0pt;font-family:"Courier New"'>/<span class=SpellE>mnt</span>/*</span></p> |
<p class=MsoNormal style='margin-left:1.25in;text-indent:-.25in'><span | <p class=MsoNormal style='margin-left:1.25in;text-indent:-.25in'><span | ||
− | style='font-size:10.0pt;font-family:"Courier New"'>/<span class=SpellE>tmp</span>/* | + | style='font-size:10.0pt;font-family:"Courier New"'>/<span class=SpellE>tmp</span>/*</span></p> |
<p class=MsoNormal style='margin-left:1.25in;text-indent:-.25in'><span | <p class=MsoNormal style='margin-left:1.25in;text-indent:-.25in'><span | ||
− | style='font-size:10.0pt;font-family:"Courier New"'>/proc/* | + | style='font-size:10.0pt;font-family:"Courier New"'>/proc/*</span></p> |
<p class=MsoNormal style='margin-left:1.25in;text-indent:-.25in'><span | <p class=MsoNormal style='margin-left:1.25in;text-indent:-.25in'><span | ||
− | style='font-size:10.0pt;font-family:"Courier New"'>/sys/* | + | style='font-size:10.0pt;font-family:"Courier New"'>/sys/*</span></p> |
<p class=MsoNormal style='margin-left:1.25in;text-indent:-.25in'><span | <p class=MsoNormal style='margin-left:1.25in;text-indent:-.25in'><span | ||
− | style='font-size:10.0pt;font-family:"Courier New"'>/<span class=SpellE>usr/src</span>/* | + | style='font-size:10.0pt;font-family:"Courier New"'>/<span class=SpellE>usr/src</span>/*</span></p> |
<p class=MsoNormal style='margin-left:.75in;text-indent:-.25in'><span | <p class=MsoNormal style='margin-left:.75in;text-indent:-.25in'><span | ||
− | style='font-size:10.0pt;font-family:Tahoma' | + | style='font-size:10.0pt;font-family:Tahoma'> </span></p> |
<ol style='margin-top:0in' start=2 type=1> | <ol style='margin-top:0in' start=2 type=1> | ||
Line 61: | Line 61: | ||
<li class=MsoNormal style='mso-list:l0 level2 lfo1;tab-stops:list 1.0in'><span | <li class=MsoNormal style='mso-list:l0 level2 lfo1;tab-stops:list 1.0in'><span | ||
style='font-size:10.0pt;font-family:Tahoma'>Now, <b style='mso-bidi-font-weight: | style='font-size:10.0pt;font-family:Tahoma'>Now, <b style='mso-bidi-font-weight: | ||
− | normal'>tar </b>the OS file up by typing: | + | normal'>tar </b>the OS file up by typing:</span></li> |
</ol> | </ol> | ||
</ol> | </ol> | ||
<p class=MsoNormal style='margin-left:.75in;text-indent:-.25in'><span | <p class=MsoNormal style='margin-left:.75in;text-indent:-.25in'><span | ||
− | style='font-size:10.0pt;font-family:"Courier New"' | + | style='font-size:10.0pt;font-family:"Courier New"'> </span></p> |
<p class=MsoNormal style='margin-left:1.0in'><span style='font-size:10.0pt; | <p class=MsoNormal style='margin-left:1.0in'><span style='font-size:10.0pt; | ||
font-family:"Courier New"'>tar –<span class=SpellE>czvf</span> | font-family:"Courier New"'>tar –<span class=SpellE>czvf</span> | ||
/tmp/centos-5.0-<ARCH>-<DISTRO>-<span class=SpellE>image.tar.gz</span> | /tmp/centos-5.0-<ARCH>-<DISTRO>-<span class=SpellE>image.tar.gz</span> | ||
− | / –X<span style='mso-spacerun:yes'> </span>/<span class=SpellE>tmp</span>/exclude | + | / –X<span style='mso-spacerun:yes'> </span>/<span class=SpellE>tmp</span>/exclude</span></p> |
<p class=MsoNormal style='margin-left:.75in;text-indent:-.25in'><span | <p class=MsoNormal style='margin-left:.75in;text-indent:-.25in'><span | ||
style='font-size:10.0pt;font-family:"Courier New"'><span style='mso-tab-count: | style='font-size:10.0pt;font-family:"Courier New"'><span style='mso-tab-count: | ||
− | 2'> </span | + | 2'> </span></span></p> |
<p class=MsoNormal style='margin-left:1.0in'><span style='font-size:10.0pt; | <p class=MsoNormal style='margin-left:1.0in'><span style='font-size:10.0pt; | ||
Line 82: | Line 82: | ||
or <b style='mso-bidi-font-weight:normal'>x86_64</b>) and <b style='mso-bidi-font-weight: | or <b style='mso-bidi-font-weight:normal'>x86_64</b>) and <b style='mso-bidi-font-weight: | ||
normal'><DISTRO></b> represents the distribution (<b style='mso-bidi-font-weight: | normal'><DISTRO></b> represents the distribution (<b style='mso-bidi-font-weight: | ||
− | normal'>default</b>, <b style='mso-bidi-font-weight:normal'>minimal</b>, etc.). | + | normal'>default</b>, <b style='mso-bidi-font-weight:normal'>minimal</b>, etc.).</span></p> |
<ol style='margin-top:0in' start=2 type=1> | <ol style='margin-top:0in' start=2 type=1> | ||
Line 89: | Line 89: | ||
style='font-size:10.0pt;font-family:Tahoma'>Now transfer the file over to | style='font-size:10.0pt;font-family:Tahoma'>Now transfer the file over to | ||
the <span class=SpellE>OpenVZ</span> server into <b style='mso-bidi-font-weight: | the <span class=SpellE>OpenVZ</span> server into <b style='mso-bidi-font-weight: | ||
− | normal'>/<span class=SpellE>vz</span>/template/cache </b>folder. | + | normal'>/<span class=SpellE>vz</span>/template/cache </b>folder.</span></li> |
</ol> | </ol> | ||
<li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list .5in'><span | <li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list .5in'><span | ||
Line 96: | Line 96: | ||
style='mso-bidi-font-weight:normal'>/vz/private/50</b> and copying the <b | style='mso-bidi-font-weight:normal'>/vz/private/50</b> and copying the <b | ||
style='mso-bidi-font-weight:normal'>/<span class=SpellE>etc/vz/conf/ve-vps.basic.conf-sample</span></b> | style='mso-bidi-font-weight:normal'>/<span class=SpellE>etc/vz/conf/ve-vps.basic.conf-sample</span></b> | ||
− | to <b style='mso-bidi-font-weight:normal'>/etc/vz/conf/50.conf</b>. | + | to <b style='mso-bidi-font-weight:normal'>/etc/vz/conf/50.conf</b>.</span></li> |
</ol> | </ol> | ||
<p class=MsoNormal style='margin-left:.25in'><span style='font-size:10.0pt; | <p class=MsoNormal style='margin-left:.25in'><span style='font-size:10.0pt; | ||
− | font-family:Tahoma' | + | font-family:Tahoma'> </span></p> |
<p class=MsoNormal style='margin-left:.5in'><b style='mso-bidi-font-weight: | <p class=MsoNormal style='margin-left:.5in'><b style='mso-bidi-font-weight: | ||
− | normal'><span style='font-size:8.0pt;font-family:Tahoma;color:red'>NOTE: | + | normal'><span style='font-size:8.0pt;font-family:Tahoma;color:red'>NOTE:</span></b></p> |
<p class=MsoNormal style='margin-left:.5in'><b style='mso-bidi-font-weight: | <p class=MsoNormal style='margin-left:.5in'><b style='mso-bidi-font-weight: | ||
Line 109: | Line 109: | ||
style='font-size:8.0pt;font-family:Tahoma;color:red'> is the VEID for the | style='font-size:8.0pt;font-family:Tahoma;color:red'> is the VEID for the | ||
VPS.<span style='mso-spacerun:yes'> </span>You can choose any unused VEID on | VPS.<span style='mso-spacerun:yes'> </span>You can choose any unused VEID on | ||
− | the <span class=SpellE>OpenVZ</span> server. | + | the <span class=SpellE>OpenVZ</span> server.</span></p> |
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:8.0pt; | <p class=MsoNormal style='margin-left:.5in'><span style='font-size:8.0pt; | ||
− | font-family:Tahoma' | + | font-family:Tahoma'> </span></p> |
<ol style='margin-top:0in' start=4 type=1> | <ol style='margin-top:0in' start=4 type=1> | ||
Line 119: | Line 119: | ||
<b style='mso-bidi-font-weight:normal'>/vz/template/centos/5.0/<ARCH>/<span | <b style='mso-bidi-font-weight:normal'>/vz/template/centos/5.0/<ARCH>/<span | ||
class=SpellE>config</span></b> again where <b style='mso-bidi-font-weight: | class=SpellE>config</span></b> again where <b style='mso-bidi-font-weight: | ||
− | normal'><ARCH></b> represents the system architecture. | + | normal'><ARCH></b> represents the system architecture.</span></li> |
<li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list .5in'><span | <li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list .5in'><span | ||
style='font-size:10.0pt;font-family:Tahoma'>Create a file in the folder | style='font-size:10.0pt;font-family:Tahoma'>Create a file in the folder | ||
called <b style='mso-bidi-font-weight:normal'>rpm</b> and add the | called <b style='mso-bidi-font-weight:normal'>rpm</b> and add the | ||
− | following line: | + | following line:</span></li> |
</ol> | </ol> | ||
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt; | <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt; | ||
− | font-family:"Courier New"' | + | font-family:"Courier New"'> </span></p> |
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt; | <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt; | ||
− | font-family:"Courier New"'>43 | + | font-family:"Courier New"'>43</span></p> |
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt; | <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt; | ||
− | font-family:"Courier New"' | + | font-family:"Courier New"'> </span></p> |
<ol style='margin-top:0in' start=6 type=1> | <ol style='margin-top:0in' start=6 type=1> | ||
Line 139: | Line 139: | ||
style='font-size:10.0pt;font-family:Tahoma'>Create a file called <span | style='font-size:10.0pt;font-family:Tahoma'>Create a file called <span | ||
class=SpellE><b style='mso-bidi-font-weight:normal'>yum.conf</b></span> in | class=SpellE><b style='mso-bidi-font-weight:normal'>yum.conf</b></span> in | ||
− | the folder and add the following lines: | + | the folder and add the following lines:</span></li> |
</ol> | </ol> | ||
<p class=MsoNormal style='margin-left:.25in'><span style='font-size:10.0pt; | <p class=MsoNormal style='margin-left:.25in'><span style='font-size:10.0pt; | ||
− | font-family:Tahoma' | + | font-family:Tahoma'> </span></p> |
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt; | <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt; | ||
− | font-family:"Courier New"'>[main] | + | font-family:"Courier New"'>[main]</span></p> |
<p class=MsoNormal style='margin-left:.5in'><span class=SpellE><span | <p class=MsoNormal style='margin-left:.5in'><span class=SpellE><span | ||
style='font-size:10.0pt;font-family:"Courier New"'>cachedir</span></span><span | style='font-size:10.0pt;font-family:"Courier New"'>cachedir</span></span><span | ||
− | style='font-size:10.0pt;font-family:"Courier New"'>=/vz/template/centos/5.0/<ARCH>/yum-cache/ | + | style='font-size:10.0pt;font-family:"Courier New"'>=/vz/template/centos/5.0/<ARCH>/yum-cache/</span></p> |
<p class=MsoNormal style='margin-left:.5in'><span class=SpellE><span | <p class=MsoNormal style='margin-left:.5in'><span class=SpellE><span | ||
style='font-size:10.0pt;font-family:"Courier New"'>reposdir</span></span><span | style='font-size:10.0pt;font-family:"Courier New"'>reposdir</span></span><span | ||
− | style='font-size:10.0pt;font-family:"Courier New"'>=/dev/null | + | style='font-size:10.0pt;font-family:"Courier New"'>=/dev/null</span></p> |
<p class=MsoNormal style='margin-left:.5in'><span class=SpellE><span | <p class=MsoNormal style='margin-left:.5in'><span class=SpellE><span | ||
style='font-size:10.0pt;font-family:"Courier New"'>installonlypkgs</span></span><span | style='font-size:10.0pt;font-family:"Courier New"'>installonlypkgs</span></span><span | ||
− | style='font-size:10.0pt;font-family:"Courier New"'>='' | + | style='font-size:10.0pt;font-family:"Courier New"'>=''</span></p> |
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt; | <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt; | ||
− | font-family:"Courier New"' | + | font-family:"Courier New"'> </span></p> |
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt; | <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt; | ||
− | font-family:"Courier New"'>[centos5-base] | + | font-family:"Courier New"'>[centos5-base]</span></p> |
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt; | <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt; | ||
font-family:"Courier New"'>name=<span class=SpellE>CentOS</span> 5 - <ARCH> | font-family:"Courier New"'>name=<span class=SpellE>CentOS</span> 5 - <ARCH> | ||
− | - Base | + | - Base</span></p> |
<p class=MsoNormal style='margin-left:.5in'><span class=SpellE><span | <p class=MsoNormal style='margin-left:.5in'><span class=SpellE><span | ||
style='font-size:10.0pt;font-family:"Courier New"'>baseurl</span></span><span | style='font-size:10.0pt;font-family:"Courier New"'>baseurl</span></span><span | ||
− | style='font-size:10.0pt;font-family:"Courier New"'>=http://mirror.centos.org/centos/5/os/<ARCH>/ | + | style='font-size:10.0pt;font-family:"Courier New"'>=http://mirror.centos.org/centos/5/os/<ARCH>/</span></p> |
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt; | <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt; | ||
− | font-family:"Courier New"'>enabled=1 | + | font-family:"Courier New"'>enabled=1</span></p> |
<p class=MsoNormal style='margin-left:.5in'><span class=SpellE><span | <p class=MsoNormal style='margin-left:.5in'><span class=SpellE><span | ||
style='font-size:10.0pt;font-family:"Courier New"'>gpgcheck</span></span><span | style='font-size:10.0pt;font-family:"Courier New"'>gpgcheck</span></span><span | ||
− | style='font-size:10.0pt;font-family:"Courier New"'>=1 | + | style='font-size:10.0pt;font-family:"Courier New"'>=1</span></p> |
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt; | <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt; | ||
− | font-family:"Courier New"' | + | font-family:"Courier New"'> </span></p> |
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt; | <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt; | ||
− | font-family:"Courier New"'>[centos5-updates-released] | + | font-family:"Courier New"'>[centos5-updates-released]</span></p> |
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt; | <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt; | ||
font-family:"Courier New"'>name=<span class=SpellE>CentOS</span> 5 - <ARCH> | font-family:"Courier New"'>name=<span class=SpellE>CentOS</span> 5 - <ARCH> | ||
− | - Released Updates | + | - Released Updates</span></p> |
<p class=MsoNormal style='margin-left:.5in'><span class=SpellE><span | <p class=MsoNormal style='margin-left:.5in'><span class=SpellE><span | ||
style='font-size:10.0pt;font-family:"Courier New"'>baseurl</span></span><span | style='font-size:10.0pt;font-family:"Courier New"'>baseurl</span></span><span | ||
− | style='font-size:10.0pt;font-family:"Courier New"'>=http://mirror.centos.org/centos/5/updates/<ARCH>/ | + | style='font-size:10.0pt;font-family:"Courier New"'>=http://mirror.centos.org/centos/5/updates/<ARCH>/</span></p> |
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt; | <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt; | ||
− | font-family:"Courier New"'>enabled=1 | + | font-family:"Courier New"'>enabled=1</span></p> |
<p class=MsoNormal style='margin-left:.5in'><span class=SpellE><span | <p class=MsoNormal style='margin-left:.5in'><span class=SpellE><span | ||
style='font-size:10.0pt;font-family:"Courier New"'>gpgcheck</span></span><span | style='font-size:10.0pt;font-family:"Courier New"'>gpgcheck</span></span><span | ||
− | style='font-size:10.0pt;font-family:"Courier New"'>=1 | + | style='font-size:10.0pt;font-family:"Courier New"'>=1</span></p> |
<ol style='margin-top:0in' start=7 type=1> | <ol style='margin-top:0in' start=7 type=1> | ||
Line 206: | Line 206: | ||
style='font-size:10.0pt;font-family:Tahoma'>Copy <b style='mso-bidi-font-weight: | style='font-size:10.0pt;font-family:Tahoma'>Copy <b style='mso-bidi-font-weight: | ||
normal'>/etc/vz/dists/centos-4.conf</b> to <b style='mso-bidi-font-weight: | normal'>/etc/vz/dists/centos-4.conf</b> to <b style='mso-bidi-font-weight: | ||
− | normal'>/etc/vz/dists/centos-5.0.conf</b>. | + | normal'>/etc/vz/dists/centos-5.0.conf</b>.</span></li> |
<li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list .5in'><span | <li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list .5in'><span | ||
style='font-size:10.0pt;font-family:Tahoma'>Change to the <b | style='font-size:10.0pt;font-family:Tahoma'>Change to the <b | ||
Line 216: | Line 216: | ||
class=SpellE>image.tar.gz</span> | tar –<span class=SpellE>xvf</span> –<b | class=SpellE>image.tar.gz</span> | tar –<span class=SpellE>xvf</span> –<b | ||
style='mso-bidi-font-weight:normal'> </b></span><span style='font-size: | style='mso-bidi-font-weight:normal'> </b></span><span style='font-size: | ||
− | 10.0pt;font-family:Tahoma'>to unpack the base image to the folder. | + | 10.0pt;font-family:Tahoma'>to unpack the base image to the folder.</span></li> |
<li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list .5in'><span | <li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list .5in'><span | ||
style='font-size:10.0pt;font-family:Tahoma'>Make sure you are in the <b | style='font-size:10.0pt;font-family:Tahoma'>Make sure you are in the <b | ||
− | style='mso-bidi-font-weight:normal'>/vz/private/50</b> folder. | + | style='mso-bidi-font-weight:normal'>/vz/private/50</b> folder.</span></li> |
<li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list .5in'><span | <li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list .5in'><span | ||
style='font-size:10.0pt;font-family:Tahoma'>Edit <b style='mso-bidi-font-weight: | style='font-size:10.0pt;font-family:Tahoma'>Edit <b style='mso-bidi-font-weight: | ||
normal'>etc/shadow</b> and remove the replace the <b style='mso-bidi-font-weight: | normal'>etc/shadow</b> and remove the replace the <b style='mso-bidi-font-weight: | ||
normal'>root</b> password with <b style='mso-bidi-font-weight:normal'>!!</b> | normal'>root</b> password with <b style='mso-bidi-font-weight:normal'>!!</b> | ||
− | instead of the hashed value. | + | instead of the hashed value.</span></li> |
<li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list .5in'><span | <li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list .5in'><span | ||
style='font-size:10.0pt;font-family:Tahoma'>Edit the <b style='mso-bidi-font-weight: | style='font-size:10.0pt;font-family:Tahoma'>Edit the <b style='mso-bidi-font-weight: | ||
Line 232: | Line 232: | ||
style='mso-bidi-font-weight:normal'>tty1</b> through <b style='mso-bidi-font-weight: | style='mso-bidi-font-weight:normal'>tty1</b> through <b style='mso-bidi-font-weight: | ||
normal'>tty6</b>.<span style='mso-spacerun:yes'> </span>Just put a <b | normal'>tty6</b>.<span style='mso-spacerun:yes'> </span>Just put a <b | ||
− | style='mso-bidi-font-weight:normal'>#</b> at the beginning of the line. | + | style='mso-bidi-font-weight:normal'>#</b> at the beginning of the line.</span></li> |
<li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list .5in'><span | <li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list .5in'><span | ||
style='font-size:10.0pt;font-family:Tahoma'>Remove the <b | style='font-size:10.0pt;font-family:Tahoma'>Remove the <b | ||
Line 240: | Line 240: | ||
style='font-size:10.0pt;font-family:"Courier New"'> –s /proc/mounts etc/<span | style='font-size:10.0pt;font-family:"Courier New"'> –s /proc/mounts etc/<span | ||
class=SpellE>mtab</span></span><span style='font-size:10.0pt;font-family: | class=SpellE>mtab</span></span><span style='font-size:10.0pt;font-family: | ||
− | Tahoma'>. | + | Tahoma'>.</span></li> |
<li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list .5in'><span | <li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list .5in'><span | ||
style='font-size:10.0pt;font-family:Tahoma'>Remove all of the lines from <b | style='font-size:10.0pt;font-family:Tahoma'>Remove all of the lines from <b | ||
style='mso-bidi-font-weight:normal'>etc/<span class=SpellE>fstab</span></b> | style='mso-bidi-font-weight:normal'>etc/<span class=SpellE>fstab</span></b> | ||
− | except for the line that mounts <b style='mso-bidi-font-weight:normal'>/dev/pts</b>. | + | except for the line that mounts <b style='mso-bidi-font-weight:normal'>/dev/pts</b>.</span></li> |
<li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list .5in'><span | <li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list .5in'><span | ||
style='font-size:10.0pt;font-family:Tahoma'>Edit <b style='mso-bidi-font-weight: | style='font-size:10.0pt;font-family:Tahoma'>Edit <b style='mso-bidi-font-weight: | ||
Line 250: | Line 250: | ||
the line that starts <b style='mso-bidi-font-weight:normal'>/<span | the line that starts <b style='mso-bidi-font-weight:normal'>/<span | ||
class=SpellE>sbin/start_udev</span></b> by placing a <b style='mso-bidi-font-weight: | class=SpellE>sbin/start_udev</span></b> by placing a <b style='mso-bidi-font-weight: | ||
− | normal'>#</b> at the beginning of the line. | + | normal'>#</b> at the beginning of the line.</span></li> |
<li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list .5in'><span | <li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list .5in'><span | ||
style='font-size:10.0pt;font-family:Tahoma'>Now create device nodes by | style='font-size:10.0pt;font-family:Tahoma'>Now create device nodes by | ||
− | typing: | + | typing:</span></li> |
</ol> | </ol> | ||
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt; | <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt; | ||
− | font-family:"Courier New"' | + | font-family:"Courier New"'> </span></p> |
<p class=MsoNormal style='margin-left:.5in'><span class=SpellE><span | <p class=MsoNormal style='margin-left:.5in'><span class=SpellE><span | ||
style='font-size:10.0pt;font-family:"Courier New"'>mknod</span></span><span | style='font-size:10.0pt;font-family:"Courier New"'>mknod</span></span><span | ||
style='font-size:10.0pt;font-family:"Courier New"'> dev/<span class=SpellE>ptmx</span> | style='font-size:10.0pt;font-family:"Courier New"'> dev/<span class=SpellE>ptmx</span> | ||
− | c 5 2 | + | c 5 2</span></p> |
<p class=MsoNormal style='margin-left:.5in'><span class=SpellE><span | <p class=MsoNormal style='margin-left:.5in'><span class=SpellE><span | ||
style='font-size:10.0pt;font-family:"Courier New"'>mkdir</span></span><span | style='font-size:10.0pt;font-family:"Courier New"'>mkdir</span></span><span | ||
− | style='font-size:10.0pt;font-family:"Courier New"'> dev/pts | + | style='font-size:10.0pt;font-family:"Courier New"'> dev/pts</span></p> |
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt; | <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt; | ||
font-family:"Courier New"'>/<span class=SpellE>sbin</span>/MAKEDEV –d | font-family:"Courier New"'>/<span class=SpellE>sbin</span>/MAKEDEV –d | ||
− | /vz/private/50/dev <span class=SpellE>ttyp</span> <span class=SpellE>ptyp</span | + | /vz/private/50/dev <span class=SpellE>ttyp</span> <span class=SpellE>ptyp</span></span></p> |
<p class=MsoNormal style='margin-left:.5in'><span class=SpellE><span | <p class=MsoNormal style='margin-left:.5in'><span class=SpellE><span | ||
style='font-size:10.0pt;font-family:"Courier New"'>mknod</span></span><span | style='font-size:10.0pt;font-family:"Courier New"'>mknod</span></span><span | ||
− | style='font-size:10.0pt;font-family:"Courier New"'> dev/null c 1 3 | + | style='font-size:10.0pt;font-family:"Courier New"'> dev/null c 1 3</span></p> |
<p class=MsoNormal style='margin-left:.5in'><span class=SpellE><span | <p class=MsoNormal style='margin-left:.5in'><span class=SpellE><span | ||
style='font-size:10.0pt;font-family:"Courier New"'>mknod</span></span><span | style='font-size:10.0pt;font-family:"Courier New"'>mknod</span></span><span | ||
style='font-size:10.0pt;font-family:"Courier New"'> dev/<span class=SpellE>urandom</span> | style='font-size:10.0pt;font-family:"Courier New"'> dev/<span class=SpellE>urandom</span> | ||
− | c 1 9 | + | c 1 9</span></p> |
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt; | <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt; | ||
− | font-family:"Courier New"' | + | font-family:"Courier New"'> </span></p> |
<ol style='margin-top:0in' start=16 type=1> | <ol style='margin-top:0in' start=16 type=1> | ||
Line 288: | Line 288: | ||
style='font-size:10.0pt;font-family:Tahoma'>Create the <span class=SpellE><b | style='font-size:10.0pt;font-family:Tahoma'>Create the <span class=SpellE><b | ||
style='mso-bidi-font-weight:normal'>var</b></span><b style='mso-bidi-font-weight: | style='mso-bidi-font-weight:normal'>var</b></span><b style='mso-bidi-font-weight: | ||
− | normal'>/lock/rpm</b> folder. | + | normal'>/lock/rpm</b> folder.</span></li> |
<li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list .5in'><span | <li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list .5in'><span | ||
style='font-size:10.0pt;font-family:Tahoma'>If you wish to disable IPv6, | style='font-size:10.0pt;font-family:Tahoma'>If you wish to disable IPv6, | ||
− | do the following: | + | do the following:</span></li> |
<ol style='margin-top:0in' start=1 type=a> | <ol style='margin-top:0in' start=1 type=a> | ||
<li class=MsoNormal style='mso-list:l0 level2 lfo1;tab-stops:list 1.0in'><span | <li class=MsoNormal style='mso-list:l0 level2 lfo1;tab-stops:list 1.0in'><span | ||
Line 297: | Line 297: | ||
normal'>etc/<span class=SpellE>sysconfig</span>/network</b> and set <b | normal'>etc/<span class=SpellE>sysconfig</span>/network</b> and set <b | ||
style='mso-bidi-font-weight:normal'>NETWORKING_IPV6</b> to <b | style='mso-bidi-font-weight:normal'>NETWORKING_IPV6</b> to <b | ||
− | style='mso-bidi-font-weight:normal'>no</b>. | + | style='mso-bidi-font-weight:normal'>no</b>.</span></li> |
<li class=MsoNormal style='mso-list:l0 level2 lfo1;tab-stops:list 1.0in'><span | <li class=MsoNormal style='mso-list:l0 level2 lfo1;tab-stops:list 1.0in'><span | ||
style='font-size:10.0pt;font-family:Tahoma'>Add the following lines to <b | style='font-size:10.0pt;font-family:Tahoma'>Add the following lines to <b | ||
− | style='mso-bidi-font-weight:normal'>etc/<span class=SpellE>modprobe.d</span>/blacklist</b>: | + | style='mso-bidi-font-weight:normal'>etc/<span class=SpellE>modprobe.d</span>/blacklist</b>:</span></li> |
</ol> | </ol> | ||
</ol> | </ol> | ||
<p class=MsoNormal style='margin-left:1.0in'><span style='font-size:10.0pt; | <p class=MsoNormal style='margin-left:1.0in'><span style='font-size:10.0pt; | ||
− | font-family:"Courier New"' | + | font-family:"Courier New"'> </span></p> |
<p class=MsoNormal style='margin-left:1.0in'><span style='font-size:10.0pt; | <p class=MsoNormal style='margin-left:1.0in'><span style='font-size:10.0pt; | ||
− | font-family:"Courier New"'>blacklist ipv6 | + | font-family:"Courier New"'>blacklist ipv6</span></p> |
<p class=MsoNormal style='margin-left:1.0in'><span style='font-size:10.0pt; | <p class=MsoNormal style='margin-left:1.0in'><span style='font-size:10.0pt; | ||
− | font-family:"Courier New"'>blacklist net-pf-10 | + | font-family:"Courier New"'>blacklist net-pf-10</span></p> |
<p class=MsoNormal style='margin-left:1.0in'><span style='font-size:10.0pt; | <p class=MsoNormal style='margin-left:1.0in'><span style='font-size:10.0pt; | ||
− | font-family:"Courier New"' | + | font-family:"Courier New"'> </span></p> |
<ol style='margin-top:0in' start=18 type=1> | <ol style='margin-top:0in' start=18 type=1> | ||
Line 324: | Line 324: | ||
number starting from <b style='mso-bidi-font-weight:normal'>0</b>) and | number starting from <b style='mso-bidi-font-weight:normal'>0</b>) and | ||
setting <b style='mso-bidi-font-weight:normal'>ONBOOT</b> to <b | setting <b style='mso-bidi-font-weight:normal'>ONBOOT</b> to <b | ||
− | style='mso-bidi-font-weight:normal'>no</b>. | + | style='mso-bidi-font-weight:normal'>no</b>.</span></li> |
<li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list .5in'><span | <li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list .5in'><span | ||
style='font-size:10.0pt;font-family:Tahoma'>Now you’re ready to start the | style='font-size:10.0pt;font-family:Tahoma'>Now you’re ready to start the | ||
Line 330: | Line 330: | ||
class=SpellE><span style='font-size:10.0pt;font-family:"Courier New"'>vzctl</span></span><span | class=SpellE><span style='font-size:10.0pt;font-family:"Courier New"'>vzctl</span></span><span | ||
style='font-size:10.0pt;font-family:"Courier New"'> start 50</span><span | style='font-size:10.0pt;font-family:"Courier New"'> start 50</span><span | ||
− | style='font-size:10.0pt;font-family:Tahoma'> and wait for it to start. | + | style='font-size:10.0pt;font-family:Tahoma'> and wait for it to start.</span></li> |
<li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list .5in'><span | <li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list .5in'><span | ||
style='font-size:10.0pt;font-family:Tahoma'>You can install additional | style='font-size:10.0pt;font-family:Tahoma'>You can install additional | ||
Line 337: | Line 337: | ||
<package></span><span style='font-size:10.0pt;font-family:Tahoma'> | <package></span><span style='font-size:10.0pt;font-family:Tahoma'> | ||
at the prompt where <b style='mso-bidi-font-weight:normal'><package></b> | at the prompt where <b style='mso-bidi-font-weight:normal'><package></b> | ||
− | represents the name of the software package you wish to install. | + | represents the name of the software package you wish to install.</span></li> |
<li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list .5in'><span | <li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list .5in'><span | ||
style='font-size:10.0pt;font-family:Tahoma'>Finally, you should turn off | style='font-size:10.0pt;font-family:Tahoma'>Finally, you should turn off | ||
− | unnecessary services. | + | unnecessary services.</span></li> |
<ol style='margin-top:0in' start=1 type=a> | <ol style='margin-top:0in' start=1 type=a> | ||
<li class=MsoNormal style='mso-list:l0 level2 lfo1;tab-stops:list 1.0in'><span | <li class=MsoNormal style='mso-list:l0 level2 lfo1;tab-stops:list 1.0in'><span | ||
Line 346: | Line 346: | ||
class=SpellE><span style='font-size:10.0pt;font-family:"Courier New"'>vzctl</span></span><span | class=SpellE><span style='font-size:10.0pt;font-family:"Courier New"'>vzctl</span></span><span | ||
style='font-size:10.0pt;font-family:"Courier New"'> enter 50</span><span | style='font-size:10.0pt;font-family:"Courier New"'> enter 50</span><span | ||
− | style='font-size:10.0pt;font-family:Tahoma'>. | + | style='font-size:10.0pt;font-family:Tahoma'>.</span></li> |
<li class=MsoNormal style='mso-list:l0 level2 lfo1;tab-stops:list 1.0in'><span | <li class=MsoNormal style='mso-list:l0 level2 lfo1;tab-stops:list 1.0in'><span | ||
style='font-size:10.0pt;font-family:Tahoma'>View the services that are | style='font-size:10.0pt;font-family:Tahoma'>View the services that are | ||
Line 353: | Line 353: | ||
style='font-size:10.0pt;font-family:"Courier New"'> --list | <span | style='font-size:10.0pt;font-family:"Courier New"'> --list | <span | ||
class=SpellE>grep</span> 5:on</span><span style='font-size:10.0pt; | class=SpellE>grep</span> 5:on</span><span style='font-size:10.0pt; | ||
− | font-family:Tahoma'>. | + | font-family:Tahoma'>.</span></li> |
<li class=MsoNormal style='mso-list:l0 level2 lfo1;tab-stops:list 1.0in'><span | <li class=MsoNormal style='mso-list:l0 level2 lfo1;tab-stops:list 1.0in'><span | ||
style='font-size:10.0pt;font-family:Tahoma'>Disable any unwanted service | style='font-size:10.0pt;font-family:Tahoma'>Disable any unwanted service | ||
Line 360: | Line 360: | ||
10.0pt;font-family:"Courier New"'> --levels 2345 <service> off</span><span | 10.0pt;font-family:"Courier New"'> --levels 2345 <service> off</span><span | ||
style='font-size:10.0pt;font-family:Tahoma'> where <b style='mso-bidi-font-weight: | style='font-size:10.0pt;font-family:Tahoma'> where <b style='mso-bidi-font-weight: | ||
− | normal'><service></b> represents the service to disable. | + | normal'><service></b> represents the service to disable.</span></li> |
</ol> | </ol> | ||
</ol> | </ol> | ||
Line 369: | Line 369: | ||
<span class=SpellE><b style='mso-bidi-font-weight:normal'>apmd</b></span>, <b | <span class=SpellE><b style='mso-bidi-font-weight:normal'>apmd</b></span>, <b | ||
style='mso-bidi-font-weight:normal'>kudzu</b>, and <span class=SpellE><b | style='mso-bidi-font-weight:normal'>kudzu</b>, and <span class=SpellE><b | ||
− | style='mso-bidi-font-weight:normal'>microcode_ctl</b></span>. | + | style='mso-bidi-font-weight:normal'>microcode_ctl</b></span>.</span></p> |
<ol style='margin-top:0in' start=22 type=1> | <ol style='margin-top:0in' start=22 type=1> | ||
Line 375: | Line 375: | ||
style='font-size:10.0pt;font-family:Tahoma'>Exit the VPS by typing </span><span | style='font-size:10.0pt;font-family:Tahoma'>Exit the VPS by typing </span><span | ||
style='font-size:10.0pt;font-family:"Courier New"'>exit</span><span | style='font-size:10.0pt;font-family:"Courier New"'>exit</span><span | ||
− | style='font-size:10.0pt;font-family:Tahoma'> at the prompt. | + | style='font-size:10.0pt;font-family:Tahoma'> at the prompt.</span></li> |
<li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list .5in'><span | <li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list .5in'><span | ||
style='font-size:10.0pt;font-family:Tahoma'>Stop the VPS by typing <span | style='font-size:10.0pt;font-family:Tahoma'>Stop the VPS by typing <span | ||
− | class=SpellE>vzctl</span> stop 50. | + | class=SpellE>vzctl</span> stop 50.</span></li> |
<li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list .5in'><span | <li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list .5in'><span | ||
style='font-size:10.0pt;font-family:Tahoma'>Finally, package up the new | style='font-size:10.0pt;font-family:Tahoma'>Finally, package up the new | ||
Line 385: | Line 385: | ||
/vz/template/cache/centos-5.0-<ARCH>-<DISTRO>.<span | /vz/template/cache/centos-5.0-<ARCH>-<DISTRO>.<span | ||
class=SpellE>tar.gz</span> .</span><span style='font-size:10.0pt; | class=SpellE>tar.gz</span> .</span><span style='font-size:10.0pt; | ||
− | font-family:Tahoma' | + | font-family:Tahoma'></span></li> |
<li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list .5in'><span | <li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list .5in'><span | ||
− | style='font-size:10.0pt;font-family:Tahoma'>The template is ready for use. | + | style='font-size:10.0pt;font-family:Tahoma'>The template is ready for use.</span></li> |
</ol> | </ol> | ||
− | <p class=MsoNormal><span style='font-size:10.0pt;font-family:Tahoma' | + | <p class=MsoNormal><span style='font-size:10.0pt;font-family:Tahoma'> </span></p> |
<p class=MsoNormal style='margin-left:.75in;text-indent:-.25in'><span | <p class=MsoNormal style='margin-left:.75in;text-indent:-.25in'><span | ||
− | style='font-size:10.0pt;font-family:Tahoma' | + | style='font-size:10.0pt;font-family:Tahoma'> </span></p> |
</div> | </div> | ||
− | |||
− | |||
− | |||
− |
Revision as of 19:48, 2 November 2007
Creating a CentOS 5.0 Template for OpenVZ
- Install a system (virtual or physical) with the default CentOS installation that you wish to package. This could be a minimal distro or the default distro or even something custom.
- Once the OS has been installed, you need to tar the contents of the OS.
- First, create a file called /tmp/exclude and add the following lines to it:
.bash_history
lost+found
/dev/*
/mnt/*
/tmp/*
/proc/*
/sys/*
/usr/src/*
- Now, tar the OS file up by typing:
tar –czvf /tmp/centos-5.0-<ARCH>-<DISTRO>-image.tar.gz / –X /tmp/exclude
where <ARCH> represents the system architecture (i386 or x86_64) and <DISTRO> represents the distribution (default, minimal, etc.).
- Now transfer the file over to the OpenVZ server into /vz/template/cache folder.
- On the OpenVZ server create a “dummy” VPS by creating a folder called /vz/private/50 and copying the /etc/vz/conf/ve-vps.basic.conf-sample to /etc/vz/conf/50.conf.
NOTE:
50 is the VEID for the VPS. You can choose any unused VEID on the OpenVZ server.
- Now create a new folder called /vz/template/centos/5.0/<ARCH>/config again where <ARCH> represents the system architecture.
- Create a file in the folder called rpm and add the following line:
43
- Create a file called yum.conf in the folder and add the following lines:
[main]
cachedir=/vz/template/centos/5.0/<ARCH>/yum-cache/
reposdir=/dev/null
installonlypkgs=
[centos5-base]
name=CentOS 5 - <ARCH> - Base
baseurl=http://mirror.centos.org/centos/5/os/<ARCH>/
enabled=1
gpgcheck=1
[centos5-updates-released]
name=CentOS 5 - <ARCH> - Released Updates
baseurl=http://mirror.centos.org/centos/5/updates/<ARCH>/
enabled=1
gpgcheck=1
- Copy /etc/vz/dists/centos-4.conf to /etc/vz/dists/centos-5.0.conf.
- Change to the /vz/private/50 folder and then run the command gunzip –dc /vz/template/cache/centos-5.0-<ARCH>-<DISTRO>-image.tar.gz | tar –xvf – to unpack the base image to the folder.
- Make sure you are in the /vz/private/50 folder.
- Edit etc/shadow and remove the replace the root password with !! instead of the hashed value.
- Edit the etc/inittab file and comment out the lines that respawn /sbin/mingetty on tty1 through tty6. Just put a # at the beginning of the line.
- Remove the etc/mtab file and then create a symbolic link by typing ln –s /proc/mounts etc/mtab.
- Remove all of the lines from etc/fstab except for the line that mounts /dev/pts.
- Edit etc/rc.d/rc.sysinit and comment out the line that starts /sbin/start_udev by placing a # at the beginning of the line.
- Now create device nodes by typing:
mknod dev/ptmx c 5 2
mkdir dev/pts
/sbin/MAKEDEV –d /vz/private/50/dev ttyp ptyp
mknod dev/null c 1 3
mknod dev/urandom c 1 9
- Create the var/lock/rpm folder.
- If you wish to disable IPv6, do the following:
- Edit etc/sysconfig/network and set NETWORKING_IPV6 to no.
- Add the following lines to etc/modprobe.d/blacklist:
blacklist ipv6
blacklist net-pf-10
- Disable any physical NICs by modifying the etc/sysconfig/network-scripts/ifcfg-ethX files (where X is the interface number starting from 0) and setting ONBOOT to no.
- Now you’re ready to start the template. Type vzctl start 50 and wait for it to start.
- You can install additional packages into the VPS by typing vzyum 50 install <package> at the prompt where <package> represents the name of the software package you wish to install.
- Finally, you should turn off unnecessary services.
- Enter the VPS by typing vzctl enter 50.
- View the services that are set to run at startup by typing chkconfig --list | grep 5:on.
- Disable any unwanted service by typing chkconfig --levels 2345 <service> off where <service> represents the service to disable.
Services that you can (and should) turn off without harm are acpid, apmd, kudzu, and microcode_ctl.
- Exit the VPS by typing exit at the prompt.
- Stop the VPS by typing vzctl stop 50.
- Finally, package up the new template by typing tar –czvf /vz/template/cache/centos-5.0-<ARCH>-<DISTRO>.tar.gz .
- The template is ready for use.