Open main menu

OpenVZ Virtuozzo Containers Wiki β

Changes

Creating a template cache : Slackware or HostGIS Linux

77 bytes removed, 10:55, 19 October 2009
ā†’ā€ŽZipping it up into a cache image: use --numeric-owner option for tar
== Creating a new Host Template Cache for HostGIS Linux 4.x or Slackware 11.x/12.x == This process uses VMWare VMware to install the OS into a VM, then to trim down the VM's contents to only those items suitable for a VPS/[[VE ]] environment, then to save a snapshot of the system as a host template cache for use in OpenVZ.
This document focuses on HostGIS Linux (a Slackware derivative) but aside from the specifics about installation settings, it should be 99% applicable to Slackware as well.
=== Create the VM in VMWare =VMware ==
Technically, you could probably do this on a hardware PC without VMWareVMware, but VMWare VMware does make it more convenient.
Start by creating a new VM in VMWareVMware.
* The disk and RAM stats can be minimal, as the system will never see live use.
* There is no need to create the entire disk at once during the setup.
* Do set the timezone properly. The internal clock does not use UTC/GMT.
* Select the default mouse, but do NOT enable GPM at startup.
* Hostname: template * Domain: internal.lan* IP config: as appropriate for your LAN
* Nameserver: no
Reboot into your new HGL install, and log in.
 
== Delete unnecessary stuff ==
A lot of packages aren't relevant to a VPS VŠ• setting, e.g. floppy disk utilities and kernel modules, even getty listening on the console.
<code>
rm -rf /lib/modules /boot /dev/.udev /usr/doc /usr/info /media
# packages not applicable to a VPS settingVE
cd /var/log/packages
for pkg in \
== Changes to rc scripts ==
OpenVZ emulates rebooting with an external cronjob called vpsreboot and a dummy file called /reboot within the VPSVE, and emulates the /etc/mtab file by pointing it to /proc/mounts So, some small changes are necessary to the rc scripts.
<code>
== Zipping it up into a cache image ==
A VE CT cache is just a tar.gz file of the entire filesystem, excluding some very dynamic stuff which gets populated by the OS at runtime anyway:
<code> tar --numeric-owner -zcvf /tmp/HostGIS_Linux_4.2_64bit.tar.gz --exclude='/sys/*' --exclude='/proc/*' --exclude='/tmp/*' /
tar zcvf /tmp/HostGIS_Linux_4.2_64bit.tar.gz --exclude='/sys/*' --exclude='/proc/*' --exclude='/tmp/*' / </code>[[Category: Templates]]