Changes

Jump to: navigation, search

Install vzpkg2 and pkg-cacher

1,619 bytes added, 13:16, 19 March 2009
This packege did'nt install by you for dependenses, and, Debian/Ubuntu template cahe did'nt created
=== Introduction ===
 
2008/11/19: This is still unfinished, a work in progress, give me a couple days or email me through wiki if you have questions or concerns -BurnMage
Robert Nelson has created a couple new utilities to make managing and updating templates and containers easier, vzpkg2 pkg-cacher. So far they will create and update a large range of containers, including both 32bit and 64bit of the following:
Pkg-cacher is a transparent caching proxy daemon optimized for Debian and RPM packages. In other terms, pkg-cacher is a service that runs on a machine that other machines and containers, or "clients", use to update themselves instead of each of them directly hitting the package repositories. Pkg-cacher only downloads a file once and then gives that to all its clients, instead of each of the clients downloading the file from the Internet at large. It is based on [http://www.nick-andrew.net/projects/apt-cacher/ apt-cacher], available with Debian. This version has been modified to understand RedHat RPM repositories. It also adds support for the HTTP Range header and deals correctly with files which have the same name but different content on different distributions or in some cases different versions of the same distribution.
Robert has setup repositories for Fedora, Centos CentOS and Debian.
The source for the new ====Screencast==== Scott Dowdle has recorded a good screencast overview of vzpkg2 and templates is available on http://git.opensourcepkg-sw.net. In order to clone the updated source use the command: git clone httpcacher at://git.opensource-sw.net/git/vzpkg
The templates are available using: git clone http://gitwww.opensourcemontanalinux.org/vzpkg2-swscreencast.net/git/vztmplhtml
===Installation===
 
====Remove Old Packages & Templates====
 
* Backup your existing /vz/template directory and clear it out.
* Uninstall vzpkg and any vztmpl-* packages.
yum install vzpkg2 vztmpl2-centos vztmpl2-fedora vztmpl2-debian vztmpl2-ubuntu
yum install pkg-cacher-sadebootstrap
=====<u>Configure vzpkg2</u>=====
=====<u>Configure pkg-cacher</u>=====
Edit /etc/pkg-cacher/pkg-cacher.conf. You should read the included documentation in the file to ensure it is appropriate for your setup. Mostly the defaults will work just fine. By default pkg-cacher will let any system use its cache. You will probably want to limit it to your own systems on the line:
 
allowed_hosts=*
 
Once you have checked and updated pkg-cacher.conf, simply restart it by running as root:
 
service pkg-cacher restart
 
=====<u>Generate the new template cache</u>=====
 
Now everything should be ready to go! Make sure both the 'vz' service and 'pkg-cacher' service are running.
 
To build an individual OS Template just run the 'vzpkgcache' command and pass it the name of the OS Template you want to build. For a list of OS Templates you can build, run the 'vzpkgls' command. Example:
 
vzpkgcache centos-5-i386-default
 
If you'd like to build all OS Templates available, just run the 'vzpkgcache' command without any parameters. Example:
 
vzpkgcache
 
vzpkg2 should get to work generating your initial caches. Now you can run 'vzctl create' and use them.
====Debian Installs:====
=====<u>Adding New Templates:</u>=====
At the time of writing Install the desired OS templates were only available in RPM format. To be able to install them, install yum:  apt-get install yum Then fetch the templates and install them:  wget http://repo.opensource-sw.net/centos/5/i386/vztmpl2-centos-0.9.0-1.noarch.rpm wget http://repo.opensource-sw.net/centos/5/i386/vztmpl2-fedora-0.9.0-1.noarch.rpm wget http://repo.opensource-sw.net/centos/5/i386/vztmpl2-debian-0.9.0-1.noarch.rpm rpm -i --nodeps vztmpl2-*.rpm Then move the templates to where Debian expects them:  mv /vz/template/* /var/lib/vz/template/ Edit the /var/lib/vz/template/{centos,fedora,debian}/config/vzpkg.conf files as well to reference where Debian expects them. Change the line: baseurl=file:///vz/template/$OS_NAME/$OS_VER/$OS_ARCH/vz-addons/to: baseurl=fileTemplate Metadata packages:///var/lib/vz/template/$OS_NAME/$OS_VER/$OS_ARCH/vz-addons/
apt-get install vztmpl2-centos vztmpl2-fedora vztmpl2-ubuntu vztmpl2-debian
=====<u>Configure vzpkg2</u>=====
=====<u>Configure pkg-cacher</u>=====
 
Edit /etc/pkg-cacher/pkg-cacher.conf. You should read the included documentation in the file to ensure it is appropriate for your setup. Mostly the defaults will work just fine. By default pkg-cacher will let any system use its cache. You will probably want to limit it to your own systems on the line:
 
allowed_hosts=*
 
Once you have checked and updated pkg-cacher.conf, simply restart it.
 
=====<u>Generate the new template cache</u>=====
 
Now everything should be ready to go! Make sure both the 'vz' service and 'pkg-cacher' service are running
 
To get a list of what OS Templates you may now use, type the following:
 
vzpkgls
 
That will produce a list of available OS Templates. Use any name given in the list as a parameter to vzpkgcache to build that OS Template. Example:
 
vzpkgcache centos-5-i386-default
 
If you want to build all OS Templates you can simply run vzpkgcache without any paramters:
 
vzpkgcache
 
vzpkg2 should get to work generating your initial caches. Now you can run 'vzctl create' and use them.
 
===Source===
 
The source for the new vzpkg2 and templates is available on http://git.opensource-sw.net. In order to clone the updated source use the command:
git clone http://git.opensource-sw.net/git/vzpkg
 
The templates are available using:
git clone http://git.opensource-sw.net/git/vztmpl
6
edits

Navigation menu