Editing Creating a template cache : Slackware or HostGIS Linux

Jump to: navigation, search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 1: Line 1:
This process uses VMware to install the OS into a VM, then to trim down the VM's contents to only those items suitable for a [[VE]] environment, then to save a snapshot of the system as a host template cache for use in OpenVZ.
+
== Creating a new Host Template Cache for HostGIS Linux 4.x or Slackware 11.x/12.x ==
 +
 
 +
This process uses 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.
 
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 ==
+
=== Create the VM in VMWare ===
  
Technically, you could probably do this on a hardware PC without VMware, but VMware does make it more convenient.
+
Technically, you could probably do this on a hardware PC without VMWare, but VMWare does make it more convenient.
  
Start by creating a new VM in VMware.
+
Start by creating a new VM in VMWare.
 
* The disk and RAM stats can be minimal, as the system will never see live use.
 
* 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.
 
* There is no need to create the entire disk at once during the setup.
Line 18: Line 20:
 
* Do set the timezone properly. The internal clock does not use UTC/GMT.
 
* Do set the timezone properly. The internal clock does not use UTC/GMT.
 
* Select the default mouse, but do NOT enable GPM at startup.
 
* Select the default mouse, but do NOT enable GPM at startup.
* Hostname: template
+
* Hostname: template   Domain: internal.lan
* Domain: internal.lan
+
* IP config: as appropriate for your LAN
* IP config: as appropriate for your LAN
 
 
* Nameserver: no
 
* Nameserver: no
  
 
Reboot into your new HGL install, and log in.
 
Reboot into your new HGL install, and log in.
 +
  
 
== Delete unnecessary stuff ==
 
== Delete unnecessary stuff ==
  
A lot of packages aren't relevant to a setting, e.g. floppy disk utilities and kernel modules, even getty listening on the console.
+
A lot of packages aren't relevant to a VPS setting, e.g. floppy disk utilities and kernel modules, even getty listening on the console.
  
 
<code>
 
<code>
Line 34: Line 36:
 
   rm -rf /lib/modules /boot /dev/.udev /usr/doc /usr/info /media
 
   rm -rf /lib/modules /boot /dev/.udev /usr/doc /usr/info /media
  
   # packages not applicable to a VE
+
   # packages not applicable to a VPS setting
 
   cd /var/log/packages
 
   cd /var/log/packages
 
   for pkg in \
 
   for pkg in \
Line 87: Line 89:
 
== Changes to rc scripts ==
 
== Changes to rc scripts ==
  
OpenVZ emulates rebooting with an external cronjob called vpsreboot and a dummy file called /reboot within the VE, and emulates the /etc/mtab file by pointing it to /proc/mounts So, some small changes are necessary to the rc scripts.
+
OpenVZ emulates rebooting with an external cronjob called vpsreboot and a dummy file called /reboot within the VPS, and emulates the /etc/mtab file by pointing it to /proc/mounts So, some small changes are necessary to the rc scripts.
  
 
<code>
 
<code>
Line 163: Line 165:
 
== Zipping it up into a cache image ==
 
== Zipping it up into a cache image ==
  
A 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:
+
A VE 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:
  
  tar --numeric-owner -zcvf /tmp/HostGIS_Linux_4.2_64bit.tar.gz --exclude='/sys/*' --exclude='/proc/*' --exclude='/tmp/*' /
+
<code>
  
[[Category: Templates]]
+
tar zcvf /tmp/HostGIS_Linux_4.2_64bit.tar.gz --exclude='/sys/*' --exclude='/proc/*' --exclude='/tmp/*' /
 +
 
 +
</code>

Please note that all contributions to OpenVZ Virtuozzo Containers Wiki may be edited, altered, or removed by other contributors. If you don't want your writing to be edited mercilessly, then don't submit it here.
If you are going to add external links to an article, read the External links policy first!

To edit this page, please answer the question that appears below (more info):

Cancel Editing help (opens in new window)