<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.openvz.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Boernie</id>
	<title>OpenVZ Virtuozzo Containers Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.openvz.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Boernie"/>
	<link rel="alternate" type="text/html" href="https://wiki.openvz.org/Special:Contributions/Boernie"/>
	<updated>2026-06-10T00:59:38Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.1</generator>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Debian_template_creation&amp;diff=16490</id>
		<title>Debian template creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Debian_template_creation&amp;diff=16490"/>
		<updated>2015-05-19T05:45:05Z</updated>

		<summary type="html">&lt;p&gt;Boernie: /* Preparing for and packing template cache */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These are rough instructions of how to manually create basic Debian template cache, which can be used to create OpenVZ [[VE]]s based on Debian.&lt;br /&gt;
&lt;br /&gt;
{{Warning|The recommended way is '''not to follow''' the below instructions, but to use the official Debian templates, modifying those to your needs.}}&lt;br /&gt;
&lt;br /&gt;
'''Notes:'''&lt;br /&gt;
* You shouldn't be running as root, but as a user that is permitted to use sudo instead.  It's a dangerous idea, run as root at your peril.&lt;br /&gt;
* Anywhere you see &amp;lt;tt&amp;gt;/vz&amp;lt;/tt&amp;gt;, you might really need to use &amp;lt;tt&amp;gt;/var/lib/vz&amp;lt;/tt&amp;gt; instead, especially on a Debian Etch host.&lt;br /&gt;
* Anywhere you see &amp;lt;tt&amp;gt;http://http.us.debian.org/debian/&amp;lt;/tt&amp;gt;, you can substitute your favorite Debian mirror.  ([http://www.debian.org/mirror/list List of official Debian Mirrors])&lt;br /&gt;
* See also: &amp;lt;tt&amp;gt;/usr/share/doc/vzctl/README.Debian&amp;lt;/tt&amp;gt; in the ''vzctl'' Debian package&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
You need to have a working copy of &amp;lt;tt&amp;gt;debootstrap&amp;lt;/tt&amp;gt; running on your hardware node.&lt;br /&gt;
&lt;br /&gt;
For Debian:&lt;br /&gt;
 sudo apt-get install debootstrap&lt;br /&gt;
&lt;br /&gt;
For Gentoo:&lt;br /&gt;
 sudo emerge debootstrap&lt;br /&gt;
&lt;br /&gt;
For Fedora (at least Fedora 8 have it, not sure about earlier versions):&lt;br /&gt;
 sudo yum install debootstrap&lt;br /&gt;
&lt;br /&gt;
For other distros you might need to install it from sources, or search for an appropriate package for your distribution.  An RPM is available on the [http://forum.openvz.org/index.php?t=tree&amp;amp;th=142&amp;amp;mid=584 OpenVZ Forum].&lt;br /&gt;
&lt;br /&gt;
== Bootstrapping Debian ==&lt;br /&gt;
&lt;br /&gt;
You can install different releases of Debian into a VE's private directory using the debootstrap command.&lt;br /&gt;
&lt;br /&gt;
The command parameters are:&lt;br /&gt;
&lt;br /&gt;
  debootstrap --arch ARCH NAME DIRECTORY URL&lt;br /&gt;
&lt;br /&gt;
Specify your architecture instead of &amp;lt;tt&amp;gt;i386&amp;lt;/tt&amp;gt; if you're using something other than i386/x86.  For example, for AMD64/x86_64, use &amp;lt;tt&amp;gt;amd64&amp;lt;/tt&amp;gt; or for ia64, use &amp;lt;tt&amp;gt;ia64&amp;lt;/tt&amp;gt;. You can use http or ftp in the URL.&lt;br /&gt;
&lt;br /&gt;
We use VE ID of 777 for this example, but it can be any unused ID.&lt;br /&gt;
&lt;br /&gt;
=== Wheezy (current stable) ===&lt;br /&gt;
&lt;br /&gt;
 debootstrap --arch i386 wheezy /vz/private/777 http://http.us.debian.org/debian/&lt;br /&gt;
 or&lt;br /&gt;
 debootstrap --arch amd64 wheezy /vz/private/777 http://ftp.us.debian.org/debian/&lt;br /&gt;
&lt;br /&gt;
=== Squeeze (current oldstable) ===&lt;br /&gt;
&lt;br /&gt;
 debootstrap --arch i386 squeeze /vz/private/777 http://http.us.debian.org/debian/&lt;br /&gt;
 or&lt;br /&gt;
 debootstrap --arch amd64 squeeze /vz/private/777 ftp://ftp.us.debian.org/debian/&lt;br /&gt;
&lt;br /&gt;
=== Lenny (old release) ===&lt;br /&gt;
&lt;br /&gt;
 debootstrap --arch i386 lenny /vz/private/777 http://archive.debian.org/debian/&lt;br /&gt;
&lt;br /&gt;
=== Etch (old release) ===&lt;br /&gt;
&lt;br /&gt;
 debootstrap --arch i386 etch /vz/private/777 http://http.us.debian.org/debian/&lt;br /&gt;
&lt;br /&gt;
=== Sarge (very old release) ===&lt;br /&gt;
&lt;br /&gt;
 debootstrap sarge /vz/private/777 http://archive.debian.org/debian&lt;br /&gt;
&lt;br /&gt;
== Preparing the HN network ==&lt;br /&gt;
Append the following lines to /etc/sysctl.conf, adjust to taste and then execute &amp;quot;sysctl -p&amp;quot; for them to take effect.&lt;br /&gt;
 ### OpenVZ settings&lt;br /&gt;
 &lt;br /&gt;
 # On Hardware Node enable packet forwarding to forward&lt;br /&gt;
 # packets between the HN network interfaces and venet.&lt;br /&gt;
 # Proxy arp is needed when CT is in a different subnet&lt;br /&gt;
 # or when using veth AND veth is not bridged to a HN&lt;br /&gt;
 # interface. When veth is bridged to a HN interface,&lt;br /&gt;
 # the CT handles its own arps.&lt;br /&gt;
 &lt;br /&gt;
 net.ipv4.conf.default.forwarding=1&lt;br /&gt;
 net.ipv4.conf.default.proxy_arp = 0&lt;br /&gt;
 net.ipv4.ip_forward=1&lt;br /&gt;
 &lt;br /&gt;
 # Enables source route verification&lt;br /&gt;
 net.ipv4.conf.all.rp_filter = 1&lt;br /&gt;
 &lt;br /&gt;
 # Enables the magic-sysrq key&lt;br /&gt;
 kernel.sysrq = 1&lt;br /&gt;
 &lt;br /&gt;
 # TCP Explict Congestion Notification&lt;br /&gt;
 net.ipv4.tcp_ecn = 0&lt;br /&gt;
 &lt;br /&gt;
 # we do not want all our interfaces to send redirects&lt;br /&gt;
 net.ipv4.conf.default.send_redirects = 1&lt;br /&gt;
 net.ipv4.conf.all.send_redirects = 0&lt;br /&gt;
&lt;br /&gt;
== Preparing and starting the VE ==&lt;br /&gt;
&lt;br /&gt;
=== Setting VE config ===&lt;br /&gt;
First, we need a config for the [[VE]]:&lt;br /&gt;
 sudo vzctl set 777 --applyconfig vps.basic --save&lt;br /&gt;
&lt;br /&gt;
On debian squeeze only the following worked for me (''confirmed''), because the standard template names in /etc/vz/conf have changed.&lt;br /&gt;
 sudo vzctl set 777 --applyconfig basic --save&lt;br /&gt;
&lt;br /&gt;
=== Setting VE OSTEMPLATE ===&lt;br /&gt;
Also, we need &amp;lt;tt&amp;gt;OSTEMPLATE&amp;lt;/tt&amp;gt; to be set in VE configuration file, for [[vzctl]] to work properly.&lt;br /&gt;
&lt;br /&gt;
 sudo sh -c 'echo OSTEMPLATE=\&amp;quot;debian-6.0\&amp;quot;' &amp;gt;&amp;gt; /etc/vz/conf/777.conf&lt;br /&gt;
&lt;br /&gt;
=== Setting VE IP address ===&lt;br /&gt;
For the [[VE]] to be able to download updates from the Internet, we need a valid IP address for it:&lt;br /&gt;
 sudo vzctl set 777 --ipadd x.x.x.x --save&lt;br /&gt;
&lt;br /&gt;
{{Note|if you use private IP for the VE, you might have to set up NAT as described in [[Using NAT for VE with private IPs]].}}&lt;br /&gt;
&lt;br /&gt;
=== Setting DNS server for VE ===&lt;br /&gt;
For the [[VE]] to be able to download updates from the Internet, we also need to specify a DNS for it:&lt;br /&gt;
 sudo vzctl set 777 --nameserver x.x.x.x --save&lt;br /&gt;
&lt;br /&gt;
=== Creating /dev/ptmx  ===&lt;br /&gt;
The ptmx character device should normally exist, but if it doesn't, create one.&lt;br /&gt;
 sudo mknod --mode 666 /var/lib/vz/private/777/dev/ptmx c 5 2&lt;br /&gt;
&lt;br /&gt;
=== Starting VE ===&lt;br /&gt;
Now start the VE:&lt;br /&gt;
 sudo vzctl start 777&lt;br /&gt;
&lt;br /&gt;
== Customizing the installation ==&lt;br /&gt;
A few things need to be done inside a newly created VE for it to become suitable for OpenVZ. Enter the VE to begin the configuration (note: if running a wheezy container on a squeeze hardware node, you'll need to manually install a newer version of vzctl (the one from wheezy will be fine - http://packages.debian.org/wheezy/vzctl) due to this bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=683454 - without making this change, the enter command will hang). Exporting the path is optional.&lt;br /&gt;
 sudo vzctl enter 777&lt;br /&gt;
 export PATH=/sbin:/usr/sbin:/bin:/usr/bin&lt;br /&gt;
&lt;br /&gt;
{{Warning|Do not run the commands below on the hardware node, they are only to be run within the VE!}}&lt;br /&gt;
&lt;br /&gt;
=== Set Debian repositories ===&lt;br /&gt;
The list shown is for wheezy, and downloading from US located servers - adjust your release name and mirror location as necessary&lt;br /&gt;
 cat &amp;lt;&amp;lt;EOF &amp;gt; /etc/apt/sources.list&lt;br /&gt;
 deb http://http.us.debian.org/debian wheezy main contrib&lt;br /&gt;
 deb http://security.debian.org wheezy/updates main contrib&lt;br /&gt;
 deb http://http.us.debian.org/debian wheezy-updates main&lt;br /&gt;
 ## backports - ONLY IF YOU KNOW WHAT YOU DO&lt;br /&gt;
 # deb http://http.us.debian.org/debian-backports/ wheezy-backports main&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
=== Get new security updates ===&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get upgrade&lt;br /&gt;
&lt;br /&gt;
=== Install some more packages ===&lt;br /&gt;
Installing packages could be an interactive process so the system might ask some questions.  You can install more packages if you'd like.  For example:&lt;br /&gt;
 apt-get install ssh quota less&lt;br /&gt;
&lt;br /&gt;
=== Set sane permissions for &amp;lt;tt&amp;gt;/root&amp;lt;/tt&amp;gt; directory ===&lt;br /&gt;
 chmod 700 /root&lt;br /&gt;
&lt;br /&gt;
=== Disable root login ===&lt;br /&gt;
This will disable root login by default.&lt;br /&gt;
 usermod -L root&lt;br /&gt;
&lt;br /&gt;
=== Disable getty ===&lt;br /&gt;
Disable running &amp;lt;tt&amp;gt;getty&amp;lt;/tt&amp;gt;s on terminals as a VE does not have any:&lt;br /&gt;
 sed -i -e '/getty/d' /etc/inittab&lt;br /&gt;
&lt;br /&gt;
=== Disable &amp;lt;tt&amp;gt;sync()&amp;lt;/tt&amp;gt; for syslog ===&lt;br /&gt;
Turn off doing &amp;lt;tt&amp;gt;sync()&amp;lt;/tt&amp;gt; on every write for &amp;lt;tt&amp;gt;syslog&amp;lt;/tt&amp;gt;'s log files, to improve I/O performance:&lt;br /&gt;
 &amp;lt;pre&amp;gt;sed -i -e 's@\([[:space:]]\)\(/var/log/\)@\1-\2@' /etc/*syslog.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Fix &amp;lt;tt&amp;gt;/etc/mtab&amp;lt;/tt&amp;gt; ===&lt;br /&gt;
Link &amp;lt;tt&amp;gt;/etc/mtab&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;/proc/mounts&amp;lt;/tt&amp;gt;, so &amp;lt;tt&amp;gt;df&amp;lt;/tt&amp;gt; and friends will work:&lt;br /&gt;
 rm -f /etc/mtab&lt;br /&gt;
 ln -s /proc/mounts /etc/mtab&lt;br /&gt;
&lt;br /&gt;
=== Remove some unneeded packages ===&lt;br /&gt;
If you have any packages you'd like to remove, now's the time for it.  Here's an example — note that not all of those packages are installed by default in Debian Squeeze (although they were in earlier versions):&lt;br /&gt;
&lt;br /&gt;
 dpkg --purge modutils ppp pppoeconf pppoe pppconfig module-init-tools&lt;br /&gt;
&lt;br /&gt;
=== Disable services ===&lt;br /&gt;
&lt;br /&gt;
Do not start some services, stick to bare minimum. This step is release dependent.&lt;br /&gt;
&lt;br /&gt;
==== for Jessie ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# turn off and stop some services&lt;br /&gt;
for i in bind9 quotarpc fetchmail ondemand rsync uuidd wide-dhcpv6-client; do&lt;br /&gt;
        systemctl stop $i&lt;br /&gt;
        systemctl disable $i&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
# for upstart services comment out the start on in confs&lt;br /&gt;
for i in nmbd smbd samba-ad-dc rpcbind; do&lt;br /&gt;
        systemctl disable $i&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== for Squeeze ====&lt;br /&gt;
&lt;br /&gt;
 update-rc.d-insserv -f klogd remove&lt;br /&gt;
 update-rc.d-insserv -f quotarpc remove&lt;br /&gt;
 update-rc.d-insserv -f exim4 remove&lt;br /&gt;
 update-rc.d-insserv -f inetd remove&lt;br /&gt;
&lt;br /&gt;
==== for older releases (Lenny, Sarge etc.) ====&lt;br /&gt;
&lt;br /&gt;
 update-rc.d -f klogd remove&lt;br /&gt;
 update-rc.d -f quotarpc remove&lt;br /&gt;
 update-rc.d -f exim4 remove&lt;br /&gt;
 update-rc.d -f inetd remove&lt;br /&gt;
&lt;br /&gt;
=== Fix SSH host keys ===&lt;br /&gt;
This is only useful if you installed SSH.  Each individual [[VE]] should have its own pair of SSH host keys.  The code below will wipe out the existing SSH keys and instruct the newly-created [[VE]] to create new SSH keys on first boot.&lt;br /&gt;
&lt;br /&gt;
==== for Jessie ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Save /etc/rc.local copy&lt;br /&gt;
mv /etc/rc.local /etc/rc.local.orig&lt;br /&gt;
&lt;br /&gt;
# ssh host keys hack&lt;br /&gt;
echo &amp;quot;#!/bin/sh&lt;br /&gt;
rm -f etc/ssh/ssh_host_*&lt;br /&gt;
/usr/bin/ssh-keygen -t rsa -N '' -f /etc/ssh/ssh_host_rsa_key&lt;br /&gt;
/usr/bin/ssh-keygen -t dsa -N '' -f /etc/ssh/ssh_host_dsa_key&lt;br /&gt;
/usr/bin/ssh-keygen -t rsa1 -N '' -f /etc/ssh/ssh_host_key&lt;br /&gt;
/usr/bin/ssh-keygen -t ecdsa -N '' -f /etc/ssh/ssh_host_ecdsa_key&lt;br /&gt;
/usr/bin/ssh-keygen -t ed25519 -N '' -f /etc/ssh/ssh_host_ed25519_key&lt;br /&gt;
systemctl restart ssh&lt;br /&gt;
mv -f /etc/rc.local.orig /etc/rc.local&lt;br /&gt;
&amp;quot; &amp;gt; /etc/rc.local&lt;br /&gt;
&lt;br /&gt;
chmod a+x /etc/rc.local&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
==== for Squeeze ====&lt;br /&gt;
&lt;br /&gt;
 rm -f /etc/ssh/ssh_host_*&lt;br /&gt;
&amp;lt;!-- please do not remove &amp;lt;source&amp;gt;...&amp;lt;/source&amp;gt; pair of tags below,&lt;br /&gt;
     otherwise quotes after -N (-N '') are not visible --&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat &amp;lt;&amp;lt; EOF &amp;gt; /etc/init.d/ssh_gen_host_keys&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
### BEGIN INIT INFO&lt;br /&gt;
# Provides:          Generates new ssh host keys on first boot&lt;br /&gt;
# Required-Start:    $remote_fs $syslog&lt;br /&gt;
# Required-Stop:     $remote_fs $syslog&lt;br /&gt;
# Default-Start:     2 3 4 5&lt;br /&gt;
# Default-Stop:&lt;br /&gt;
# Short-Description: Generates new ssh host keys on first boot&lt;br /&gt;
# Description:       Generates new ssh host keys on first boot&lt;br /&gt;
### END INIT INFO&lt;br /&gt;
ssh-keygen -f /etc/ssh/ssh_host_rsa_key -t rsa -N &amp;quot;&amp;quot;&lt;br /&gt;
ssh-keygen -f /etc/ssh/ssh_host_dsa_key -t dsa -N &amp;quot;&amp;quot;&lt;br /&gt;
insserv -r /etc/init.d/ssh_gen_host_keys&lt;br /&gt;
rm -f \$0&lt;br /&gt;
EOF&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
 chmod a+x /etc/init.d/ssh_gen_host_keys&lt;br /&gt;
 insserv /etc/init.d/ssh_gen_host_keys&lt;br /&gt;
&lt;br /&gt;
==== for older releases (Lenny, Sarge etc.) ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- please do not remove &amp;lt;source&amp;gt;...&amp;lt;/source&amp;gt; pair of tags below,&lt;br /&gt;
     otherwise quotes after -N (-N '') are not visible --&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rm -f /etc/ssh/ssh_host_*&lt;br /&gt;
cat &amp;lt;&amp;lt; EOF &amp;gt; /etc/rc2.d/S15ssh_gen_host_keys&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
ssh-keygen -f /etc/ssh/ssh_host_rsa_key -t rsa -N ''&lt;br /&gt;
ssh-keygen -f /etc/ssh/ssh_host_dsa_key -t dsa -N ''&lt;br /&gt;
rm -f \$0&lt;br /&gt;
EOF&lt;br /&gt;
chmod a+x /etc/rc2.d/S15ssh_gen_host_keys&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Change timezone ===&lt;br /&gt;
&lt;br /&gt;
You might want to change timezone if you do not live in $UTC. The following example is for Germany&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
or even better&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dpkg-reconfigure tzdata&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Create vzfifo script (for Jessie only) ===&lt;br /&gt;
&lt;br /&gt;
This step is required '''for Jessie only''' (and is handled automatically by vzctl for earlier Debian releases). It ensures that &amp;lt;code&amp;gt;vzctl start --wait&amp;lt;/code&amp;gt; works as expected.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Create vzfifo service&lt;br /&gt;
cat &amp;gt;&amp;gt; /lib/systemd/system/vzfifo.service &amp;lt;&amp;lt; EOF&lt;br /&gt;
#  This file is part of systemd.&lt;br /&gt;
#&lt;br /&gt;
#  systemd is free software; you can redistribute it and/or modify it&lt;br /&gt;
#  under the terms of the GNU General Public License as published by&lt;br /&gt;
#  the Free Software Foundation; either version 2 of the License, or&lt;br /&gt;
#  (at your option) any later version.&lt;br /&gt;
&lt;br /&gt;
[Unit]&lt;br /&gt;
Description=Tell that Container is started&lt;br /&gt;
ConditionPathExists=/proc/vz&lt;br /&gt;
ConditionPathExists=!/proc/bc&lt;br /&gt;
After=multi-user.target quotaon.service quotacheck.service&lt;br /&gt;
&lt;br /&gt;
[Service]&lt;br /&gt;
Type=forking&lt;br /&gt;
ExecStart=/bin/touch /.vzfifo&lt;br /&gt;
TimeoutSec=0&lt;br /&gt;
RemainAfterExit=no&lt;br /&gt;
SysVStartPriority=99&lt;br /&gt;
&lt;br /&gt;
[Install]&lt;br /&gt;
WantedBy=multi-user.target&lt;br /&gt;
EOF&lt;br /&gt;
&lt;br /&gt;
# Enable service&lt;br /&gt;
for service in vzfifo; do&lt;br /&gt;
        systemctl enable $service &amp;gt; /dev/null 2&amp;gt;&amp;amp;1&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Clean packages ===&lt;br /&gt;
After installing packages, you'll have some junk packages laying around in your cache.  Since you don't want your template to have those, this command will wipe them out.&lt;br /&gt;
 apt-get --purge clean&lt;br /&gt;
&lt;br /&gt;
Now everything is done.  Exit from the template and go back to the hardware node.&lt;br /&gt;
 exit&lt;br /&gt;
&lt;br /&gt;
== Preparing for and packing template cache ==&lt;br /&gt;
&lt;br /&gt;
We don't need an IP for the VE anymore, and we definitely do not need it in template cache, so remove it:&lt;br /&gt;
 sudo vzctl set 777 --ipdel all --save&lt;br /&gt;
&lt;br /&gt;
Also, remove DNS server and search domain information from ''/etc/resolv.conf'' file '''in VE''':&lt;br /&gt;
 sudo editor /vz/private/777/etc/resolv.conf&lt;br /&gt;
&lt;br /&gt;
Also, remove ''/etc/hostname'' file '''in VE''':&lt;br /&gt;
 sudo rm -f /vz/private/777/etc/hostname&lt;br /&gt;
&lt;br /&gt;
Stop the VE:&lt;br /&gt;
 sudo vzctl stop 777&lt;br /&gt;
&lt;br /&gt;
Go to the VE directory:&lt;br /&gt;
 cd /vz/private/777&lt;br /&gt;
&lt;br /&gt;
For newer OpenVZ kernel and [[ploop]] VE: (mount VE)&lt;br /&gt;
 mkdir /mnt/new_template&lt;br /&gt;
 mount -t ploop /vz/private/777/root.hdd/DiskDescriptor.xml /mnt/new_template&lt;br /&gt;
 cd /mnt/new_template&lt;br /&gt;
&lt;br /&gt;
Now create a cached OS tarball.  In the command below, you'll want to replace &amp;lt;tt&amp;gt;i386&amp;lt;/tt&amp;gt; with your architecture (i386, amd64, ia64, etc).&lt;br /&gt;
 sudo tar --numeric-owner -zcf /vz/template/cache/debian-5.0-i386-minimal.tar.gz .&lt;br /&gt;
&lt;br /&gt;
For newer OpenVZ kernel and [[ploop]] VE: (unmount VE)&lt;br /&gt;
 umount /mnt/template&lt;br /&gt;
&lt;br /&gt;
Look at the resulting tarball to see its size is sane:&lt;br /&gt;
 # ls -lh /vz/template/cache&lt;br /&gt;
 -rw-r--r--  1 root root  51M Apr 10 03:16 debian-5.0-i386-minimal.tar.gz&lt;br /&gt;
&lt;br /&gt;
== Checking if template cache works ==&lt;br /&gt;
We can now create a VE based on the just-created template cache.  Be sure to change &amp;lt;tt&amp;gt;i386&amp;lt;/tt&amp;gt; to your architecture just like you did when you named the tarball above.&lt;br /&gt;
 sudo vzctl create 123456 --ostemplate debian-5.0-i386-minimal&lt;br /&gt;
&lt;br /&gt;
Now make sure that it works:&lt;br /&gt;
 sudo vzctl start 123456&lt;br /&gt;
 sudo vzctl exec 123456 ps ax&lt;br /&gt;
&lt;br /&gt;
You should see that a few processes are running.&lt;br /&gt;
&lt;br /&gt;
== Final cleanup ==&lt;br /&gt;
Stop and remove the test VE you just created:&lt;br /&gt;
 sudo vzctl stop 123456&lt;br /&gt;
 sudo vzctl destroy 123456&lt;br /&gt;
 sudo rm /etc/vz/conf/123456.conf.destroyed&lt;br /&gt;
&lt;br /&gt;
Finally, let's remove the VE we used for OS template cache creation:&lt;br /&gt;
 sudo vzctl destroy 777&lt;br /&gt;
 sudo rm /etc/vz/conf/777.conf.destroyed&lt;br /&gt;
&lt;br /&gt;
You might want to edit /etc/vz/vz.conf and change DEF_OSTEMPLATE to the name of the template you use most often so that you don't have to specify the template when creating a VE.&lt;br /&gt;
 DEF_OSTEMPLATE=&amp;quot;debian-6.0-i386-minimal&amp;quot;&lt;br /&gt;
If you use iptables, you might want to include additional modules in the list for IPTABLES in /etc/vz/vz.conf. See ''man vzctl'' for a list of available modules.&lt;br /&gt;
&lt;br /&gt;
[[Category: HOWTO]]&lt;br /&gt;
[[Category: Templates]]&lt;br /&gt;
[[Category: Debian]]&lt;/div&gt;</summary>
		<author><name>Boernie</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=A_managed_OpenVZ_installation&amp;diff=7435</id>
		<title>A managed OpenVZ installation</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=A_managed_OpenVZ_installation&amp;diff=7435"/>
		<updated>2009-07-21T07:47:40Z</updated>

		<summary type="html">&lt;p&gt;Boernie: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article will show a managed installation of OpenVZ based on Debian Lenny (Debian 5.0) and some other interesting software pieces like PuppetMaster. It is mainly written to show how to manage more than one OpenVZ server in a production environment.&lt;br /&gt;
&lt;br /&gt;
==Pre-Requirements==&lt;br /&gt;
&lt;br /&gt;
You should know this software, because it is used during the setup.&lt;br /&gt;
&lt;br /&gt;
If you have any further questions, please feel free to contact us.&lt;br /&gt;
&lt;br /&gt;
Software list:&lt;br /&gt;
* Debian Installer and preseed &amp;lt;ref&amp;gt;http://wiki.debian.org/DebianInstaller/Preseed&amp;lt;/ref&amp;gt;&lt;br /&gt;
* Apt-Proxy &amp;lt;ref&amp;gt;http://apt-proxy.sourceforge.net/&amp;lt;/ref&amp;gt;&lt;br /&gt;
* Private Debian repository &amp;lt;ref&amp;gt;http://mirrorer.alioth.debian.org/&amp;lt;/ref&amp;gt;&lt;br /&gt;
* Puppet Master &amp;lt;ref&amp;gt;http://reductivelabs.com/products/puppet/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==The Debian preseed setup==&lt;br /&gt;
&lt;br /&gt;
At first some basics. To use a so called &amp;quot;preseed&amp;quot; file it is good to know what it is. The Debian installation is done with the &amp;quot;Debian Installer&amp;quot;, short d-i. This d-i normally is a ncurses based console application that asks you some questions about your timezone, your partition setup, your network and so on. All this questions could be answered trough a preseed file. In this file some or all questions could be answered.&lt;br /&gt;
&lt;br /&gt;
Now it is good to know that if you do not answer a question or if a question pops up which is not in the preseed file, the d-i waits until you give a right answer. So it is a really good thing because you could leave something open and use the same preseed file for different hardware boxes e.g. one hardware has one network interface, another hardware has four network interfaces.&lt;br /&gt;
&lt;br /&gt;
Also it is good to know that you can use the preseed file to answer questions from any Debian package which is using the debconf interface, for example postfix.&lt;br /&gt;
&lt;br /&gt;
===How to start the preseed setup===&lt;br /&gt;
&lt;br /&gt;
Simply download the Netinstall CD from a Debian mirror put it in your cdrom-drive and boot the server. After booting from the CD you should see the Debian Grub Boot menu. In this menu you should select the &amp;quot;Advanced Option&amp;quot; and in the following menu place your cursor on &amp;quot;Automated install&amp;quot; - '''but do not press enter!'''&lt;br /&gt;
&lt;br /&gt;
You have to edit this boot menu entry by pressing the '''TAB''' key. Now you can append the '''URL''' option to the end of this boot line. Now press enter and continue the setup. Here is an example and a screen shot.&lt;br /&gt;
&lt;br /&gt;
 URL=http://yourserver:yourport/yourpreseedfile&lt;br /&gt;
&lt;br /&gt;
[[Image:Notbuu_1_preseed.png|200px|thumb|Grub menu screen]]&lt;br /&gt;
&lt;br /&gt;
As an example here is our preseed file:&lt;br /&gt;
&lt;br /&gt;
===During the preseed setup===&lt;br /&gt;
&lt;br /&gt;
If the d-i faces a question where it finds no answer in the preseed file it will hold until you answer the question. The d-i will not cancel the installation process.&lt;br /&gt;
&lt;br /&gt;
This is an interesting feature because you could use one file for different hardware setups. For example, if you have not configured that the d-i always uses the eth0 device during setup and there is more then one network card in your hardware, the d-i will wait until you choose one device. &lt;br /&gt;
&lt;br /&gt;
[[Image:Notbuu_2_preseed.png|200px|thumb|d-i wait for answer]]&lt;br /&gt;
&lt;br /&gt;
====Additional informations====&lt;br /&gt;
&lt;br /&gt;
At our site we use different preseed files for different purposes. As example one preseed for VMWare (Guest) servers etc...&lt;br /&gt;
All our preseed files are placed on a webserver but you should know that it is also possible to integrate the preseed process into a self made Debian installation medium.&lt;br /&gt;
&lt;br /&gt;
==The apt-proxy==&lt;br /&gt;
&lt;br /&gt;
The Debian Netinstall CD covers only a minimal system. So if you need more packages like rsync or others you have to connect to the internet. Without choosing a Debian mirror during the setup, the setup could not continue. If you use Debian OpenVZ Servers and Debian based Virtual Private Server at your site, you should use an apt-proxy to cache the downloaded packages. After the first setup this will speed up your installation time by factors!&lt;br /&gt;
&lt;br /&gt;
The apt-proxy setup is as easy as 1-2-3 go.&lt;br /&gt;
&lt;br /&gt;
Here is the preseed file, please note that I have removed the comments but I make some explanations for clearer understanding:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
d-i debian-installer/locale string en_US.UTF8&lt;br /&gt;
d-i console-keymaps-at/keymap select de-latin1-nodeadkeys&lt;br /&gt;
d-i netcfg/choose_interface select auto&lt;br /&gt;
d-i netcfg/dhcp_timeout string 60&lt;br /&gt;
d-i netcfg/get_hostname string unassigned-hostname&lt;br /&gt;
d-i netcfg/get_domain string unassigned-domain&lt;br /&gt;
d-i netcfg/wireless_wep string&lt;br /&gt;
d-i mirror/country string enter information manually&lt;br /&gt;
&lt;br /&gt;
#This is our APT-PROXY address&lt;br /&gt;
d-i mirror/http/hostname string youraptproxy:9999&lt;br /&gt;
&lt;br /&gt;
d-i mirror/http/directory string /debian&lt;br /&gt;
d-i mirror/suite string stable&lt;br /&gt;
d-i clock-setup/ntp boolean true&lt;br /&gt;
&lt;br /&gt;
#NTP Server&lt;br /&gt;
d-i clock-setup/ntp-server string yourtimeserver&lt;br /&gt;
&lt;br /&gt;
#The partition setup, be careful!&lt;br /&gt;
#By default the OpenVZ debian packages are using /var/lib/vz&lt;br /&gt;
d-i partman-auto/method string lvm&lt;br /&gt;
d-i partman-auto/purge_lvm_from_device boolean true&lt;br /&gt;
d-i partman-lvm/confirm boolean true&lt;br /&gt;
d-i partman-auto/expert_recipe string                         \&lt;br /&gt;
      boot-root ::                                            \&lt;br /&gt;
              150 150 150 ext3                                \&lt;br /&gt;
                      $primary{ } $bootable{ }                \&lt;br /&gt;
                      method{ format } format{ }              \&lt;br /&gt;
                      use_filesystem{ } filesystem{ ext3 }    \&lt;br /&gt;
                      mountpoint{ /boot }                     \&lt;br /&gt;
              .                                               \&lt;br /&gt;
              5120 5120 5120 ext3                             \&lt;br /&gt;
                      $primary{ } method{ format } format{ }  \&lt;br /&gt;
                      use_filesystem{ } filesystem{ ext3 }    \&lt;br /&gt;
                      mountpoint{ / }                         \&lt;br /&gt;
              .                                               \&lt;br /&gt;
              500 10000 1000000000 ext3                       \&lt;br /&gt;
                      method{ format } format{ } $lvmok{ }    \&lt;br /&gt;
                      use_filesystem{ } filesystem{ ext3 }    \&lt;br /&gt;
                      mountpoint{ /var }                      \&lt;br /&gt;
              .                                               \&lt;br /&gt;
              4096 4096 4096 linux-swap                       \&lt;br /&gt;
                      method{ swap } format{ } $lvmok { }     \&lt;br /&gt;
              .&lt;br /&gt;
d-i partman/confirm_write_new_label boolean true&lt;br /&gt;
d-i partman/choose_partition \&lt;br /&gt;
       select Finish partitioning and write changes to disk&lt;br /&gt;
d-i partman/confirm boolean true&lt;br /&gt;
d-i clock-setup/utc boolean true&lt;br /&gt;
d-i time/zone string Europe/Vienna&lt;br /&gt;
d-i apt-setup/non-free boolean true&lt;br /&gt;
d-i apt-setup/contrib boolean true&lt;br /&gt;
d-i apt-setup/security_host youraptproxy:9999&lt;br /&gt;
&lt;br /&gt;
#Our private internal repository for some packages&lt;br /&gt;
d-i apt-setup/local0/repository string \&lt;br /&gt;
       http://yourprivaterepository:10000/debian hns stable&lt;br /&gt;
d-i apt-setup/local0/key string http://yourprivaterepository:10000/PublicKey&lt;br /&gt;
d-i passwd/make-user boolean false&lt;br /&gt;
&lt;br /&gt;
#The encrypted root password (this is only an example :) )&lt;br /&gt;
d-i passwd/root-password-crypted password $1$v4rfe7wv$gEkbCLxCPhKaj92s.uJbD1&lt;br /&gt;
d-i grub-installer/only_debian boolean true&lt;br /&gt;
d-i grub-installer/with_other_os boolean true&lt;br /&gt;
tasksel tasksel/first multiselect standard&lt;br /&gt;
&lt;br /&gt;
#Additional base packages&lt;br /&gt;
d-i pkgsel/include string openssh-server build-essential vim snmpd lib32z1-dev rsync ntp ntpdate&lt;br /&gt;
d-i finish-install/reboot_in_progress note&lt;br /&gt;
d-i cdrom-detect/eject boolean false&lt;br /&gt;
xserver-xorg xserver-xorg/autodetect_monitor boolean true&lt;br /&gt;
xserver-xorg xserver-xorg/config/monitor/selection-method \&lt;br /&gt;
       select medium&lt;br /&gt;
xserver-xorg xserver-xorg/config/monitor/mode-list \&lt;br /&gt;
       select 1024x768 @ 60 Hz&lt;br /&gt;
&lt;br /&gt;
#Packages that gets installed AFTER the base installation&lt;br /&gt;
#hns* packages are build by our own to fasten the setup and management&lt;br /&gt;
d-i preseed/late_command string apt-install hp-health hp-snmp-agents hpsmh \&lt;br /&gt;
  hp-smh-templates hpacucli cpqacuxe ethtool linux-headers-2.6-openvz-amd64 \&lt;br /&gt;
  linux-image-2.6-openvz-amd64 vzctl vzquota hns-zabbix-agentd hns-openvz-common \&lt;br /&gt;
  hns-openvz-ubuntu-hosting hns-puppet firmware-qlogic&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==The private Debian repository==&lt;br /&gt;
&lt;br /&gt;
In our case the private repository is an essential factor because it will provide you with a fast software roll out, replicable software and consistent system state trough a large number of setups.&lt;br /&gt;
&lt;br /&gt;
It is quite easy to setup your own repository with reprepro &amp;lt;ref&amp;gt;http://mirrorer.alioth.debian.org/&amp;lt;/ref&amp;gt; and it is really useful.&lt;br /&gt;
&lt;br /&gt;
As you can see in the preseed file we have a lot of this packages in our repository. Some examples:&lt;br /&gt;
&lt;br /&gt;
*hns-zabbix-agentd&lt;br /&gt;
:is used for the automated installation of the Zabbix System Monitoring Agent.&amp;lt;ref&amp;gt;http://www.zabbix.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
*hns-openvz-common&lt;br /&gt;
:creates a backup cronjob and installs a backup script&lt;br /&gt;
:installs a set of scripts for Zabbix monitoring and therefore depends on the hns-zabbix-agentd package&lt;br /&gt;
*hns-openvz-ubuntu-hosting&lt;br /&gt;
:installs our pre-created Ubuntu&amp;lt;ref&amp;gt;http://www.ubuntu.com/&amp;lt;/ref&amp;gt; template for automated guest-installation&lt;br /&gt;
*hns-puppet&lt;br /&gt;
:installs the PuppetMaster client&lt;br /&gt;
&lt;br /&gt;
==The Puppet Master configuration management==&lt;br /&gt;
&lt;br /&gt;
If your preseeded setup was successful you have to configure your fresh server to fit your expectations. At our site we have ten OpenVZ servers in different countries and it is really important that they have the same configuration.&lt;br /&gt;
&lt;br /&gt;
To make life easier we decided to use a configuration management like cfengine&amp;lt;ref&amp;gt;http://www.cfengine.org/&amp;lt;/ref&amp;gt; but not as complex in setup and management. We found our solution in Puppet Master.&lt;br /&gt;
&lt;br /&gt;
The only dependency Puppet Master has is Ruby. This should be installable on every distribution in minutes.&lt;br /&gt;
&lt;br /&gt;
After the installation you have to configure the Puppet Master to do things. Typically this means accepting the public private key pair and doing some configuration stuff. At our site we use Puppet Master to manage an installation of about 100 servers.&lt;br /&gt;
&lt;br /&gt;
One thing it does is to change the sysctl.conf file.&lt;br /&gt;
&lt;br /&gt;
To get a feeling for it here is an configuration example (only OpenVZ server hosts):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# ALL----- OPENVZ&lt;br /&gt;
node &amp;quot;yourserver1.yourdns.com&amp;quot;, &amp;quot;yourserver2.yourdns.com&amp;quot;, &amp;quot;yourserver3.yourdns.com&amp;quot;, &amp;quot;yourserver4.yourdns.com&amp;quot;, &amp;quot;yourserver5.yourdns.com&amp;quot;, &amp;quot;yourserver6.yourdns.com&amp;quot;, &amp;quot;yourserver7.yourdns.com&amp;quot;{&lt;br /&gt;
    file { &amp;quot;/etc/aliases&amp;quot;:&lt;br /&gt;
        mode =&amp;gt; 644,&lt;br /&gt;
        owner =&amp;gt; root,&lt;br /&gt;
        group =&amp;gt; root,&lt;br /&gt;
        source =&amp;gt; &amp;quot;puppet://yourpuppetmaster/files/openvz-hosts/etc/aliases&amp;quot;,&lt;br /&gt;
    }&lt;br /&gt;
    exec { &amp;quot;subscribe-newaliases&amp;quot;:&lt;br /&gt;
        command =&amp;gt; &amp;quot;/usr/bin/newaliases &amp;amp;&amp;amp; /bin/echo NEALIASSES&amp;quot;,&lt;br /&gt;
        subscribe =&amp;gt; File[&amp;quot;/etc/aliases&amp;quot;],&lt;br /&gt;
        refreshonly =&amp;gt; true,&lt;br /&gt;
        logoutput =&amp;gt; true&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    file { &amp;quot;/etc/apt/sources.list&amp;quot;:&lt;br /&gt;
        mode =&amp;gt; 644,&lt;br /&gt;
        owner =&amp;gt; root,&lt;br /&gt;
        group =&amp;gt; root,&lt;br /&gt;
        source =&amp;gt; &amp;quot;puppet://yourpuppetmaster/files/openvz-hosts/etc/apt/sources.list&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    file { &amp;quot;/root/.ssh/authorized_keys2&amp;quot;:&lt;br /&gt;
        mode =&amp;gt; 644,&lt;br /&gt;
        owner =&amp;gt; root,&lt;br /&gt;
        group =&amp;gt; root,&lt;br /&gt;
        source =&amp;gt; &amp;quot;puppet://yourpuppetmaster/files/openvz-hosts/root/authorized_keys2&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    file { &amp;quot;/etc/vim/vimrc&amp;quot;:&lt;br /&gt;
        mode =&amp;gt; 644,&lt;br /&gt;
        owner =&amp;gt; root,&lt;br /&gt;
        group =&amp;gt; root,&lt;br /&gt;
        source =&amp;gt; &amp;quot;puppet://yourpuppetmaster/files/openvz-hosts/etc/vim/vimrc&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    file { &amp;quot;/etc/vz/conf/ve-vps.10.conf-sample&amp;quot;:&lt;br /&gt;
        mode =&amp;gt; 644,&lt;br /&gt;
        owner =&amp;gt; root,&lt;br /&gt;
        group =&amp;gt; root,&lt;br /&gt;
        source =&amp;gt; &amp;quot;puppet://yourpuppetmaster/files/openvz-hosts/etc/vz/conf/ve-vps.10.conf-sample&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    file { &amp;quot;/etc/sysctl.conf&amp;quot;:&lt;br /&gt;
        mode =&amp;gt; 644,&lt;br /&gt;
        owner =&amp;gt; root,&lt;br /&gt;
        group =&amp;gt; root,&lt;br /&gt;
        source =&amp;gt; &amp;quot;puppet://yourpuppetmaster/files/openvz-hosts/etc/sysctl.conf&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    exec { subscribe-sysctl:&lt;br /&gt;
        command =&amp;gt; &amp;quot;/sbin/sysctl -p &amp;amp;&amp;amp; /bin/echo SYSCTL EXECUTED&amp;quot;,&lt;br /&gt;
        logoutput =&amp;gt; true,&lt;br /&gt;
        refreshonly =&amp;gt; true,&lt;br /&gt;
        subscribe =&amp;gt; file[&amp;quot;/etc/sysctl.conf&amp;quot;]&lt;br /&gt;
    }&lt;br /&gt;
    file { &amp;quot;/etc/ntp.conf&amp;quot;:&lt;br /&gt;
        mode =&amp;gt; 644,&lt;br /&gt;
        owner =&amp;gt; root,&lt;br /&gt;
        group =&amp;gt; root,&lt;br /&gt;
        source =&amp;gt; &amp;quot;puppet://yourpuppetmaster/files/openvz-hosts/etc/ntp.conf&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    file { &amp;quot;/root/.bashrc&amp;quot;:&lt;br /&gt;
        mode =&amp;gt; 644,&lt;br /&gt;
        owner =&amp;gt; root,&lt;br /&gt;
        group =&amp;gt; root,&lt;br /&gt;
        source =&amp;gt; &amp;quot;puppet://yourpuppetmaster/files/openvz-hosts/root/bashrc&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    file { &amp;quot;/srv/exim_config.sh&amp;quot;:&lt;br /&gt;
        mode =&amp;gt; 744,&lt;br /&gt;
        owner =&amp;gt; root,&lt;br /&gt;
        group =&amp;gt; root,&lt;br /&gt;
        source =&amp;gt; &amp;quot;puppet://yourpuppetmaster/files/openvz-hosts/srv/exim_config.sh&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    exec { subscribe-exim_config:&lt;br /&gt;
        command =&amp;gt; &amp;quot;/srv/exim_config.sh &amp;amp;&amp;amp; /usr/sbin/update-exim4.conf &amp;amp;&amp;amp; /etc/init.d/exim4 restart &amp;amp;&amp;amp; /bin/echo EXIM_CONFIG&amp;quot;,&lt;br /&gt;
        logoutput =&amp;gt; true,&lt;br /&gt;
        refreshonly =&amp;gt; true,&lt;br /&gt;
        subscribe =&amp;gt; file[&amp;quot;/srv/exim_config.sh&amp;quot;]&lt;br /&gt;
    }&lt;br /&gt;
    file { &amp;quot;/etc/default/snmpd&amp;quot;:&lt;br /&gt;
        mode =&amp;gt; 644,&lt;br /&gt;
        owner =&amp;gt; root,&lt;br /&gt;
        group =&amp;gt; root,&lt;br /&gt;
        source =&amp;gt; &amp;quot;puppet://yourpuppetmaster/files/openvz-hosts/etc/default/snmpd&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    exec { subscribe-snmpd_config:&lt;br /&gt;
        command =&amp;gt; &amp;quot;/etc/init.d/snmpd restart &amp;amp;&amp;amp; /bin/echo SNMPD_CONFIG&amp;quot;,&lt;br /&gt;
        logoutput =&amp;gt; true,&lt;br /&gt;
        refreshonly =&amp;gt; true,&lt;br /&gt;
        subscribe =&amp;gt; file[&amp;quot;/etc/default/snmpd&amp;quot;]&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Further information==&lt;br /&gt;
&lt;br /&gt;
For further information on the particular tools like apt-proxy/Debian repository/... we will add some documentation links!&lt;br /&gt;
Write us if you have questions or if you want to see practical documentations on some of the tools.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Boernie</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=A_managed_OpenVZ_installation&amp;diff=7434</id>
		<title>A managed OpenVZ installation</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=A_managed_OpenVZ_installation&amp;diff=7434"/>
		<updated>2009-07-21T07:45:08Z</updated>

		<summary type="html">&lt;p&gt;Boernie: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article will show a managed installation of OpenVZ based on Debian Lenny (Debian 5.0) and some other interesting software pieces like PuppetMaster. It is mainly written to show how to manage more than one OpenVZ server in a production environment.&lt;br /&gt;
&lt;br /&gt;
==Pre-Requirements==&lt;br /&gt;
&lt;br /&gt;
You should know this software, because it is used during the setup.&lt;br /&gt;
&lt;br /&gt;
If you have any further questions, please feel free to contact us.&lt;br /&gt;
&lt;br /&gt;
Software list:&lt;br /&gt;
* Debian Installer and preseed &amp;lt;ref&amp;gt;http://wiki.debian.org/DebianInstaller/Preseed&amp;lt;/ref&amp;gt;&lt;br /&gt;
* Apt-Proxy &amp;lt;ref&amp;gt;http://apt-proxy.sourceforge.net/&amp;lt;/ref&amp;gt;&lt;br /&gt;
* Private Debian repository &amp;lt;ref&amp;gt;http://mirrorer.alioth.debian.org/&amp;lt;/ref&amp;gt;&lt;br /&gt;
* Puppet Master &amp;lt;ref&amp;gt;http://reductivelabs.com/products/puppet/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==The Debian preseed setup==&lt;br /&gt;
&lt;br /&gt;
At first some basics. To use a so called &amp;quot;preseed&amp;quot; file it is good to know what it is. The Debian installation is done with the &amp;quot;Debian Installer&amp;quot;, short d-i. This d-i normally is a ncurses based console application that asks you some questions about your timezone, your partition setup, your network and so on. All this questions could be answered trough a preseed file. In this file some or all questions could be answered.&lt;br /&gt;
&lt;br /&gt;
Now it is good to know that if you do not answer a question or if a question pops up which is not in the preseed file, the d-i waits until you give a right answer. So it is a really good thing because you could leave something open and use the same preseed file for different hardware boxes e.g. one hardware has one network interface, another hardware has four network interfaces.&lt;br /&gt;
&lt;br /&gt;
Also it is good to know that you can use the preseed file to answer questions from any Debian package which is using the debconf interface, for example postfix.&lt;br /&gt;
&lt;br /&gt;
===How to start the preseed setup===&lt;br /&gt;
&lt;br /&gt;
Simply download the Netinstall CD from a Debian mirror put it in your cdrom-drive and boot the server. After booting from the CD you should see the Debian Grub Boot menu. In this menu you should select the &amp;quot;Advanced Option&amp;quot; and in the following menu place your cursor on &amp;quot;Automated install&amp;quot; - '''but do not press enter!'''&lt;br /&gt;
&lt;br /&gt;
You have to edit this boot menu entry by pressing the '''TAB''' key. Now you can append the '''URL''' option to the end of this boot line. Now press enter and continue the setup. Here is an example and a screen shot.&lt;br /&gt;
&lt;br /&gt;
 URL=http://yourserver:yourport/yourpreseedfile&lt;br /&gt;
&lt;br /&gt;
[[Image:Notbuu_1_preseed.png|200px|thumb|Grub menu screen]]&lt;br /&gt;
&lt;br /&gt;
As an example here is our preseed file:&lt;br /&gt;
&lt;br /&gt;
===During the preseed setup===&lt;br /&gt;
&lt;br /&gt;
If the d-i faces a question where it finds no answer in the preseed file it will hold until you answer the question. The d-i will not cancel the installation process.&lt;br /&gt;
&lt;br /&gt;
This is an interesting feature because you could use one file for different hardware setups. For example, if you have not configured that the d-i always uses the eth0 device during setup and there is more then one network card in your hardware, the d-i will wait until you choose one device. &lt;br /&gt;
&lt;br /&gt;
[[Image:Notbuu_2_preseed.png|200px|thumb|d-i wait for answer]]&lt;br /&gt;
&lt;br /&gt;
====Additional informations====&lt;br /&gt;
&lt;br /&gt;
At our site we use different preseed files for different purposes. As example one preseed for VMWare (Guest) servers etc...&lt;br /&gt;
All our preseed files are placed on a webserver but you should know that it is also possible to integrate the preseed process into a self made Debian installation medium.&lt;br /&gt;
&lt;br /&gt;
==The apt-proxy==&lt;br /&gt;
&lt;br /&gt;
The Debian Netinstall CD covers only a minimal system. So if you need more packages like rsync or others you have to connect to the internet. Without choosing a Debian mirror during the setup, the setup could not continue. If you use Debian OpenVZ Servers and Debian based Virtual Private Server at your site, you should use an apt-proxy to cache the downloaded packages. After the first setup this will speed up your installation time by factors!&lt;br /&gt;
&lt;br /&gt;
The apt-proxy setup is as easy as 1-2-3 go.&lt;br /&gt;
&lt;br /&gt;
Here is the preseed file, please note that I have removed the comments but I make some explanations for clearer understanding:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
d-i debian-installer/locale string en_US.UTF8&lt;br /&gt;
d-i console-keymaps-at/keymap select de-latin1-nodeadkeys&lt;br /&gt;
d-i netcfg/choose_interface select auto&lt;br /&gt;
d-i netcfg/dhcp_timeout string 60&lt;br /&gt;
d-i netcfg/get_hostname string unassigned-hostname&lt;br /&gt;
d-i netcfg/get_domain string unassigned-domain&lt;br /&gt;
d-i netcfg/wireless_wep string&lt;br /&gt;
d-i mirror/country string enter information manually&lt;br /&gt;
&lt;br /&gt;
#This is our APT-PROXY address&lt;br /&gt;
d-i mirror/http/hostname string youraptproxy:9999&lt;br /&gt;
&lt;br /&gt;
d-i mirror/http/directory string /debian&lt;br /&gt;
d-i mirror/suite string stable&lt;br /&gt;
d-i clock-setup/ntp boolean true&lt;br /&gt;
&lt;br /&gt;
#NTP Server&lt;br /&gt;
d-i clock-setup/ntp-server string yourtimeserver&lt;br /&gt;
&lt;br /&gt;
#The partition setup, be careful!&lt;br /&gt;
#By default the OpenVZ debian packages are using /var/lib/vz&lt;br /&gt;
d-i partman-auto/method string lvm&lt;br /&gt;
d-i partman-auto/purge_lvm_from_device boolean true&lt;br /&gt;
d-i partman-lvm/confirm boolean true&lt;br /&gt;
d-i partman-auto/expert_recipe string                         \&lt;br /&gt;
      boot-root ::                                            \&lt;br /&gt;
              150 150 150 ext3                                \&lt;br /&gt;
                      $primary{ } $bootable{ }                \&lt;br /&gt;
                      method{ format } format{ }              \&lt;br /&gt;
                      use_filesystem{ } filesystem{ ext3 }    \&lt;br /&gt;
                      mountpoint{ /boot }                     \&lt;br /&gt;
              .                                               \&lt;br /&gt;
              5120 5120 5120 ext3                             \&lt;br /&gt;
                      $primary{ } method{ format } format{ }  \&lt;br /&gt;
                      use_filesystem{ } filesystem{ ext3 }    \&lt;br /&gt;
                      mountpoint{ / }                         \&lt;br /&gt;
              .                                               \&lt;br /&gt;
              500 10000 1000000000 ext3                       \&lt;br /&gt;
                      method{ format } format{ } $lvmok{ }    \&lt;br /&gt;
                      use_filesystem{ } filesystem{ ext3 }    \&lt;br /&gt;
                      mountpoint{ /var }                      \&lt;br /&gt;
              .                                               \&lt;br /&gt;
              4096 4096 4096 linux-swap                       \&lt;br /&gt;
                      method{ swap } format{ } $lvmok { }     \&lt;br /&gt;
              .&lt;br /&gt;
d-i partman/confirm_write_new_label boolean true&lt;br /&gt;
d-i partman/choose_partition \&lt;br /&gt;
       select Finish partitioning and write changes to disk&lt;br /&gt;
d-i partman/confirm boolean true&lt;br /&gt;
d-i clock-setup/utc boolean true&lt;br /&gt;
d-i time/zone string Europe/Vienna&lt;br /&gt;
d-i apt-setup/non-free boolean true&lt;br /&gt;
d-i apt-setup/contrib boolean true&lt;br /&gt;
d-i apt-setup/security_host youraptproxy:9999&lt;br /&gt;
&lt;br /&gt;
#Our private internal repository for some packages&lt;br /&gt;
d-i apt-setup/local0/repository string \&lt;br /&gt;
       http://yourprivaterepository:10000/debian hns stable&lt;br /&gt;
d-i apt-setup/local0/key string http://yourprivaterepository:10000/PublicKey&lt;br /&gt;
d-i passwd/make-user boolean false&lt;br /&gt;
&lt;br /&gt;
#The encrypted root password (this is only an example :) )&lt;br /&gt;
d-i passwd/root-password-crypted password $1$v4rfe7wv$gEkbCLxCPhKaj92s.uJbD1&lt;br /&gt;
d-i grub-installer/only_debian boolean true&lt;br /&gt;
d-i grub-installer/with_other_os boolean true&lt;br /&gt;
tasksel tasksel/first multiselect standard&lt;br /&gt;
&lt;br /&gt;
#Additional base packages&lt;br /&gt;
d-i pkgsel/include string openssh-server build-essential vim snmpd lib32z1-dev rsync ntp ntpdate&lt;br /&gt;
d-i finish-install/reboot_in_progress note&lt;br /&gt;
d-i cdrom-detect/eject boolean false&lt;br /&gt;
xserver-xorg xserver-xorg/autodetect_monitor boolean true&lt;br /&gt;
xserver-xorg xserver-xorg/config/monitor/selection-method \&lt;br /&gt;
       select medium&lt;br /&gt;
xserver-xorg xserver-xorg/config/monitor/mode-list \&lt;br /&gt;
       select 1024x768 @ 60 Hz&lt;br /&gt;
&lt;br /&gt;
#Packages that gets installed AFTER the base installation&lt;br /&gt;
#hns* packages are build by our own to fasten the setup and management&lt;br /&gt;
d-i preseed/late_command string apt-install hp-health hp-snmp-agents hpsmh \&lt;br /&gt;
  hp-smh-templates hpacucli cpqacuxe ethtool linux-headers-2.6-openvz-amd64 \&lt;br /&gt;
  linux-image-2.6-openvz-amd64 vzctl vzquota hns-zabbix-agentd hns-openvz-common \&lt;br /&gt;
  hns-openvz-ubuntu-hosting hns-puppet firmware-qlogic&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==The private Debian repository==&lt;br /&gt;
&lt;br /&gt;
In our case the private repository is an essential factor because it will provide you with a fast software roll out, replicable software and consistent system state trough a large number of setups.&lt;br /&gt;
&lt;br /&gt;
It is quite easy to setup your own repository with reprepro &amp;lt;ref&amp;gt;http://mirrorer.alioth.debian.org/&amp;lt;/ref&amp;gt; and it is really useful.&lt;br /&gt;
&lt;br /&gt;
As you can see in the preseed file we have a lot of this packages in our repository. Some examples:&lt;br /&gt;
&lt;br /&gt;
*hns-zabbix-agentd&lt;br /&gt;
:is used for the automated installation of the Zabbix System Monitoring Agent.&amp;lt;ref&amp;gt;http://www.zabbix.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
*hns-openvz-common&lt;br /&gt;
:creates a backup cronjob and installs a backup script&lt;br /&gt;
:installs a set of scripts for Zabbix monitoring and therefore depends on the hns-zabbix-agentd package&lt;br /&gt;
*hns-openvz-ubuntu-hosting&lt;br /&gt;
:installs our pre-created Ubuntu&amp;lt;ref&amp;gt;http://www.ubuntu.com/&amp;lt;/ref&amp;gt; template for automated guest-installation&lt;br /&gt;
*hns-puppet&lt;br /&gt;
:installs the PuppetMaster client&lt;br /&gt;
&lt;br /&gt;
==The Puppet Master configuration management==&lt;br /&gt;
&lt;br /&gt;
If your preseeded setup was successful you have to configure your fresh server to fit your expectations. At our site we have ten OpenVZ servers in different countries and it is really important that they have the same configuration.&lt;br /&gt;
&lt;br /&gt;
To make life easier we decided to use a configuration management like cfengine&amp;lt;ref&amp;gt;http://www.cfengine.org/&amp;lt;/ref&amp;gt; but not as complex in setup and management. We found our solution in Puppet Master.&lt;br /&gt;
&lt;br /&gt;
The only dependency Puppet Master has is Ruby. This should be installable on every distribution in minutes.&lt;br /&gt;
&lt;br /&gt;
After the installation you have to configure the Puppet Master to do things. Typically this means accepting the public private key pair and doing some configuration stuff. At our site we use Puppet Master to manage an installation of about 100 servers.&lt;br /&gt;
&lt;br /&gt;
One thing it does is to change the sysctl.conf file.&lt;br /&gt;
&lt;br /&gt;
To get a feeling for it here is an configuration example (only OpenVZ server hosts):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# ALL----- OPENVZ&lt;br /&gt;
node &amp;quot;yourserver1.yourdns.com&amp;quot;, &amp;quot;yourserver2.yourdns.com&amp;quot;, &amp;quot;yourserver3.yourdns.com&amp;quot;, &amp;quot;yourserver4.yourdns.com&amp;quot;, &amp;quot;yourserver5.yourdns.com&amp;quot;, &amp;quot;yourserver6.yourdns.com&amp;quot;, &amp;quot;yourserver7.yourdns.com&amp;quot;{&lt;br /&gt;
    file { &amp;quot;/etc/aliases&amp;quot;:&lt;br /&gt;
        mode =&amp;gt; 644,&lt;br /&gt;
        owner =&amp;gt; root,&lt;br /&gt;
        group =&amp;gt; root,&lt;br /&gt;
        source =&amp;gt; &amp;quot;puppet://yourpuppetmaster/files/openvz-hosts/etc/aliases&amp;quot;,&lt;br /&gt;
    }&lt;br /&gt;
    exec { &amp;quot;subscribe-newaliases&amp;quot;:&lt;br /&gt;
        command =&amp;gt; &amp;quot;/usr/bin/newaliases &amp;amp;&amp;amp; /bin/echo NEALIASSES&amp;quot;,&lt;br /&gt;
        subscribe =&amp;gt; File[&amp;quot;/etc/aliases&amp;quot;],&lt;br /&gt;
        refreshonly =&amp;gt; true,&lt;br /&gt;
        logoutput =&amp;gt; true&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    file { &amp;quot;/etc/apt/sources.list&amp;quot;:&lt;br /&gt;
        mode =&amp;gt; 644,&lt;br /&gt;
        owner =&amp;gt; root,&lt;br /&gt;
        group =&amp;gt; root,&lt;br /&gt;
        source =&amp;gt; &amp;quot;puppet://yourpuppetmaster/files/openvz-hosts/etc/apt/sources.list&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    file { &amp;quot;/root/.ssh/authorized_keys2&amp;quot;:&lt;br /&gt;
        mode =&amp;gt; 644,&lt;br /&gt;
        owner =&amp;gt; root,&lt;br /&gt;
        group =&amp;gt; root,&lt;br /&gt;
        source =&amp;gt; &amp;quot;puppet://yourpuppetmaster/files/openvz-hosts/root/authorized_keys2&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    file { &amp;quot;/etc/vim/vimrc&amp;quot;:&lt;br /&gt;
        mode =&amp;gt; 644,&lt;br /&gt;
        owner =&amp;gt; root,&lt;br /&gt;
        group =&amp;gt; root,&lt;br /&gt;
        source =&amp;gt; &amp;quot;puppet://yourpuppetmaster/files/openvz-hosts/etc/vim/vimrc&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    file { &amp;quot;/etc/vz/conf/ve-vps.10.conf-sample&amp;quot;:&lt;br /&gt;
        mode =&amp;gt; 644,&lt;br /&gt;
        owner =&amp;gt; root,&lt;br /&gt;
        group =&amp;gt; root,&lt;br /&gt;
        source =&amp;gt; &amp;quot;puppet://yourpuppetmaster/files/openvz-hosts/etc/vz/conf/ve-vps.10.conf-sample&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    file { &amp;quot;/etc/sysctl.conf&amp;quot;:&lt;br /&gt;
        mode =&amp;gt; 644,&lt;br /&gt;
        owner =&amp;gt; root,&lt;br /&gt;
        group =&amp;gt; root,&lt;br /&gt;
        source =&amp;gt; &amp;quot;puppet://yourpuppetmaster/files/openvz-hosts/etc/sysctl.conf&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    exec { subscribe-sysctl:&lt;br /&gt;
        command =&amp;gt; &amp;quot;/sbin/sysctl -p &amp;amp;&amp;amp; /bin/echo SYSCTL EXECUTED&amp;quot;,&lt;br /&gt;
        logoutput =&amp;gt; true,&lt;br /&gt;
        refreshonly =&amp;gt; true,&lt;br /&gt;
        subscribe =&amp;gt; file[&amp;quot;/etc/sysctl.conf&amp;quot;]&lt;br /&gt;
    }&lt;br /&gt;
    file { &amp;quot;/etc/ntp.conf&amp;quot;:&lt;br /&gt;
        mode =&amp;gt; 644,&lt;br /&gt;
        owner =&amp;gt; root,&lt;br /&gt;
        group =&amp;gt; root,&lt;br /&gt;
        source =&amp;gt; &amp;quot;puppet://yourpuppetmaster/files/openvz-hosts/etc/ntp.conf&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    file { &amp;quot;/root/.bashrc&amp;quot;:&lt;br /&gt;
        mode =&amp;gt; 644,&lt;br /&gt;
        owner =&amp;gt; root,&lt;br /&gt;
        group =&amp;gt; root,&lt;br /&gt;
        source =&amp;gt; &amp;quot;puppet://yourpuppetmaster/files/openvz-hosts/root/bashrc&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    file { &amp;quot;/srv/exim_config.sh&amp;quot;:&lt;br /&gt;
        mode =&amp;gt; 744,&lt;br /&gt;
        owner =&amp;gt; root,&lt;br /&gt;
        group =&amp;gt; root,&lt;br /&gt;
        source =&amp;gt; &amp;quot;puppet://yourpuppetmaster/files/openvz-hosts/srv/exim_config.sh&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    exec { subscribe-exim_config:&lt;br /&gt;
        command =&amp;gt; &amp;quot;/srv/exim_config.sh &amp;amp;&amp;amp; /usr/sbin/update-exim4.conf &amp;amp;&amp;amp; /etc/init.d/exim4 restart &amp;amp;&amp;amp; /bin/echo EXIM_CONFIG&amp;quot;,&lt;br /&gt;
        logoutput =&amp;gt; true,&lt;br /&gt;
        refreshonly =&amp;gt; true,&lt;br /&gt;
        subscribe =&amp;gt; file[&amp;quot;/srv/exim_config.sh&amp;quot;]&lt;br /&gt;
    }&lt;br /&gt;
    file { &amp;quot;/etc/default/snmpd&amp;quot;:&lt;br /&gt;
        mode =&amp;gt; 644,&lt;br /&gt;
        owner =&amp;gt; root,&lt;br /&gt;
        group =&amp;gt; root,&lt;br /&gt;
        source =&amp;gt; &amp;quot;puppet://yourpuppetmaster/files/openvz-hosts/etc/default/snmpd&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    exec { subscribe-snmpd_config:&lt;br /&gt;
        command =&amp;gt; &amp;quot;/etc/init.d/snmpd restart &amp;amp;&amp;amp; /bin/echo SNMPD_CONFIG&amp;quot;,&lt;br /&gt;
        logoutput =&amp;gt; true,&lt;br /&gt;
        refreshonly =&amp;gt; true,&lt;br /&gt;
        subscribe =&amp;gt; file[&amp;quot;/etc/default/snmpd&amp;quot;]&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Further information==&lt;br /&gt;
&lt;br /&gt;
For further information on the particular tools like APT-Proxy/Debian Repository/... we will add some documentation links!&lt;br /&gt;
Write us if you have questions or if you want to see practical documentations on some of the tools.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Boernie</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=A_managed_OpenVZ_installation&amp;diff=7433</id>
		<title>A managed OpenVZ installation</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=A_managed_OpenVZ_installation&amp;diff=7433"/>
		<updated>2009-07-21T07:42:07Z</updated>

		<summary type="html">&lt;p&gt;Boernie: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article will show a managed installation of OpenVZ based on Debian Lenny (Debian 5.0) and some other interesting software pieces like PuppetMaster. It is mainly written to show how to manage more than one OpenVZ server in a production environment.&lt;br /&gt;
&lt;br /&gt;
==Pre-Requirements==&lt;br /&gt;
&lt;br /&gt;
You should know this software, because it is used during the setup.&lt;br /&gt;
&lt;br /&gt;
If you have any further questions, please feel free to contact us.&lt;br /&gt;
&lt;br /&gt;
Software list:&lt;br /&gt;
* Debian Installer and preseed &amp;lt;ref&amp;gt;http://wiki.debian.org/DebianInstaller/Preseed&amp;lt;/ref&amp;gt;&lt;br /&gt;
* Apt-Proxy &amp;lt;ref&amp;gt;http://apt-proxy.sourceforge.net/&amp;lt;/ref&amp;gt;&lt;br /&gt;
* Private Debian repository &amp;lt;ref&amp;gt;http://mirrorer.alioth.debian.org/&amp;lt;/ref&amp;gt;&lt;br /&gt;
* Puppet Master &amp;lt;ref&amp;gt;http://reductivelabs.com/products/puppet/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==The Debian preseed setup==&lt;br /&gt;
&lt;br /&gt;
At first some basics. To use a so called &amp;quot;preseed&amp;quot; file it is good to know what it is. The Debian installation is done with the &amp;quot;Debian Installer&amp;quot;, short d-i. This d-i normally is a ncurses based console application that asks you some questions about your timezone, your partition setup, your network and so on. All this questions could be answered trough a preseed file. In this file some or all questions could be answered.&lt;br /&gt;
&lt;br /&gt;
Now it is good to know that if you do not answer a question or if a question pops up which is not in the preseed file, the d-i waits until you give a right answer. So it is a really good thing because you could leave something open and use the same preseed file for different hardware boxes e.g. one hardware has one network interface, another hardware has four network interfaces.&lt;br /&gt;
&lt;br /&gt;
Also it is good to know that you can use the preseed file to answer questions from any Debian package which is using the debconf interface, for example postfix.&lt;br /&gt;
&lt;br /&gt;
===How to start the preseed setup===&lt;br /&gt;
&lt;br /&gt;
Simply download the Netinstall CD from a Debian mirror put it in your cdrom-drive and boot the server. After booting from the CD you should see the Debian Grub Boot menu. In this menu you should select the &amp;quot;Advanced Option&amp;quot; and in the following menu place your cursor on &amp;quot;Automated install&amp;quot; - '''but do not press enter!'''&lt;br /&gt;
&lt;br /&gt;
You have to edit this boot menu entry by pressing the '''TAB''' key. Now you can append the '''URL''' option to the end of this boot line. Now press enter and continue the setup. Here is an example and a screen shot.&lt;br /&gt;
&lt;br /&gt;
 URL=http://yourserver:yourport/yourpreseedfile&lt;br /&gt;
&lt;br /&gt;
[[Image:Notbuu_1_preseed.png|200px|thumb|Grub menu screen]]&lt;br /&gt;
&lt;br /&gt;
As an example here is our preseed file:&lt;br /&gt;
&lt;br /&gt;
===During the preseed setup===&lt;br /&gt;
&lt;br /&gt;
If the d-i faces a question where it finds no answer in the preseed file it will hold until you answer the question. The d-i will not cancel the installation process.&lt;br /&gt;
&lt;br /&gt;
This is an interesting feature because you could use one file for different hardware setups. For example, if you have not configured that the d-i always uses the eth0 device during setup and there is more then one network card in your hardware, the d-i will wait until you choose one device. &lt;br /&gt;
&lt;br /&gt;
[[Image:Notbuu_2_preseed.png|200px|thumb|d-i wait for answer]]&lt;br /&gt;
&lt;br /&gt;
====Additional informations====&lt;br /&gt;
&lt;br /&gt;
At our site we use different preseed files for different purposes. As example one preseed for VMWare (Guest) servers etc...&lt;br /&gt;
All our preseed files are placed on a webserver but you should know that it is also possible to integrate the preseed process into a self made Debian installation medium.&lt;br /&gt;
&lt;br /&gt;
==The apt-proxy==&lt;br /&gt;
&lt;br /&gt;
The Debian Netinstall CD covers only a minimal system. So if you need more packages like rsync or others you have to connect to the internet. Without choosing a Debian mirror during the setup, the setup could not continue. If you use Debian OpenVZ Servers and Debian based Virtual Private Server at your site, you should use an apt-proxy to cache the downloaded packages. After the first setup this will speed up your installation time by factors!&lt;br /&gt;
&lt;br /&gt;
The apt-proxy setup is as easy as 1-2-3 go.&lt;br /&gt;
&lt;br /&gt;
Here is the preseed file, please note that I have removed the comments but I make some explanations for clearer understanding:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
d-i debian-installer/locale string en_US.UTF8&lt;br /&gt;
d-i console-keymaps-at/keymap select de-latin1-nodeadkeys&lt;br /&gt;
d-i netcfg/choose_interface select auto&lt;br /&gt;
d-i netcfg/dhcp_timeout string 60&lt;br /&gt;
d-i netcfg/get_hostname string unassigned-hostname&lt;br /&gt;
d-i netcfg/get_domain string unassigned-domain&lt;br /&gt;
d-i netcfg/wireless_wep string&lt;br /&gt;
d-i mirror/country string enter information manually&lt;br /&gt;
&lt;br /&gt;
#This is our APT-PROXY address&lt;br /&gt;
d-i mirror/http/hostname string youraptproxy:9999&lt;br /&gt;
&lt;br /&gt;
d-i mirror/http/directory string /debian&lt;br /&gt;
d-i mirror/suite string stable&lt;br /&gt;
d-i clock-setup/ntp boolean true&lt;br /&gt;
&lt;br /&gt;
#NTP Server&lt;br /&gt;
d-i clock-setup/ntp-server string yourtimeserver&lt;br /&gt;
&lt;br /&gt;
#The partition setup, be careful!&lt;br /&gt;
#By default the OpenVZ debian packages are using /var/lib/vz&lt;br /&gt;
d-i partman-auto/method string lvm&lt;br /&gt;
d-i partman-auto/purge_lvm_from_device boolean true&lt;br /&gt;
d-i partman-lvm/confirm boolean true&lt;br /&gt;
d-i partman-auto/expert_recipe string                         \&lt;br /&gt;
      boot-root ::                                            \&lt;br /&gt;
              150 150 150 ext3                                \&lt;br /&gt;
                      $primary{ } $bootable{ }                \&lt;br /&gt;
                      method{ format } format{ }              \&lt;br /&gt;
                      use_filesystem{ } filesystem{ ext3 }    \&lt;br /&gt;
                      mountpoint{ /boot }                     \&lt;br /&gt;
              .                                               \&lt;br /&gt;
              5120 5120 5120 ext3                             \&lt;br /&gt;
                      $primary{ } method{ format } format{ }  \&lt;br /&gt;
                      use_filesystem{ } filesystem{ ext3 }    \&lt;br /&gt;
                      mountpoint{ / }                         \&lt;br /&gt;
              .                                               \&lt;br /&gt;
              500 10000 1000000000 ext3                       \&lt;br /&gt;
                      method{ format } format{ } $lvmok{ }    \&lt;br /&gt;
                      use_filesystem{ } filesystem{ ext3 }    \&lt;br /&gt;
                      mountpoint{ /var }                      \&lt;br /&gt;
              .                                               \&lt;br /&gt;
              4096 4096 4096 linux-swap                       \&lt;br /&gt;
                      method{ swap } format{ } $lvmok { }     \&lt;br /&gt;
              .&lt;br /&gt;
d-i partman/confirm_write_new_label boolean true&lt;br /&gt;
d-i partman/choose_partition \&lt;br /&gt;
       select Finish partitioning and write changes to disk&lt;br /&gt;
d-i partman/confirm boolean true&lt;br /&gt;
d-i clock-setup/utc boolean true&lt;br /&gt;
d-i time/zone string Europe/Vienna&lt;br /&gt;
d-i apt-setup/non-free boolean true&lt;br /&gt;
d-i apt-setup/contrib boolean true&lt;br /&gt;
d-i apt-setup/security_host youraptproxy:9999&lt;br /&gt;
&lt;br /&gt;
#Our private internal repository for some packages&lt;br /&gt;
d-i apt-setup/local0/repository string \&lt;br /&gt;
       http://yourprivaterepository:10000/debian hns stable&lt;br /&gt;
d-i apt-setup/local0/key string http://yourprivaterepository:10000/PublicKey&lt;br /&gt;
d-i passwd/make-user boolean false&lt;br /&gt;
&lt;br /&gt;
#The encrypted root password (this is only an example :) )&lt;br /&gt;
d-i passwd/root-password-crypted password $1$v4rfe7wv$gEkbCLxCPhKaj92s.uJbD1&lt;br /&gt;
d-i grub-installer/only_debian boolean true&lt;br /&gt;
d-i grub-installer/with_other_os boolean true&lt;br /&gt;
tasksel tasksel/first multiselect standard&lt;br /&gt;
&lt;br /&gt;
#Additional base packages&lt;br /&gt;
d-i pkgsel/include string openssh-server build-essential vim snmpd lib32z1-dev rsync ntp ntpdate&lt;br /&gt;
d-i finish-install/reboot_in_progress note&lt;br /&gt;
d-i cdrom-detect/eject boolean false&lt;br /&gt;
xserver-xorg xserver-xorg/autodetect_monitor boolean true&lt;br /&gt;
xserver-xorg xserver-xorg/config/monitor/selection-method \&lt;br /&gt;
       select medium&lt;br /&gt;
xserver-xorg xserver-xorg/config/monitor/mode-list \&lt;br /&gt;
       select 1024x768 @ 60 Hz&lt;br /&gt;
&lt;br /&gt;
#Packages that gets installed AFTER the base installation&lt;br /&gt;
#hns* packages are build by our own to fasten the setup and management&lt;br /&gt;
d-i preseed/late_command string apt-install hp-health hp-snmp-agents hpsmh \&lt;br /&gt;
  hp-smh-templates hpacucli cpqacuxe ethtool linux-headers-2.6-openvz-amd64 \&lt;br /&gt;
  linux-image-2.6-openvz-amd64 vzctl vzquota hns-zabbix-agentd hns-openvz-common \&lt;br /&gt;
  hns-openvz-ubuntu-hosting hns-puppet firmware-qlogic&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==The private Debian repository==&lt;br /&gt;
&lt;br /&gt;
In our case the private repository is an essential factor because it will provide you with a fast software roll out, replicable software and consistent system state trough a large number of setups.&lt;br /&gt;
&lt;br /&gt;
It is quite easy to setup your own repository with reprepro &amp;lt;ref&amp;gt;http://mirrorer.alioth.debian.org/&amp;lt;/ref&amp;gt; and it is really useful.&lt;br /&gt;
&lt;br /&gt;
As you can see in the preseed file we have a lot of this packages in our repository. Some examples:&lt;br /&gt;
&lt;br /&gt;
*hns-zabbix-agentd&lt;br /&gt;
:is used for the automated installation of the Zabbix System Monitoring Agent.&amp;lt;ref&amp;gt;http://www.zabbix.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
*hns-openvz-common&lt;br /&gt;
:creates a backup cronjob and installs a backup script&lt;br /&gt;
:installs a set of scripts for Zabbix monitoring and therefore depends on the hns-zabbix-agentd package&lt;br /&gt;
*hns-openvz-ubuntu-hosting&lt;br /&gt;
:installs our pre-created Ubuntu&amp;lt;ref&amp;gt;http://www.ubuntu.com/&amp;lt;/ref&amp;gt; template for automated guest-installation&lt;br /&gt;
*hns-puppet&lt;br /&gt;
:installs the PuppetMaster client&lt;br /&gt;
&lt;br /&gt;
==The Puppet Master configuration management==&lt;br /&gt;
&lt;br /&gt;
If your preseeded setup was successful you have to configure your fresh server to fit your expectations. At our site we have ten OpenVZ servers in different countries and it is really important that they have the same configuration.&lt;br /&gt;
&lt;br /&gt;
To make life easier we decided to use a configuration management like cfengine&amp;lt;ref&amp;gt;http://www.cfengine.org/&amp;lt;/ref&amp;gt; but not as complex in setup and management. We found our solution in Puppet Master.&lt;br /&gt;
&lt;br /&gt;
The only dependency Puppet Master has is Ruby. This should be installable on every distribution in minutes.&lt;br /&gt;
&lt;br /&gt;
After the installation you have to configure the Puppet Master to do things. Typically this means accepting the public private key pair and doing some configuration stuff. At our site we use Puppet Master to manage an installation of about 100 servers.&lt;br /&gt;
&lt;br /&gt;
One thing it does is to change the sysctl.conf file.&lt;br /&gt;
&lt;br /&gt;
To get a feeling for it here is an configuration example (only OpenVZ server hosts):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# ALL----- OPENVZ&lt;br /&gt;
node &amp;quot;yourserver1.yourdns.com&amp;quot;, &amp;quot;yourserver2.yourdns.com&amp;quot;, &amp;quot;yourserver3.yourdns.com&amp;quot;, &amp;quot;yourserver4.yourdns.com&amp;quot;, &amp;quot;yourserver5.yourdns.com&amp;quot;, &amp;quot;yourserver6.yourdns.com&amp;quot;, &amp;quot;yourserver7.yourdns.com&amp;quot;{&lt;br /&gt;
    file { &amp;quot;/etc/aliases&amp;quot;:&lt;br /&gt;
        mode =&amp;gt; 644,&lt;br /&gt;
        owner =&amp;gt; root,&lt;br /&gt;
        group =&amp;gt; root,&lt;br /&gt;
        source =&amp;gt; &amp;quot;puppet://yourpuppetmaster/files/openvz-hosts/etc/aliases&amp;quot;,&lt;br /&gt;
    }&lt;br /&gt;
    exec { &amp;quot;subscribe-newaliases&amp;quot;:&lt;br /&gt;
        command =&amp;gt; &amp;quot;/usr/bin/newaliases &amp;amp;&amp;amp; /bin/echo NEALIASSES&amp;quot;,&lt;br /&gt;
        subscribe =&amp;gt; File[&amp;quot;/etc/aliases&amp;quot;],&lt;br /&gt;
        refreshonly =&amp;gt; true,&lt;br /&gt;
        logoutput =&amp;gt; true&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    file { &amp;quot;/etc/apt/sources.list&amp;quot;:&lt;br /&gt;
        mode =&amp;gt; 644,&lt;br /&gt;
        owner =&amp;gt; root,&lt;br /&gt;
        group =&amp;gt; root,&lt;br /&gt;
        source =&amp;gt; &amp;quot;puppet://yourpuppetmaster/files/openvz-hosts/etc/apt/sources.list&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    file { &amp;quot;/root/.ssh/authorized_keys2&amp;quot;:&lt;br /&gt;
        mode =&amp;gt; 644,&lt;br /&gt;
        owner =&amp;gt; root,&lt;br /&gt;
        group =&amp;gt; root,&lt;br /&gt;
        source =&amp;gt; &amp;quot;puppet://yourpuppetmaster/files/openvz-hosts/root/authorized_keys2&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    file { &amp;quot;/etc/vim/vimrc&amp;quot;:&lt;br /&gt;
        mode =&amp;gt; 644,&lt;br /&gt;
        owner =&amp;gt; root,&lt;br /&gt;
        group =&amp;gt; root,&lt;br /&gt;
        source =&amp;gt; &amp;quot;puppet://yourpuppetmaster/files/openvz-hosts/etc/vim/vimrc&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    file { &amp;quot;/etc/vz/conf/ve-vps.10.conf-sample&amp;quot;:&lt;br /&gt;
        mode =&amp;gt; 644,&lt;br /&gt;
        owner =&amp;gt; root,&lt;br /&gt;
        group =&amp;gt; root,&lt;br /&gt;
        source =&amp;gt; &amp;quot;puppet://yourpuppetmaster/files/openvz-hosts/etc/vz/conf/ve-vps.10.conf-sample&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    file { &amp;quot;/etc/sysctl.conf&amp;quot;:&lt;br /&gt;
        mode =&amp;gt; 644,&lt;br /&gt;
        owner =&amp;gt; root,&lt;br /&gt;
        group =&amp;gt; root,&lt;br /&gt;
        source =&amp;gt; &amp;quot;puppet://yourpuppetmaster/files/openvz-hosts/etc/sysctl.conf&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    exec { subscribe-sysctl:&lt;br /&gt;
        command =&amp;gt; &amp;quot;/sbin/sysctl -p &amp;amp;&amp;amp; /bin/echo SYSCTL EXECUTED&amp;quot;,&lt;br /&gt;
        logoutput =&amp;gt; true,&lt;br /&gt;
        refreshonly =&amp;gt; true,&lt;br /&gt;
        subscribe =&amp;gt; file[&amp;quot;/etc/sysctl.conf&amp;quot;]&lt;br /&gt;
    }&lt;br /&gt;
    file { &amp;quot;/etc/ntp.conf&amp;quot;:&lt;br /&gt;
        mode =&amp;gt; 644,&lt;br /&gt;
        owner =&amp;gt; root,&lt;br /&gt;
        group =&amp;gt; root,&lt;br /&gt;
        source =&amp;gt; &amp;quot;puppet://yourpuppetmaster/files/openvz-hosts/etc/ntp.conf&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    file { &amp;quot;/root/.bashrc&amp;quot;:&lt;br /&gt;
        mode =&amp;gt; 644,&lt;br /&gt;
        owner =&amp;gt; root,&lt;br /&gt;
        group =&amp;gt; root,&lt;br /&gt;
        source =&amp;gt; &amp;quot;puppet://yourpuppetmaster/files/openvz-hosts/root/bashrc&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    file { &amp;quot;/srv/exim_config.sh&amp;quot;:&lt;br /&gt;
        mode =&amp;gt; 744,&lt;br /&gt;
        owner =&amp;gt; root,&lt;br /&gt;
        group =&amp;gt; root,&lt;br /&gt;
        source =&amp;gt; &amp;quot;puppet://yourpuppetmaster/files/openvz-hosts/srv/exim_config.sh&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    exec { subscribe-exim_config:&lt;br /&gt;
        command =&amp;gt; &amp;quot;/srv/exim_config.sh &amp;amp;&amp;amp; /usr/sbin/update-exim4.conf &amp;amp;&amp;amp; /etc/init.d/exim4 restart &amp;amp;&amp;amp; /bin/echo EXIM_CONFIG&amp;quot;,&lt;br /&gt;
        logoutput =&amp;gt; true,&lt;br /&gt;
        refreshonly =&amp;gt; true,&lt;br /&gt;
        subscribe =&amp;gt; file[&amp;quot;/srv/exim_config.sh&amp;quot;]&lt;br /&gt;
    }&lt;br /&gt;
    file { &amp;quot;/etc/default/snmpd&amp;quot;:&lt;br /&gt;
        mode =&amp;gt; 644,&lt;br /&gt;
        owner =&amp;gt; root,&lt;br /&gt;
        group =&amp;gt; root,&lt;br /&gt;
        source =&amp;gt; &amp;quot;puppet://yourpuppetmaster/files/openvz-hosts/etc/default/snmpd&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    exec { subscribe-snmpd_config:&lt;br /&gt;
        command =&amp;gt; &amp;quot;/etc/init.d/snmpd restart &amp;amp;&amp;amp; /bin/echo SNMPD_CONFIG&amp;quot;,&lt;br /&gt;
        logoutput =&amp;gt; true,&lt;br /&gt;
        refreshonly =&amp;gt; true,&lt;br /&gt;
        subscribe =&amp;gt; file[&amp;quot;/etc/default/snmpd&amp;quot;]&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Furthure information==&lt;br /&gt;
&lt;br /&gt;
For furthure information on the particular tools like APT-Proxy/Debian Repository/... we will add some documentation links!&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Boernie</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=A_managed_OpenVZ_installation&amp;diff=7432</id>
		<title>A managed OpenVZ installation</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=A_managed_OpenVZ_installation&amp;diff=7432"/>
		<updated>2009-07-21T07:39:01Z</updated>

		<summary type="html">&lt;p&gt;Boernie: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article will show a managed installation of OpenVZ based on Debian Lenny (Debian 5.0) and some other interesting software pieces like PuppetMaster. It is mainly written to show how to manage more than one OpenVZ server in a production environment.&lt;br /&gt;
&lt;br /&gt;
==Pre-Requirements==&lt;br /&gt;
&lt;br /&gt;
You should know this software, because it is used during the setup.&lt;br /&gt;
&lt;br /&gt;
If you have any further questions, please feel free to contact us.&lt;br /&gt;
&lt;br /&gt;
Software list:&lt;br /&gt;
* Debian Installer and preseed &amp;lt;ref&amp;gt;http://wiki.debian.org/DebianInstaller/Preseed&amp;lt;/ref&amp;gt;&lt;br /&gt;
* Apt-Proxy &amp;lt;ref&amp;gt;http://apt-proxy.sourceforge.net/&amp;lt;/ref&amp;gt;&lt;br /&gt;
* Private Debian repository &amp;lt;ref&amp;gt;http://mirrorer.alioth.debian.org/&amp;lt;/ref&amp;gt;&lt;br /&gt;
* Puppet Master &amp;lt;ref&amp;gt;http://reductivelabs.com/products/puppet/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==The Debian preseed setup==&lt;br /&gt;
&lt;br /&gt;
At first some basics. To use a so called &amp;quot;preseed&amp;quot; file it is good to know what it is. The Debian installation is done with the &amp;quot;Debian Installer&amp;quot;, short d-i. This d-i normally is a ncurses based console application that asks you some questions about your timezone, your partition setup, your network and so on. All this questions could be answered trough a preseed file. In this file some or all questions could be answered.&lt;br /&gt;
&lt;br /&gt;
Now it is good to know that if you do not answer a question or if a question pops up which is not in the preseed file, the d-i waits until you give a right answer. So it is a really good thing because you could leave something open and use the same preseed file for different hardware boxes e.g. one hardware has one network interface, another hardware has four network interfaces.&lt;br /&gt;
&lt;br /&gt;
Also it is good to know that you can use the preseed file to answer questions from any Debian package which is using the debconf interface, for example postfix.&lt;br /&gt;
&lt;br /&gt;
===How to start the preseed setup===&lt;br /&gt;
&lt;br /&gt;
Simply download the Netinstall CD from a Debian mirror put it in your cdrom-drive and boot the server. After booting from the CD you should see the Debian Grub Boot menu. In this menu you should select the &amp;quot;Advanced Option&amp;quot; and in the following menu place your cursor on &amp;quot;Automated install&amp;quot; - '''but do not press enter!'''&lt;br /&gt;
&lt;br /&gt;
You have to edit this boot menu entry by pressing the '''TAB''' key. Now you can append the '''URL''' option to the end of this boot line. Now press enter and continue the setup. Here is an example and a screen shot.&lt;br /&gt;
&lt;br /&gt;
 URL=http://yourserver:yourport/yourpreseedfile&lt;br /&gt;
&lt;br /&gt;
[[Image:Notbuu_1_preseed.png|200px|thumb|Grub menu screen]]&lt;br /&gt;
&lt;br /&gt;
As an example here is our preseed file:&lt;br /&gt;
&lt;br /&gt;
===During the preseed setup===&lt;br /&gt;
&lt;br /&gt;
If the d-i faces a question where it finds no answer in the preseed file it will hold until you answer the question. The d-i will not cancel the installation process.&lt;br /&gt;
&lt;br /&gt;
This is an interesting feature because you could use one file for different hardware setups. For example, if you have not configured that the d-i always uses the eth0 device during setup and there is more then one network card in your hardware, the d-i will wait until you choose one device. &lt;br /&gt;
&lt;br /&gt;
[[Image:Notbuu_2_preseed.png|200px|thumb|d-i wait for answer]]&lt;br /&gt;
&lt;br /&gt;
====Additional informations====&lt;br /&gt;
&lt;br /&gt;
At our site we use different preseed files for different purposes. As example one preseed for VMWare (Guest) servers etc...&lt;br /&gt;
All our preseed files are placed on a webserver but you should know that it is also possible to integrate the preseed process into a self made Debian installation medium.&lt;br /&gt;
&lt;br /&gt;
==The apt-proxy==&lt;br /&gt;
&lt;br /&gt;
The Debian Netinstall CD covers only a minimal system. So if you need more packages like rsync or others you have to connect to the internet. Without choosing a Debian mirror during the setup, the setup could not continue. If you use Debian OpenVZ Servers and Debian based Virtual Private Server at your site, you should use an apt-proxy to cache the downloaded packages. After the first setup this will speed up your installation time by factors!&lt;br /&gt;
&lt;br /&gt;
The apt-proxy setup is as easy as 1-2-3 go.&lt;br /&gt;
&lt;br /&gt;
Here is the preseed file, please note that I have removed the comments but I make some explanations for clearer understanding:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
d-i debian-installer/locale string en_US.UTF8&lt;br /&gt;
d-i console-keymaps-at/keymap select de-latin1-nodeadkeys&lt;br /&gt;
d-i netcfg/choose_interface select auto&lt;br /&gt;
d-i netcfg/dhcp_timeout string 60&lt;br /&gt;
d-i netcfg/get_hostname string unassigned-hostname&lt;br /&gt;
d-i netcfg/get_domain string unassigned-domain&lt;br /&gt;
d-i netcfg/wireless_wep string&lt;br /&gt;
d-i mirror/country string enter information manually&lt;br /&gt;
&lt;br /&gt;
#This is our APT-PROXY address&lt;br /&gt;
d-i mirror/http/hostname string youraptproxy:9999&lt;br /&gt;
&lt;br /&gt;
d-i mirror/http/directory string /debian&lt;br /&gt;
d-i mirror/suite string stable&lt;br /&gt;
d-i clock-setup/ntp boolean true&lt;br /&gt;
&lt;br /&gt;
#NTP Server&lt;br /&gt;
d-i clock-setup/ntp-server string yourtimeserver&lt;br /&gt;
&lt;br /&gt;
#The partition setup, be careful!&lt;br /&gt;
#By default the OpenVZ debian packages are using /var/lib/vz&lt;br /&gt;
d-i partman-auto/method string lvm&lt;br /&gt;
d-i partman-auto/purge_lvm_from_device boolean true&lt;br /&gt;
d-i partman-lvm/confirm boolean true&lt;br /&gt;
d-i partman-auto/expert_recipe string                         \&lt;br /&gt;
      boot-root ::                                            \&lt;br /&gt;
              150 150 150 ext3                                \&lt;br /&gt;
                      $primary{ } $bootable{ }                \&lt;br /&gt;
                      method{ format } format{ }              \&lt;br /&gt;
                      use_filesystem{ } filesystem{ ext3 }    \&lt;br /&gt;
                      mountpoint{ /boot }                     \&lt;br /&gt;
              .                                               \&lt;br /&gt;
              5120 5120 5120 ext3                             \&lt;br /&gt;
                      $primary{ } method{ format } format{ }  \&lt;br /&gt;
                      use_filesystem{ } filesystem{ ext3 }    \&lt;br /&gt;
                      mountpoint{ / }                         \&lt;br /&gt;
              .                                               \&lt;br /&gt;
              500 10000 1000000000 ext3                       \&lt;br /&gt;
                      method{ format } format{ } $lvmok{ }    \&lt;br /&gt;
                      use_filesystem{ } filesystem{ ext3 }    \&lt;br /&gt;
                      mountpoint{ /var }                      \&lt;br /&gt;
              .                                               \&lt;br /&gt;
              4096 4096 4096 linux-swap                       \&lt;br /&gt;
                      method{ swap } format{ } $lvmok { }     \&lt;br /&gt;
              .&lt;br /&gt;
d-i partman/confirm_write_new_label boolean true&lt;br /&gt;
d-i partman/choose_partition \&lt;br /&gt;
       select Finish partitioning and write changes to disk&lt;br /&gt;
d-i partman/confirm boolean true&lt;br /&gt;
d-i clock-setup/utc boolean true&lt;br /&gt;
d-i time/zone string Europe/Vienna&lt;br /&gt;
d-i apt-setup/non-free boolean true&lt;br /&gt;
d-i apt-setup/contrib boolean true&lt;br /&gt;
d-i apt-setup/security_host youraptproxy:9999&lt;br /&gt;
&lt;br /&gt;
#Our private internal repository for some packages&lt;br /&gt;
d-i apt-setup/local0/repository string \&lt;br /&gt;
       http://yourprivaterepository:10000/debian hns stable&lt;br /&gt;
d-i apt-setup/local0/key string http://yourprivaterepository:10000/PublicKey&lt;br /&gt;
d-i passwd/make-user boolean false&lt;br /&gt;
&lt;br /&gt;
#The encrypted root password (this is only an example :) )&lt;br /&gt;
d-i passwd/root-password-crypted password $1$v4rfe7wv$gEkbCLxCPhKaj92s.uJbD1&lt;br /&gt;
d-i grub-installer/only_debian boolean true&lt;br /&gt;
d-i grub-installer/with_other_os boolean true&lt;br /&gt;
tasksel tasksel/first multiselect standard&lt;br /&gt;
&lt;br /&gt;
#Additional base packages&lt;br /&gt;
d-i pkgsel/include string openssh-server build-essential vim snmpd lib32z1-dev rsync ntp ntpdate&lt;br /&gt;
d-i finish-install/reboot_in_progress note&lt;br /&gt;
d-i cdrom-detect/eject boolean false&lt;br /&gt;
xserver-xorg xserver-xorg/autodetect_monitor boolean true&lt;br /&gt;
xserver-xorg xserver-xorg/config/monitor/selection-method \&lt;br /&gt;
       select medium&lt;br /&gt;
xserver-xorg xserver-xorg/config/monitor/mode-list \&lt;br /&gt;
       select 1024x768 @ 60 Hz&lt;br /&gt;
&lt;br /&gt;
#Packages that gets installed AFTER the base installation&lt;br /&gt;
#hns* packages are build by our own to fasten the setup and management&lt;br /&gt;
d-i preseed/late_command string apt-install hp-health hp-snmp-agents hpsmh \&lt;br /&gt;
  hp-smh-templates hpacucli cpqacuxe ethtool linux-headers-2.6-openvz-amd64 \&lt;br /&gt;
  linux-image-2.6-openvz-amd64 vzctl vzquota hns-zabbix-agentd hns-openvz-common \&lt;br /&gt;
  hns-openvz-ubuntu-hosting hns-puppet firmware-qlogic&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==The private Debian repository==&lt;br /&gt;
&lt;br /&gt;
In our case the private repository is an essential factor because it will provide you with a fast software roll out, replicable software and consistent system state trough a large number of setups.&lt;br /&gt;
&lt;br /&gt;
It is quite easy to setup your own repository with reprepro &amp;lt;ref&amp;gt;http://mirrorer.alioth.debian.org/&amp;lt;/ref&amp;gt; and it is really useful.&lt;br /&gt;
&lt;br /&gt;
As you can see in the preseed file we have a lot of this packages in our repository. Some examples:&lt;br /&gt;
&lt;br /&gt;
*hns-zabbix-agentd&lt;br /&gt;
:is used for the automated installation of the Zabbix System Monitoring Agent.&amp;lt;ref&amp;gt;http://www.zabbix.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
*hns-openvz-common&lt;br /&gt;
:creates a backup cronjob and installs a backup script&lt;br /&gt;
:installs a set of scripts for Zabbix monitoring and therefore depends on the hns-zabbix-agentd package&lt;br /&gt;
*hns-openvz-ubuntu-hosting&lt;br /&gt;
:installs our pre-created Ubuntu&amp;lt;ref&amp;gt;http://www.ubuntu.com/&amp;lt;/ref&amp;gt; template for automated guest-installation&lt;br /&gt;
*hns-puppet&lt;br /&gt;
:installs the PuppetMaster client&lt;br /&gt;
&lt;br /&gt;
==The Puppet Master configuration management==&lt;br /&gt;
&lt;br /&gt;
If your preseeded setup was successful you have to configure your fresh server to fit your expectations. At our site we have ten OpenVZ servers in different countries and it is really important that they have the same configuration.&lt;br /&gt;
&lt;br /&gt;
To make life easier we decided to use a configuration management like cfengine&amp;lt;ref&amp;gt;http://www.cfengine.org/&amp;lt;/ref&amp;gt; but not as complex in setup and management. We found our solution in Puppet Master.&lt;br /&gt;
&lt;br /&gt;
The only dependency Puppet Master has is Ruby. This should be installable on every distribution in minutes.&lt;br /&gt;
&lt;br /&gt;
After the installation you have to configure the Puppet Master to do things. Typically this means accepting the public private key pair and doing some configuration stuff. At our site we use Puppet Master to manage an installation of about 100 servers.&lt;br /&gt;
&lt;br /&gt;
One thing it does is to change the sysctl.conf file.&lt;br /&gt;
&lt;br /&gt;
To get a feeling for it here is an configuration example (only OpenVZ server hosts):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# ALL----- OPENVZ&lt;br /&gt;
node &amp;quot;yourserver1.yourdns.com&amp;quot;, &amp;quot;yourserver2.yourdns.com&amp;quot;, &amp;quot;yourserver3.yourdns.com&amp;quot;, &amp;quot;yourserver4.yourdns.com&amp;quot;, &amp;quot;yourserver5.yourdns.com&amp;quot;, &amp;quot;yourserver6.yourdns.com&amp;quot;, &amp;quot;yourserver7.yourdns.com&amp;quot;{&lt;br /&gt;
    file { &amp;quot;/etc/aliases&amp;quot;:&lt;br /&gt;
        mode =&amp;gt; 644,&lt;br /&gt;
        owner =&amp;gt; root,&lt;br /&gt;
        group =&amp;gt; root,&lt;br /&gt;
        source =&amp;gt; &amp;quot;puppet://yourpuppetmaster/files/openvz-hosts/etc/aliases&amp;quot;,&lt;br /&gt;
    }&lt;br /&gt;
    exec { &amp;quot;subscribe-newaliases&amp;quot;:&lt;br /&gt;
        command =&amp;gt; &amp;quot;/usr/bin/newaliases &amp;amp;&amp;amp; /bin/echo NEALIASSES&amp;quot;,&lt;br /&gt;
        subscribe =&amp;gt; File[&amp;quot;/etc/aliases&amp;quot;],&lt;br /&gt;
        refreshonly =&amp;gt; true,&lt;br /&gt;
        logoutput =&amp;gt; true&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    file { &amp;quot;/etc/apt/sources.list&amp;quot;:&lt;br /&gt;
        mode =&amp;gt; 644,&lt;br /&gt;
        owner =&amp;gt; root,&lt;br /&gt;
        group =&amp;gt; root,&lt;br /&gt;
        source =&amp;gt; &amp;quot;puppet://yourpuppetmaster/files/openvz-hosts/etc/apt/sources.list&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    file { &amp;quot;/root/.ssh/authorized_keys2&amp;quot;:&lt;br /&gt;
        mode =&amp;gt; 644,&lt;br /&gt;
        owner =&amp;gt; root,&lt;br /&gt;
        group =&amp;gt; root,&lt;br /&gt;
        source =&amp;gt; &amp;quot;puppet://yourpuppetmaster/files/openvz-hosts/root/authorized_keys2&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    file { &amp;quot;/etc/vim/vimrc&amp;quot;:&lt;br /&gt;
        mode =&amp;gt; 644,&lt;br /&gt;
        owner =&amp;gt; root,&lt;br /&gt;
        group =&amp;gt; root,&lt;br /&gt;
        source =&amp;gt; &amp;quot;puppet://yourpuppetmaster/files/openvz-hosts/etc/vim/vimrc&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    file { &amp;quot;/etc/vz/conf/ve-vps.10.conf-sample&amp;quot;:&lt;br /&gt;
        mode =&amp;gt; 644,&lt;br /&gt;
        owner =&amp;gt; root,&lt;br /&gt;
        group =&amp;gt; root,&lt;br /&gt;
        source =&amp;gt; &amp;quot;puppet://yourpuppetmaster/files/openvz-hosts/etc/vz/conf/ve-vps.10.conf-sample&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    file { &amp;quot;/etc/sysctl.conf&amp;quot;:&lt;br /&gt;
        mode =&amp;gt; 644,&lt;br /&gt;
        owner =&amp;gt; root,&lt;br /&gt;
        group =&amp;gt; root,&lt;br /&gt;
        source =&amp;gt; &amp;quot;puppet://yourpuppetmaster/files/openvz-hosts/etc/sysctl.conf&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    exec { subscribe-sysctl:&lt;br /&gt;
        command =&amp;gt; &amp;quot;/sbin/sysctl -p &amp;amp;&amp;amp; /bin/echo SYSCTL EXECUTED&amp;quot;,&lt;br /&gt;
        logoutput =&amp;gt; true,&lt;br /&gt;
        refreshonly =&amp;gt; true,&lt;br /&gt;
        subscribe =&amp;gt; file[&amp;quot;/etc/sysctl.conf&amp;quot;]&lt;br /&gt;
    }&lt;br /&gt;
    file { &amp;quot;/etc/ntp.conf&amp;quot;:&lt;br /&gt;
        mode =&amp;gt; 644,&lt;br /&gt;
        owner =&amp;gt; root,&lt;br /&gt;
        group =&amp;gt; root,&lt;br /&gt;
        source =&amp;gt; &amp;quot;puppet://yourpuppetmaster/files/openvz-hosts/etc/ntp.conf&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    file { &amp;quot;/root/.bashrc&amp;quot;:&lt;br /&gt;
        mode =&amp;gt; 644,&lt;br /&gt;
        owner =&amp;gt; root,&lt;br /&gt;
        group =&amp;gt; root,&lt;br /&gt;
        source =&amp;gt; &amp;quot;puppet://yourpuppetmaster/files/openvz-hosts/root/bashrc&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    file { &amp;quot;/srv/exim_config.sh&amp;quot;:&lt;br /&gt;
        mode =&amp;gt; 744,&lt;br /&gt;
        owner =&amp;gt; root,&lt;br /&gt;
        group =&amp;gt; root,&lt;br /&gt;
        source =&amp;gt; &amp;quot;puppet://yourpuppetmaster/files/openvz-hosts/srv/exim_config.sh&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    exec { subscribe-exim_config:&lt;br /&gt;
        command =&amp;gt; &amp;quot;/srv/exim_config.sh &amp;amp;&amp;amp; /usr/sbin/update-exim4.conf &amp;amp;&amp;amp; /etc/init.d/exim4 restart &amp;amp;&amp;amp; /bin/echo EXIM_CONFIG&amp;quot;,&lt;br /&gt;
        logoutput =&amp;gt; true,&lt;br /&gt;
        refreshonly =&amp;gt; true,&lt;br /&gt;
        subscribe =&amp;gt; file[&amp;quot;/srv/exim_config.sh&amp;quot;]&lt;br /&gt;
    }&lt;br /&gt;
    file { &amp;quot;/etc/default/snmpd&amp;quot;:&lt;br /&gt;
        mode =&amp;gt; 644,&lt;br /&gt;
        owner =&amp;gt; root,&lt;br /&gt;
        group =&amp;gt; root,&lt;br /&gt;
        source =&amp;gt; &amp;quot;puppet://yourpuppetmaster/files/openvz-hosts/etc/default/snmpd&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    exec { subscribe-snmpd_config:&lt;br /&gt;
        command =&amp;gt; &amp;quot;/etc/init.d/snmpd restart &amp;amp;&amp;amp; /bin/echo SNMPD_CONFIG&amp;quot;,&lt;br /&gt;
        logoutput =&amp;gt; true,&lt;br /&gt;
        refreshonly =&amp;gt; true,&lt;br /&gt;
        subscribe =&amp;gt; file[&amp;quot;/etc/default/snmpd&amp;quot;]&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Boernie</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=A_managed_OpenVZ_installation&amp;diff=7431</id>
		<title>A managed OpenVZ installation</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=A_managed_OpenVZ_installation&amp;diff=7431"/>
		<updated>2009-07-21T07:31:03Z</updated>

		<summary type="html">&lt;p&gt;Boernie: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article will show a managed installation of OpenVZ based on Debian Lenny (Debian 5.0) and some other interesting software pieces like PuppetMaster. It is mainly written to show how to manage more than one OpenVZ server in a production environment.&lt;br /&gt;
&lt;br /&gt;
==Pre-Requirements==&lt;br /&gt;
&lt;br /&gt;
You should know this software, because it is used during the setup.&lt;br /&gt;
&lt;br /&gt;
If you have any further questions, please feel free to contact us.&lt;br /&gt;
&lt;br /&gt;
Software list:&lt;br /&gt;
* Debian Installer and preseed &amp;lt;ref&amp;gt;http://wiki.debian.org/DebianInstaller/Preseed&amp;lt;/ref&amp;gt;&lt;br /&gt;
* Apt-Proxy &amp;lt;ref&amp;gt;http://apt-proxy.sourceforge.net/&amp;lt;/ref&amp;gt;&lt;br /&gt;
* Private Debian repository &amp;lt;ref&amp;gt;http://mirrorer.alioth.debian.org/&amp;lt;/ref&amp;gt;&lt;br /&gt;
* Puppet Master &amp;lt;ref&amp;gt;http://reductivelabs.com/products/puppet/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==The Debian preseed setup==&lt;br /&gt;
&lt;br /&gt;
At first some basics. To use a so called &amp;quot;preseed&amp;quot; file it is good to know what it is. The Debian installation is done with the &amp;quot;Debian Installer&amp;quot;, short d-i. This d-i normally is a ncurses based console application that asks you some questions about your timezone, your partition setup, your network and so on. All this questions could be answered trough a preseed file. In this file some or all questions could be answered.&lt;br /&gt;
&lt;br /&gt;
Now it is good to know that if you do not answer a question or if a question pops up which is not in the preseed file, the d-i waits until you give a right answer. So it is a really good thing because you could leave something open and use the same preseed file for different hardware boxes e.g. one hardware has one network interface, another hardware has four network interfaces.&lt;br /&gt;
&lt;br /&gt;
Also it is good to know that you can use the preseed file to answer questions from any Debian package which is using the debconf interface, for example postfix.&lt;br /&gt;
&lt;br /&gt;
===How to start the preseed setup===&lt;br /&gt;
&lt;br /&gt;
Simply download the Netinstall CD from a Debian mirror put it in your cdrom-drive and boot the server. After booting from the CD you should see the Debian Grub Boot menu. In this menu you should select the &amp;quot;Advanced Option&amp;quot; and in the following menu place your cursor on &amp;quot;Automated install&amp;quot; - '''but do not press enter!'''&lt;br /&gt;
&lt;br /&gt;
You have to edit this boot menu entry by pressing the '''TAB''' key. Now you can append the '''URL''' option to the end of this boot line. Now press enter and continue the setup. Here is an example and a screen shot.&lt;br /&gt;
&lt;br /&gt;
 URL=http://yourserver:yourport/yourpreseedfile&lt;br /&gt;
&lt;br /&gt;
[[Image:Notbuu_1_preseed.png|200px|thumb|Grub menu screen]]&lt;br /&gt;
&lt;br /&gt;
As an example here is our preseed file:&lt;br /&gt;
&lt;br /&gt;
===During the preseed setup===&lt;br /&gt;
&lt;br /&gt;
If the d-i faces a question where it finds no answer in the preseed file it will hold until you answer the question. The d-i will not cancel the installation process.&lt;br /&gt;
&lt;br /&gt;
This is an interesting feature because you could use one file for different hardware setups. For example, if you have not configured that the d-i always uses the eth0 device during setup and there is more then one network card in your hardware, the d-i will wait until you choose one device. &lt;br /&gt;
&lt;br /&gt;
[[Image:Notbuu_2_preseed.png|200px|thumb|d-i wait for answer]]&lt;br /&gt;
&lt;br /&gt;
====Additional informations====&lt;br /&gt;
&lt;br /&gt;
At our site we use different preseed files for different purposes. As example one preseed for VMWare (Guest) servers etc...&lt;br /&gt;
All our preseed files are placed on a webserver but you should know that it is also possible to integrate the preseed process into a self made Debian installation medium.&lt;br /&gt;
&lt;br /&gt;
==The apt-proxy==&lt;br /&gt;
&lt;br /&gt;
The Debian Netinstall CD covers only a minimal system. So if you need more packages like rsync or others you have to connect to the internet. Without choosing a Debian mirror during the setup, the setup could not continue. If you use Debian OpenVZ Servers and Debian based Virtual Private Server at your site, you should use an apt-proxy to cache the downloaded packages. After the first setup this will speed up your installation time by factors!&lt;br /&gt;
&lt;br /&gt;
The apt-proxy setup is as easy as 1-2-3 go.&lt;br /&gt;
&lt;br /&gt;
Here is the preseed file, please note that I have removed the comments but I make some explanations for clearer understanding:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
d-i debian-installer/locale string en_US.UTF8&lt;br /&gt;
d-i console-keymaps-at/keymap select de-latin1-nodeadkeys&lt;br /&gt;
d-i netcfg/choose_interface select auto&lt;br /&gt;
d-i netcfg/dhcp_timeout string 60&lt;br /&gt;
d-i netcfg/get_hostname string unassigned-hostname&lt;br /&gt;
d-i netcfg/get_domain string unassigned-domain&lt;br /&gt;
d-i netcfg/wireless_wep string&lt;br /&gt;
d-i mirror/country string enter information manually&lt;br /&gt;
&lt;br /&gt;
#This is our APT-PROXY address&lt;br /&gt;
d-i mirror/http/hostname string youraptproxy:9999&lt;br /&gt;
&lt;br /&gt;
d-i mirror/http/directory string /debian&lt;br /&gt;
d-i mirror/suite string stable&lt;br /&gt;
d-i clock-setup/ntp boolean true&lt;br /&gt;
&lt;br /&gt;
#NTP Server&lt;br /&gt;
d-i clock-setup/ntp-server string yourtimeserver&lt;br /&gt;
&lt;br /&gt;
#The partition setup, be careful!&lt;br /&gt;
#By default the OpenVZ debian packages are using /var/lib/vz&lt;br /&gt;
d-i partman-auto/method string lvm&lt;br /&gt;
d-i partman-auto/purge_lvm_from_device boolean true&lt;br /&gt;
d-i partman-lvm/confirm boolean true&lt;br /&gt;
d-i partman-auto/expert_recipe string                         \&lt;br /&gt;
      boot-root ::                                            \&lt;br /&gt;
              150 150 150 ext3                                \&lt;br /&gt;
                      $primary{ } $bootable{ }                \&lt;br /&gt;
                      method{ format } format{ }              \&lt;br /&gt;
                      use_filesystem{ } filesystem{ ext3 }    \&lt;br /&gt;
                      mountpoint{ /boot }                     \&lt;br /&gt;
              .                                               \&lt;br /&gt;
              5120 5120 5120 ext3                             \&lt;br /&gt;
                      $primary{ } method{ format } format{ }  \&lt;br /&gt;
                      use_filesystem{ } filesystem{ ext3 }    \&lt;br /&gt;
                      mountpoint{ / }                         \&lt;br /&gt;
              .                                               \&lt;br /&gt;
              500 10000 1000000000 ext3                       \&lt;br /&gt;
                      method{ format } format{ } $lvmok{ }    \&lt;br /&gt;
                      use_filesystem{ } filesystem{ ext3 }    \&lt;br /&gt;
                      mountpoint{ /var }                      \&lt;br /&gt;
              .                                               \&lt;br /&gt;
              4096 4096 4096 linux-swap                       \&lt;br /&gt;
                      method{ swap } format{ } $lvmok { }     \&lt;br /&gt;
              .&lt;br /&gt;
d-i partman/confirm_write_new_label boolean true&lt;br /&gt;
d-i partman/choose_partition \&lt;br /&gt;
       select Finish partitioning and write changes to disk&lt;br /&gt;
d-i partman/confirm boolean true&lt;br /&gt;
d-i clock-setup/utc boolean true&lt;br /&gt;
d-i time/zone string Europe/Vienna&lt;br /&gt;
d-i apt-setup/non-free boolean true&lt;br /&gt;
d-i apt-setup/contrib boolean true&lt;br /&gt;
d-i apt-setup/security_host youraptproxy:9999&lt;br /&gt;
&lt;br /&gt;
#Our private internal repository for some packages&lt;br /&gt;
d-i apt-setup/local0/repository string \&lt;br /&gt;
       http://yourprivaterepository:10000/debian hns stable&lt;br /&gt;
d-i apt-setup/local0/key string http://yourprivaterepository:10000/PublicKey&lt;br /&gt;
d-i passwd/make-user boolean false&lt;br /&gt;
&lt;br /&gt;
#The encrypted root password (this is only an example :) )&lt;br /&gt;
d-i passwd/root-password-crypted password $1$v4rfe7wv$gEkbCLxCPhKaj92s.uJbD1&lt;br /&gt;
d-i grub-installer/only_debian boolean true&lt;br /&gt;
d-i grub-installer/with_other_os boolean true&lt;br /&gt;
tasksel tasksel/first multiselect standard&lt;br /&gt;
&lt;br /&gt;
#Additional base packages&lt;br /&gt;
d-i pkgsel/include string openssh-server build-essential vim snmpd lib32z1-dev rsync ntp ntpdate&lt;br /&gt;
d-i finish-install/reboot_in_progress note&lt;br /&gt;
d-i cdrom-detect/eject boolean false&lt;br /&gt;
xserver-xorg xserver-xorg/autodetect_monitor boolean true&lt;br /&gt;
xserver-xorg xserver-xorg/config/monitor/selection-method \&lt;br /&gt;
       select medium&lt;br /&gt;
xserver-xorg xserver-xorg/config/monitor/mode-list \&lt;br /&gt;
       select 1024x768 @ 60 Hz&lt;br /&gt;
&lt;br /&gt;
#Packages that gets installed AFTER the base installation&lt;br /&gt;
#hns* packages are build by our own to fasten the setup and management&lt;br /&gt;
d-i preseed/late_command string apt-install hp-health hp-snmp-agents hpsmh \&lt;br /&gt;
  hp-smh-templates hpacucli cpqacuxe ethtool linux-headers-2.6-openvz-amd64 \&lt;br /&gt;
  linux-image-2.6-openvz-amd64 vzctl vzquota hns-zabbix-agentd hns-openvz-common \&lt;br /&gt;
  hns-openvz-ubuntu-hosting hns-puppet firmware-qlogic&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==The private Debian repository==&lt;br /&gt;
&lt;br /&gt;
In our case the private repository is an essential factor because it will provide you with a fast software roll out, replicable software and consistent system state trough a large number of setups.&lt;br /&gt;
&lt;br /&gt;
It is quite easy to setup your own repository with reprepro &amp;lt;ref&amp;gt;http://mirrorer.alioth.debian.org/&amp;lt;/ref&amp;gt; and it is really useful.&lt;br /&gt;
&lt;br /&gt;
As you can see in the preseed file we have a lot of this packages in our repository. Some examples:&lt;br /&gt;
&lt;br /&gt;
*hns-zabbix-agentd&lt;br /&gt;
:is used for the automated installation of the Zabbix System Monitoring Agent.&amp;lt;ref&amp;gt;http://www.zabbix.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
*hns-openvz-common&lt;br /&gt;
:creates a backup cronjob and installs a backup script&lt;br /&gt;
:installs a set of scripts for Zabbix monitoring&lt;br /&gt;
*hns-openvz-ubuntu-hosting&lt;br /&gt;
:installs our pre-created Ubuntu&amp;lt;ref&amp;gt;http://www.ubuntu.com/&amp;lt;/ref&amp;gt; template&lt;br /&gt;
*hns-puppet&lt;br /&gt;
:installs the PuppetMaster client&lt;br /&gt;
&lt;br /&gt;
==The Puppet Master configuration management==&lt;br /&gt;
&lt;br /&gt;
If your preseeded setup was successful you have to configure your fresh server to fit your expectations. At our site we have ten OpenVZ servers in different countries and is really important that they have the same configuration.&lt;br /&gt;
&lt;br /&gt;
To make life easier we decided to use a configuration management like cfengine&amp;lt;ref&amp;gt;http://www.cfengine.org/&amp;lt;/ref&amp;gt; but not as complex in setup and management. We found our solution in Puppet Master.&lt;br /&gt;
&lt;br /&gt;
The only dependency Puppet Master has is Ruby. This should be installable on every distribution in minutes.&lt;br /&gt;
&lt;br /&gt;
After the installation you have to configure the Puppet Master to do things. Typically this means accepting the public private key pair and doing some configuration stuff. At our site use Puppet Master to manage an installation of about 100 servers.&lt;br /&gt;
&lt;br /&gt;
One thing it does is to change the sysctl.conf file.&lt;br /&gt;
&lt;br /&gt;
To get a feeling for it here is an configuration example (only OpenVZ server hosts):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# ALL----- OPENVZ&lt;br /&gt;
node &amp;quot;yourserver1.yourdns.com&amp;quot;, &amp;quot;yourserver2.yourdns.com&amp;quot;, &amp;quot;yourserver3.yourdns.com&amp;quot;, &amp;quot;yourserver4.yourdns.com&amp;quot;, &amp;quot;yourserver5.yourdns.com&amp;quot;, &amp;quot;yourserver6.yourdns.com&amp;quot;, &amp;quot;yourserver7.yourdns.com&amp;quot;{&lt;br /&gt;
    file { &amp;quot;/etc/aliases&amp;quot;:&lt;br /&gt;
        mode =&amp;gt; 644,&lt;br /&gt;
        owner =&amp;gt; root,&lt;br /&gt;
        group =&amp;gt; root,&lt;br /&gt;
        source =&amp;gt; &amp;quot;puppet://yourpuppetmaster/files/openvz-hosts/etc/aliases&amp;quot;,&lt;br /&gt;
    }&lt;br /&gt;
    exec { &amp;quot;subscribe-newaliases&amp;quot;:&lt;br /&gt;
        command =&amp;gt; &amp;quot;/usr/bin/newaliases &amp;amp;&amp;amp; /bin/echo NEALIASSES&amp;quot;,&lt;br /&gt;
        subscribe =&amp;gt; File[&amp;quot;/etc/aliases&amp;quot;],&lt;br /&gt;
        refreshonly =&amp;gt; true,&lt;br /&gt;
        logoutput =&amp;gt; true&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    file { &amp;quot;/etc/apt/sources.list&amp;quot;:&lt;br /&gt;
        mode =&amp;gt; 644,&lt;br /&gt;
        owner =&amp;gt; root,&lt;br /&gt;
        group =&amp;gt; root,&lt;br /&gt;
        source =&amp;gt; &amp;quot;puppet://yourpuppetmaster/files/openvz-hosts/etc/apt/sources.list&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    file { &amp;quot;/root/.ssh/authorized_keys2&amp;quot;:&lt;br /&gt;
        mode =&amp;gt; 644,&lt;br /&gt;
        owner =&amp;gt; root,&lt;br /&gt;
        group =&amp;gt; root,&lt;br /&gt;
        source =&amp;gt; &amp;quot;puppet://yourpuppetmaster/files/openvz-hosts/root/authorized_keys2&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    file { &amp;quot;/etc/vim/vimrc&amp;quot;:&lt;br /&gt;
        mode =&amp;gt; 644,&lt;br /&gt;
        owner =&amp;gt; root,&lt;br /&gt;
        group =&amp;gt; root,&lt;br /&gt;
        source =&amp;gt; &amp;quot;puppet://yourpuppetmaster/files/openvz-hosts/etc/vim/vimrc&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    file { &amp;quot;/etc/vz/conf/ve-vps.10.conf-sample&amp;quot;:&lt;br /&gt;
        mode =&amp;gt; 644,&lt;br /&gt;
        owner =&amp;gt; root,&lt;br /&gt;
        group =&amp;gt; root,&lt;br /&gt;
        source =&amp;gt; &amp;quot;puppet://yourpuppetmaster/files/openvz-hosts/etc/vz/conf/ve-vps.10.conf-sample&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    file { &amp;quot;/etc/sysctl.conf&amp;quot;:&lt;br /&gt;
        mode =&amp;gt; 644,&lt;br /&gt;
        owner =&amp;gt; root,&lt;br /&gt;
        group =&amp;gt; root,&lt;br /&gt;
        source =&amp;gt; &amp;quot;puppet://yourpuppetmaster/files/openvz-hosts/etc/sysctl.conf&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    exec { subscribe-sysctl:&lt;br /&gt;
        command =&amp;gt; &amp;quot;/sbin/sysctl -p &amp;amp;&amp;amp; /bin/echo SYSCTL EXECUTED&amp;quot;,&lt;br /&gt;
        logoutput =&amp;gt; true,&lt;br /&gt;
        refreshonly =&amp;gt; true,&lt;br /&gt;
        subscribe =&amp;gt; file[&amp;quot;/etc/sysctl.conf&amp;quot;]&lt;br /&gt;
    }&lt;br /&gt;
    file { &amp;quot;/etc/ntp.conf&amp;quot;:&lt;br /&gt;
        mode =&amp;gt; 644,&lt;br /&gt;
        owner =&amp;gt; root,&lt;br /&gt;
        group =&amp;gt; root,&lt;br /&gt;
        source =&amp;gt; &amp;quot;puppet://yourpuppetmaster/files/openvz-hosts/etc/ntp.conf&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    file { &amp;quot;/root/.bashrc&amp;quot;:&lt;br /&gt;
        mode =&amp;gt; 644,&lt;br /&gt;
        owner =&amp;gt; root,&lt;br /&gt;
        group =&amp;gt; root,&lt;br /&gt;
        source =&amp;gt; &amp;quot;puppet://yourpuppetmaster/files/openvz-hosts/root/bashrc&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    file { &amp;quot;/srv/exim_config.sh&amp;quot;:&lt;br /&gt;
        mode =&amp;gt; 744,&lt;br /&gt;
        owner =&amp;gt; root,&lt;br /&gt;
        group =&amp;gt; root,&lt;br /&gt;
        source =&amp;gt; &amp;quot;puppet://yourpuppetmaster/files/openvz-hosts/srv/exim_config.sh&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    exec { subscribe-exim_config:&lt;br /&gt;
        command =&amp;gt; &amp;quot;/srv/exim_config.sh &amp;amp;&amp;amp; /usr/sbin/update-exim4.conf &amp;amp;&amp;amp; /etc/init.d/exim4 restart &amp;amp;&amp;amp; /bin/echo EXIM_CONFIG&amp;quot;,&lt;br /&gt;
        logoutput =&amp;gt; true,&lt;br /&gt;
        refreshonly =&amp;gt; true,&lt;br /&gt;
        subscribe =&amp;gt; file[&amp;quot;/srv/exim_config.sh&amp;quot;]&lt;br /&gt;
    }&lt;br /&gt;
    file { &amp;quot;/etc/default/snmpd&amp;quot;:&lt;br /&gt;
        mode =&amp;gt; 644,&lt;br /&gt;
        owner =&amp;gt; root,&lt;br /&gt;
        group =&amp;gt; root,&lt;br /&gt;
        source =&amp;gt; &amp;quot;puppet://yourpuppetmaster/files/openvz-hosts/etc/default/snmpd&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    exec { subscribe-snmpd_config:&lt;br /&gt;
        command =&amp;gt; &amp;quot;/etc/init.d/snmpd restart &amp;amp;&amp;amp; /bin/echo SNMPD_CONFIG&amp;quot;,&lt;br /&gt;
        logoutput =&amp;gt; true,&lt;br /&gt;
        refreshonly =&amp;gt; true,&lt;br /&gt;
        subscribe =&amp;gt; file[&amp;quot;/etc/default/snmpd&amp;quot;]&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Boernie</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=A_managed_OpenVZ_installation&amp;diff=7430</id>
		<title>A managed OpenVZ installation</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=A_managed_OpenVZ_installation&amp;diff=7430"/>
		<updated>2009-07-21T07:29:23Z</updated>

		<summary type="html">&lt;p&gt;Boernie: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article will show a managed installation of OpenVZ based on Debian Lenny (Debian 5.0) and some other interesting software pieces like PuppetMaster. It is mainly written to show how to manage more than one OpenVZ server in a production environment.&lt;br /&gt;
&lt;br /&gt;
==Pre-Requirements==&lt;br /&gt;
&lt;br /&gt;
You should know this software, because it is used during the setup.&lt;br /&gt;
&lt;br /&gt;
If you have any further questions, please feel free to contact us.&lt;br /&gt;
&lt;br /&gt;
Software list:&lt;br /&gt;
* Debian Installer and preseed &amp;lt;ref&amp;gt;http://wiki.debian.org/DebianInstaller/Preseed&amp;lt;/ref&amp;gt;&lt;br /&gt;
* Apt-Proxy &amp;lt;ref&amp;gt;http://apt-proxy.sourceforge.net/&amp;lt;/ref&amp;gt;&lt;br /&gt;
* Private Debian repository &amp;lt;ref&amp;gt;http://mirrorer.alioth.debian.org/&amp;lt;/ref&amp;gt;&lt;br /&gt;
* Puppet Master &amp;lt;ref&amp;gt;http://reductivelabs.com/products/puppet/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==The Debian preseed setup==&lt;br /&gt;
&lt;br /&gt;
At first some basics. To use a so called &amp;quot;preseed&amp;quot; file it is good to know what it is. The Debian installation is done with the &amp;quot;Debian Installer&amp;quot;, short d-i. This d-i normally is a ncurses based console application that asks you some questions about your timezone, your partition setup, your network and so on. All this questions could be answered trough a preseed file. In this file some or all questions could be answered.&lt;br /&gt;
&lt;br /&gt;
Now it is good to know that if you do not answer a question or if a question pops up which is not in the preseed file, the d-i waits until you give a right answer. So it is a really good thing because you could leave something open and use the same preseed file for different hardware boxes e.g. one hardware has one network interface, another hardware has four network interfaces.&lt;br /&gt;
&lt;br /&gt;
Also it is good to know that you can use the preseed file to answer questions from any Debian package which is using the debconf interface, for example postfix.&lt;br /&gt;
&lt;br /&gt;
===How to start the preseed setup===&lt;br /&gt;
&lt;br /&gt;
Simply download the Netinstall CD from a Debian mirror put it in your cdrom-drive and boot the server. After booting from the CD you should see the Debian Grub Boot menu. In this menu you should select the &amp;quot;Advanced Option&amp;quot; and in the following menu place your cursor on &amp;quot;Automated install&amp;quot; - '''but do not press enter!'''&lt;br /&gt;
&lt;br /&gt;
You have to edit this boot menu entry by pressing the '''TAB''' key. Now you can append the '''URL''' option to the end of this boot line. Now press enter and continue the setup. Here is an example and a screen shot.&lt;br /&gt;
&lt;br /&gt;
 URL=http://yourserver:yourport/yourpreseedfile&lt;br /&gt;
&lt;br /&gt;
[[Image:Notbuu_1_preseed.png|200px|thumb|Grub menu screen]]&lt;br /&gt;
&lt;br /&gt;
As an example here is our preseed file:&lt;br /&gt;
&lt;br /&gt;
===During the preseed setup===&lt;br /&gt;
&lt;br /&gt;
If the d-i faces a question where it finds no answer in the preseed file it will hold until you answer the question. The d-i will not cancel the installation process.&lt;br /&gt;
&lt;br /&gt;
This is an interesting feature because you could use one file for different hardware setups. For example, if you have not configured that the d-i always uses the eth0 device during setup and there is more then one network card in your hardware, the d-i will wait until you choose one device. &lt;br /&gt;
&lt;br /&gt;
[[Image:Notbuu_2_preseed.png|200px|thumb|d-i wait for answer]]&lt;br /&gt;
&lt;br /&gt;
====Additional informations====&lt;br /&gt;
&lt;br /&gt;
At our site we use different preseed files for different purposes. As example one preseed for VMWare (Guest) servers etc...&lt;br /&gt;
All our preseed files are placed on a webserver but you should know that it is also possible to integrate the preseed process into a self made Debian installation medium.&lt;br /&gt;
&lt;br /&gt;
==The apt-proxy==&lt;br /&gt;
&lt;br /&gt;
The Debian Netinstall CD covers only a minimal system. So if you need more packages like rsync or others you have to connect to the internet. Without choosing a Debian mirror during the setup, the setup could not continue. If you use Debian OpenVZ Servers and Debian based Virtual Private Server at your site, you should use an apt-proxy to cache the downloaded packages. After the first setup this will speed up your installation time by factors!&lt;br /&gt;
&lt;br /&gt;
The apt-proxy setup is as easy as 1-2-3 go.&lt;br /&gt;
&lt;br /&gt;
Here is the preseed file, please note that I have removed the comments but I make some explanations for clearer understanding:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
d-i debian-installer/locale string en_US.UTF8&lt;br /&gt;
d-i console-keymaps-at/keymap select de-latin1-nodeadkeys&lt;br /&gt;
d-i netcfg/choose_interface select auto&lt;br /&gt;
d-i netcfg/dhcp_timeout string 60&lt;br /&gt;
d-i netcfg/get_hostname string unassigned-hostname&lt;br /&gt;
d-i netcfg/get_domain string unassigned-domain&lt;br /&gt;
d-i netcfg/wireless_wep string&lt;br /&gt;
d-i mirror/country string enter information manually&lt;br /&gt;
&lt;br /&gt;
''#This is our APT-PROXY address''&lt;br /&gt;
d-i mirror/http/hostname string youraptproxy:9999&lt;br /&gt;
&lt;br /&gt;
d-i mirror/http/directory string /debian&lt;br /&gt;
d-i mirror/suite string stable&lt;br /&gt;
d-i clock-setup/ntp boolean true&lt;br /&gt;
&lt;br /&gt;
''#NTP Server''&lt;br /&gt;
d-i clock-setup/ntp-server string yourtimeserver&lt;br /&gt;
&lt;br /&gt;
''#The partition setup – be careful! &lt;br /&gt;
#By default the OpenVZ debian packages are using /var/lib/vz''&lt;br /&gt;
d-i partman-auto/method string lvm&lt;br /&gt;
d-i partman-auto/purge_lvm_from_device boolean true&lt;br /&gt;
d-i partman-lvm/confirm boolean true&lt;br /&gt;
d-i partman-auto/expert_recipe string                         \&lt;br /&gt;
      boot-root ::                                            \&lt;br /&gt;
              150 150 150 ext3                                \&lt;br /&gt;
                      $primary{ } $bootable{ }                \&lt;br /&gt;
                      method{ format } format{ }              \&lt;br /&gt;
                      use_filesystem{ } filesystem{ ext3 }    \&lt;br /&gt;
                      mountpoint{ /boot }                     \&lt;br /&gt;
              .                                               \&lt;br /&gt;
              5120 5120 5120 ext3                             \&lt;br /&gt;
                      $primary{ } method{ format } format{ }  \&lt;br /&gt;
                      use_filesystem{ } filesystem{ ext3 }    \&lt;br /&gt;
                      mountpoint{ / }                         \&lt;br /&gt;
              .                                               \&lt;br /&gt;
              500 10000 1000000000 ext3                       \&lt;br /&gt;
                      method{ format } format{ } $lvmok{ }    \&lt;br /&gt;
                      use_filesystem{ } filesystem{ ext3 }    \&lt;br /&gt;
                      mountpoint{ /var }                      \&lt;br /&gt;
              .                                               \&lt;br /&gt;
              4096 4096 4096 linux-swap                       \&lt;br /&gt;
                      method{ swap } format{ } $lvmok { }     \&lt;br /&gt;
              .&lt;br /&gt;
d-i partman/confirm_write_new_label boolean true&lt;br /&gt;
d-i partman/choose_partition \&lt;br /&gt;
       select Finish partitioning and write changes to disk&lt;br /&gt;
d-i partman/confirm boolean true&lt;br /&gt;
d-i clock-setup/utc boolean true&lt;br /&gt;
d-i time/zone string Europe/Vienna&lt;br /&gt;
d-i apt-setup/non-free boolean true&lt;br /&gt;
d-i apt-setup/contrib boolean true&lt;br /&gt;
d-i apt-setup/security_host youraptproxy:9999&lt;br /&gt;
&lt;br /&gt;
''#Our private internal repository for some packages''&lt;br /&gt;
d-i apt-setup/local0/repository string \&lt;br /&gt;
       http://yourprivaterepository:10000/debian hns stable&lt;br /&gt;
d-i apt-setup/local0/key string http://yourprivaterepository:10000/PublicKey&lt;br /&gt;
d-i passwd/make-user boolean false&lt;br /&gt;
&lt;br /&gt;
''#The encrypted root password (this is only an example :) )''&lt;br /&gt;
d-i passwd/root-password-crypted password $1$v4rfe7wv$gEkbCLxCPhKaj92s.uJbD1&lt;br /&gt;
d-i grub-installer/only_debian boolean true&lt;br /&gt;
d-i grub-installer/with_other_os boolean true&lt;br /&gt;
tasksel tasksel/first multiselect standard&lt;br /&gt;
&lt;br /&gt;
''#Additional base packages''&lt;br /&gt;
d-i pkgsel/include string openssh-server build-essential vim snmpd lib32z1-dev rsync ntp ntpdate&lt;br /&gt;
d-i finish-install/reboot_in_progress note&lt;br /&gt;
d-i cdrom-detect/eject boolean false&lt;br /&gt;
xserver-xorg xserver-xorg/autodetect_monitor boolean true&lt;br /&gt;
xserver-xorg xserver-xorg/config/monitor/selection-method \&lt;br /&gt;
       select medium&lt;br /&gt;
xserver-xorg xserver-xorg/config/monitor/mode-list \&lt;br /&gt;
       select 1024x768 @ 60 Hz&lt;br /&gt;
&lt;br /&gt;
''#Packages that gets installed AFTER the base installation&lt;br /&gt;
#hns* packages are build by our own to fasten the setup and management''&lt;br /&gt;
d-i preseed/late_command string apt-install hp-health hp-snmp-agents hpsmh \&lt;br /&gt;
  hp-smh-templates hpacucli cpqacuxe ethtool linux-headers-2.6-openvz-amd64 \&lt;br /&gt;
  linux-image-2.6-openvz-amd64 vzctl vzquota hns-zabbix-agentd hns-openvz-common \&lt;br /&gt;
  hns-openvz-ubuntu-hosting hns-puppet firmware-qlogic&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==The private Debian repository==&lt;br /&gt;
&lt;br /&gt;
In our case the private repository is an essential factor because it will provide you with a fast software roll out, replicable software and consistent system state trough a large number of setups.&lt;br /&gt;
&lt;br /&gt;
It is quite easy to setup your own repository with reprepro &amp;lt;ref&amp;gt;http://mirrorer.alioth.debian.org/&amp;lt;/ref&amp;gt; and it is really useful.&lt;br /&gt;
&lt;br /&gt;
As you can see in the preseed file we have a lot of this packages in our repository. Some examples:&lt;br /&gt;
&lt;br /&gt;
*hns-zabbix-agentd&lt;br /&gt;
:is used for the automated installation of the Zabbix System Monitoring Agent.&amp;lt;ref&amp;gt;http://www.zabbix.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
*hns-openvz-common&lt;br /&gt;
:creates a backup cronjob and installs a backup script&lt;br /&gt;
:installs a set of scripts for Zabbix monitoring&lt;br /&gt;
*hns-openvz-ubuntu-hosting&lt;br /&gt;
:installs our pre-created Ubuntu&amp;lt;ref&amp;gt;http://www.ubuntu.com/&amp;lt;/ref&amp;gt; template&lt;br /&gt;
*hns-puppet&lt;br /&gt;
:installs the PuppetMaster client&lt;br /&gt;
&lt;br /&gt;
==The Puppet Master configuration management==&lt;br /&gt;
&lt;br /&gt;
If your preseeded setup was successful you have to configure your fresh server to fit your expectations. At our site we have ten OpenVZ servers in different countries and is really important that they have the same configuration.&lt;br /&gt;
&lt;br /&gt;
To make life easier we decided to use a configuration management like cfengine&amp;lt;ref&amp;gt;http://www.cfengine.org/&amp;lt;/ref&amp;gt; but not as complex in setup and management. We found our solution in Puppet Master.&lt;br /&gt;
&lt;br /&gt;
The only dependency Puppet Master has is Ruby. This should be installable on every distribution in minutes.&lt;br /&gt;
&lt;br /&gt;
After the installation you have to configure the Puppet Master to do things. Typically this means accepting the public private key pair and doing some configuration stuff. At our site use Puppet Master to manage an installation of about 100 servers.&lt;br /&gt;
&lt;br /&gt;
One thing it does is to change the sysctl.conf file.&lt;br /&gt;
&lt;br /&gt;
To get a feeling for it here is an configuration example (only OpenVZ server hosts):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# ALL----- OPENVZ&lt;br /&gt;
node &amp;quot;yourserver1.yourdns.com&amp;quot;, &amp;quot;yourserver2.yourdns.com&amp;quot;, &amp;quot;yourserver3.yourdns.com&amp;quot;, &amp;quot;yourserver4.yourdns.com&amp;quot;, &amp;quot;yourserver5.yourdns.com&amp;quot;, &amp;quot;yourserver6.yourdns.com&amp;quot;, &amp;quot;yourserver7.yourdns.com&amp;quot;{&lt;br /&gt;
    file { &amp;quot;/etc/aliases&amp;quot;:&lt;br /&gt;
        mode =&amp;gt; 644,&lt;br /&gt;
        owner =&amp;gt; root,&lt;br /&gt;
        group =&amp;gt; root,&lt;br /&gt;
        source =&amp;gt; &amp;quot;puppet://yourpuppetmaster/files/openvz-hosts/etc/aliases&amp;quot;,&lt;br /&gt;
    }&lt;br /&gt;
    exec { &amp;quot;subscribe-newaliases&amp;quot;:&lt;br /&gt;
        command =&amp;gt; &amp;quot;/usr/bin/newaliases &amp;amp;&amp;amp; /bin/echo NEALIASSES&amp;quot;,&lt;br /&gt;
        subscribe =&amp;gt; File[&amp;quot;/etc/aliases&amp;quot;],&lt;br /&gt;
        refreshonly =&amp;gt; true,&lt;br /&gt;
        logoutput =&amp;gt; true&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    file { &amp;quot;/etc/apt/sources.list&amp;quot;:&lt;br /&gt;
        mode =&amp;gt; 644,&lt;br /&gt;
        owner =&amp;gt; root,&lt;br /&gt;
        group =&amp;gt; root,&lt;br /&gt;
        source =&amp;gt; &amp;quot;puppet://yourpuppetmaster/files/openvz-hosts/etc/apt/sources.list&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    file { &amp;quot;/root/.ssh/authorized_keys2&amp;quot;:&lt;br /&gt;
        mode =&amp;gt; 644,&lt;br /&gt;
        owner =&amp;gt; root,&lt;br /&gt;
        group =&amp;gt; root,&lt;br /&gt;
        source =&amp;gt; &amp;quot;puppet://yourpuppetmaster/files/openvz-hosts/root/authorized_keys2&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    file { &amp;quot;/etc/vim/vimrc&amp;quot;:&lt;br /&gt;
        mode =&amp;gt; 644,&lt;br /&gt;
        owner =&amp;gt; root,&lt;br /&gt;
        group =&amp;gt; root,&lt;br /&gt;
        source =&amp;gt; &amp;quot;puppet://yourpuppetmaster/files/openvz-hosts/etc/vim/vimrc&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    file { &amp;quot;/etc/vz/conf/ve-vps.10.conf-sample&amp;quot;:&lt;br /&gt;
        mode =&amp;gt; 644,&lt;br /&gt;
        owner =&amp;gt; root,&lt;br /&gt;
        group =&amp;gt; root,&lt;br /&gt;
        source =&amp;gt; &amp;quot;puppet://yourpuppetmaster/files/openvz-hosts/etc/vz/conf/ve-vps.10.conf-sample&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    file { &amp;quot;/etc/sysctl.conf&amp;quot;:&lt;br /&gt;
        mode =&amp;gt; 644,&lt;br /&gt;
        owner =&amp;gt; root,&lt;br /&gt;
        group =&amp;gt; root,&lt;br /&gt;
        source =&amp;gt; &amp;quot;puppet://yourpuppetmaster/files/openvz-hosts/etc/sysctl.conf&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    exec { subscribe-sysctl:&lt;br /&gt;
        command =&amp;gt; &amp;quot;/sbin/sysctl -p &amp;amp;&amp;amp; /bin/echo SYSCTL EXECUTED&amp;quot;,&lt;br /&gt;
        logoutput =&amp;gt; true,&lt;br /&gt;
        refreshonly =&amp;gt; true,&lt;br /&gt;
        subscribe =&amp;gt; file[&amp;quot;/etc/sysctl.conf&amp;quot;]&lt;br /&gt;
    }&lt;br /&gt;
    file { &amp;quot;/etc/ntp.conf&amp;quot;:&lt;br /&gt;
        mode =&amp;gt; 644,&lt;br /&gt;
        owner =&amp;gt; root,&lt;br /&gt;
        group =&amp;gt; root,&lt;br /&gt;
        source =&amp;gt; &amp;quot;puppet://yourpuppetmaster/files/openvz-hosts/etc/ntp.conf&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    file { &amp;quot;/root/.bashrc&amp;quot;:&lt;br /&gt;
        mode =&amp;gt; 644,&lt;br /&gt;
        owner =&amp;gt; root,&lt;br /&gt;
        group =&amp;gt; root,&lt;br /&gt;
        source =&amp;gt; &amp;quot;puppet://yourpuppetmaster/files/openvz-hosts/root/bashrc&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    file { &amp;quot;/srv/exim_config.sh&amp;quot;:&lt;br /&gt;
        mode =&amp;gt; 744,&lt;br /&gt;
        owner =&amp;gt; root,&lt;br /&gt;
        group =&amp;gt; root,&lt;br /&gt;
        source =&amp;gt; &amp;quot;puppet://yourpuppetmaster/files/openvz-hosts/srv/exim_config.sh&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    exec { subscribe-exim_config:&lt;br /&gt;
        command =&amp;gt; &amp;quot;/srv/exim_config.sh &amp;amp;&amp;amp; /usr/sbin/update-exim4.conf &amp;amp;&amp;amp; /etc/init.d/exim4 restart &amp;amp;&amp;amp; /bin/echo EXIM_CONFIG&amp;quot;,&lt;br /&gt;
        logoutput =&amp;gt; true,&lt;br /&gt;
        refreshonly =&amp;gt; true,&lt;br /&gt;
        subscribe =&amp;gt; file[&amp;quot;/srv/exim_config.sh&amp;quot;]&lt;br /&gt;
    }&lt;br /&gt;
    file { &amp;quot;/etc/default/snmpd&amp;quot;:&lt;br /&gt;
        mode =&amp;gt; 644,&lt;br /&gt;
        owner =&amp;gt; root,&lt;br /&gt;
        group =&amp;gt; root,&lt;br /&gt;
        source =&amp;gt; &amp;quot;puppet://yourpuppetmaster/files/openvz-hosts/etc/default/snmpd&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    exec { subscribe-snmpd_config:&lt;br /&gt;
        command =&amp;gt; &amp;quot;/etc/init.d/snmpd restart &amp;amp;&amp;amp; /bin/echo SNMPD_CONFIG&amp;quot;,&lt;br /&gt;
        logoutput =&amp;gt; true,&lt;br /&gt;
        refreshonly =&amp;gt; true,&lt;br /&gt;
        subscribe =&amp;gt; file[&amp;quot;/etc/default/snmpd&amp;quot;]&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Boernie</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=A_managed_OpenVZ_installation&amp;diff=7429</id>
		<title>A managed OpenVZ installation</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=A_managed_OpenVZ_installation&amp;diff=7429"/>
		<updated>2009-07-21T07:14:05Z</updated>

		<summary type="html">&lt;p&gt;Boernie: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article will show a managed installation of OpenVZ based on Debian Lenny (Debian 5.0) and some other interesting software pieces like PuppetMaster. It is mainly written to show how to manage more than one OpenVZ server in a production environment.&lt;br /&gt;
&lt;br /&gt;
==Pre-Requirements==&lt;br /&gt;
&lt;br /&gt;
You should know this software, because it is used during the setup.&lt;br /&gt;
&lt;br /&gt;
If you have any further questions, please feel free to contact us.&lt;br /&gt;
&lt;br /&gt;
Software list:&lt;br /&gt;
* Debian Installer and preseed &amp;lt;ref&amp;gt;http://wiki.debian.org/DebianInstaller/Preseed&amp;lt;/ref&amp;gt;&lt;br /&gt;
* Apt-Proxy &amp;lt;ref&amp;gt;http://apt-proxy.sourceforge.net/&amp;lt;/ref&amp;gt;&lt;br /&gt;
* Private Debian repository &amp;lt;ref&amp;gt;http://mirrorer.alioth.debian.org/&amp;lt;/ref&amp;gt;&lt;br /&gt;
* Puppet Master &amp;lt;ref&amp;gt;http://reductivelabs.com/products/puppet/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==The Debian preseed setup==&lt;br /&gt;
&lt;br /&gt;
At first some basics. To use a so called &amp;quot;preseed&amp;quot; file it is good to know what it is. The Debian installation is done with the &amp;quot;Debian Installer&amp;quot;, short d-i. This d-i normally is a ncurses based console application that asks you some questions about your timezone, your partition setup, your network and so on. All this questions could be answered trough a preseed file. In this file some or all questions could be answerd.&lt;br /&gt;
&lt;br /&gt;
Now it is good to know that if you do not answer a question or if a question pops up which is not in the preseed file, the d-i wait until you give a right answer. So it is a really good thing because you could leave some thing open and use the same preseed file for different hardware boxes e.g. one hardware have one network interface, another hardware has four network interfaces.&lt;br /&gt;
&lt;br /&gt;
Also it is good to know that you can use the preseed file to answer questions from any Debian package which is using the debconf interface, for example postfix.&lt;br /&gt;
&lt;br /&gt;
===How to start the preseed setup===&lt;br /&gt;
&lt;br /&gt;
Simply download the Netinstall CD from a Debian mirror put it in your drive an boot the computer. After booting from the CD you should see the Debian Grub Boot menu. In this menu you should select the &amp;quot;Advanced Option&amp;quot; and in the following menu place your cursor on &amp;quot;Automated install&amp;quot; - '''but do not press enter!'''&lt;br /&gt;
&lt;br /&gt;
You have to edit this boot menu entry by pressing the '''TAB''' key. Now you can append the '''URL''' option to the end of this boot line. Now press enter and continue the setup. Here is an example and a screen shot.&lt;br /&gt;
&lt;br /&gt;
 URL=http://yourserver:yourport/yourpreseedfile&lt;br /&gt;
&lt;br /&gt;
[[Image:Notbuu_1_preseed.png|200px|thumb|Grub menu screen]]&lt;br /&gt;
&lt;br /&gt;
As example here is our preseed file:&lt;br /&gt;
&lt;br /&gt;
===During the preseed setup===&lt;br /&gt;
&lt;br /&gt;
If the d-i faces a question where it founds no answer in the preseed file it will hold on until you answer the question. The d-i will not cancel the installation process.&lt;br /&gt;
&lt;br /&gt;
This is an interesting feature because you could use one file for different hardware setups. For example, if you have not configured that the d-i to always use the eth0 device during setup and there is more then one network card in your hardware, the d-i will wait until you choose one device. &lt;br /&gt;
&lt;br /&gt;
[[Image:Notbuu_2_preseed.png|200px|thumb|d-i wait for answer]]&lt;br /&gt;
&lt;br /&gt;
====Additional informations====&lt;br /&gt;
&lt;br /&gt;
At our site we use different preseed files for different purposes. As example one preseed for VMWare servers etc...&lt;br /&gt;
All our preseed files are placed on a webserver but you should know that it is also possible to integrate the preseed process into a self made Debian installation medium.&lt;br /&gt;
&lt;br /&gt;
==The apt-proxy==&lt;br /&gt;
&lt;br /&gt;
The Debian Netinstall CD covers only a minimal system. So if you need more packages like rsync or others you have to connect to the internet. Without choosing a Debian mirror during the setup, the setup could not continue. If you use Debian OpenVZ Servers and Debian based Virtual Private Server at your site, you should use an apt-proxy to cache the downloaded packages. After the first setup this will speed up your installation time by factors!&lt;br /&gt;
&lt;br /&gt;
The apt-proxy setup is as easy as 1-2-3 go.&lt;br /&gt;
&lt;br /&gt;
Here is the preseed file, please note the I have removed the comments but I make some explanations for clearer understanding:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
d-i debian-installer/locale string en_US.UTF8&lt;br /&gt;
d-i console-keymaps-at/keymap select de-latin1-nodeadkeys&lt;br /&gt;
d-i netcfg/choose_interface select auto&lt;br /&gt;
d-i netcfg/dhcp_timeout string 60&lt;br /&gt;
d-i netcfg/get_hostname string unassigned-hostname&lt;br /&gt;
d-i netcfg/get_domain string unassigned-domain&lt;br /&gt;
d-i netcfg/wireless_wep string&lt;br /&gt;
d-i mirror/country string enter information manually&lt;br /&gt;
#This is our APT-PROXY address&lt;br /&gt;
d-i mirror/http/hostname string youraptproxy:9999&lt;br /&gt;
d-i mirror/http/directory string /debian&lt;br /&gt;
d-i mirror/suite string stable&lt;br /&gt;
d-i clock-setup/ntp boolean true&lt;br /&gt;
#NTP Server&lt;br /&gt;
d-i clock-setup/ntp-server string yourtimeserver&lt;br /&gt;
#The partition setup – be careful! &lt;br /&gt;
#By default the OpenVZ debian packages are using /var/lib/vz&lt;br /&gt;
d-i partman-auto/method string lvm&lt;br /&gt;
d-i partman-auto/purge_lvm_from_device boolean true&lt;br /&gt;
d-i partman-lvm/confirm boolean true&lt;br /&gt;
d-i partman-auto/expert_recipe string                         \&lt;br /&gt;
      boot-root ::                                            \&lt;br /&gt;
              150 150 150 ext3                                \&lt;br /&gt;
                      $primary{ } $bootable{ }                \&lt;br /&gt;
                      method{ format } format{ }              \&lt;br /&gt;
                      use_filesystem{ } filesystem{ ext3 }    \&lt;br /&gt;
                      mountpoint{ /boot }                     \&lt;br /&gt;
              .                                               \&lt;br /&gt;
              5120 5120 5120 ext3                             \&lt;br /&gt;
                      $primary{ } method{ format } format{ }  \&lt;br /&gt;
                      use_filesystem{ } filesystem{ ext3 }    \&lt;br /&gt;
                      mountpoint{ / }                         \&lt;br /&gt;
              .                                               \&lt;br /&gt;
              500 10000 1000000000 ext3                       \&lt;br /&gt;
                      method{ format } format{ } $lvmok{ }    \&lt;br /&gt;
                      use_filesystem{ } filesystem{ ext3 }    \&lt;br /&gt;
                      mountpoint{ /var }                      \&lt;br /&gt;
              .                                               \&lt;br /&gt;
              4096 4096 4096 linux-swap                       \&lt;br /&gt;
                      method{ swap } format{ } $lvmok { }     \&lt;br /&gt;
              .&lt;br /&gt;
d-i partman/confirm_write_new_label boolean true&lt;br /&gt;
d-i partman/choose_partition \&lt;br /&gt;
       select Finish partitioning and write changes to disk&lt;br /&gt;
d-i partman/confirm boolean true&lt;br /&gt;
d-i clock-setup/utc boolean true&lt;br /&gt;
d-i time/zone string Europe/Vienna&lt;br /&gt;
d-i apt-setup/non-free boolean true&lt;br /&gt;
d-i apt-setup/contrib boolean true&lt;br /&gt;
d-i apt-setup/security_host youraptproxy:9999&lt;br /&gt;
#Our private internal repository for some packages&lt;br /&gt;
d-i apt-setup/local0/repository string \&lt;br /&gt;
       http://yourprivaterepository:10000/debian hns stable&lt;br /&gt;
d-i apt-setup/local0/key string http://yourprivaterepository:10000/PublicKey&lt;br /&gt;
d-i passwd/make-user boolean false&lt;br /&gt;
#The encrypted root password (this is only an example :) )&lt;br /&gt;
d-i passwd/root-password-crypted password $1$v4rfe7wv$gEkbCLxCPhKaj92s.uJbD1&lt;br /&gt;
d-i grub-installer/only_debian boolean true&lt;br /&gt;
d-i grub-installer/with_other_os boolean true&lt;br /&gt;
tasksel tasksel/first multiselect standard&lt;br /&gt;
#Additional base packages&lt;br /&gt;
d-i pkgsel/include string openssh-server build-essential vim snmpd lib32z1-dev rsync ntp ntpdate&lt;br /&gt;
d-i finish-install/reboot_in_progress note&lt;br /&gt;
d-i cdrom-detect/eject boolean false&lt;br /&gt;
xserver-xorg xserver-xorg/autodetect_monitor boolean true&lt;br /&gt;
xserver-xorg xserver-xorg/config/monitor/selection-method \&lt;br /&gt;
       select medium&lt;br /&gt;
xserver-xorg xserver-xorg/config/monitor/mode-list \&lt;br /&gt;
       select 1024x768 @ 60 Hz&lt;br /&gt;
#Packages that gets installed AFTER the base installation&lt;br /&gt;
#hns* packages are build by our own to fasten the setup and management&lt;br /&gt;
d-i preseed/late_command string apt-install hp-health hp-snmp-agents hpsmh \&lt;br /&gt;
  hp-smh-templates hpacucli cpqacuxe ethtool linux-headers-2.6-openvz-amd64 \&lt;br /&gt;
  linux-image-2.6-openvz-amd64 vzctl vzquota hns-zabbix-agentd hns-openvz-common \&lt;br /&gt;
  hns-openvz-ubuntu-hosting hns-puppet firmware-qlogic&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==The private Debian repository==&lt;br /&gt;
&lt;br /&gt;
In our case the private repository is an essential factor because it will provide you with a fast software roll out, replicable software and consistent system state trough a large number of setups.&lt;br /&gt;
&lt;br /&gt;
It is quite easy to setup your own repository with reprepro &amp;lt;ref&amp;gt;http://mirrorer.alioth.debian.org/&amp;lt;/ref&amp;gt; and it is really useful.&lt;br /&gt;
&lt;br /&gt;
As you can see in the preseed file we have a lot of this packages in our repository. Some examples:&lt;br /&gt;
&lt;br /&gt;
*hns-zabbix-agentd&lt;br /&gt;
:is used for the automated installation of the Zabbix System Monitoring Agent.&amp;lt;ref&amp;gt;http://www.zabbix.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
*hns-openvz-common&lt;br /&gt;
:creates a backup cronjob and installs a backup script&lt;br /&gt;
:installs a set of scripts for Zabbix monitoring&lt;br /&gt;
*hns-openvz-ubuntu-hosting&lt;br /&gt;
:installs our pre-created Ubuntu&amp;lt;ref&amp;gt;http://www.ubuntu.com/&amp;lt;/ref&amp;gt; template&lt;br /&gt;
*hns-puppet&lt;br /&gt;
:installs the PuppetMaster client&lt;br /&gt;
&lt;br /&gt;
==The Puppet Master configuration management==&lt;br /&gt;
&lt;br /&gt;
If your preseeded setup was successful you have to configure your fresh server to fit your expectations. At our site we have ten OpenVZ servers in different countries and is really important that they have the same configuration.&lt;br /&gt;
&lt;br /&gt;
To make life easier we decided to use a configuration management like cfengine&amp;lt;ref&amp;gt;http://www.cfengine.org/&amp;lt;/ref&amp;gt; but not as complex in setup and management. We found our solution in Puppet Master.&lt;br /&gt;
&lt;br /&gt;
The only dependency Puppet Master has is Ruby. This should be installable on every distribution in minutes.&lt;br /&gt;
&lt;br /&gt;
After the installation you have to configure the Puppet Master to do things. Typically this means accepting the public private key pair and doing some configuration stuff. At our site use Puppet Master to manage an installation of about 100 servers.&lt;br /&gt;
&lt;br /&gt;
One thing it does is to change the sysctl.conf file.&lt;br /&gt;
&lt;br /&gt;
To get a feeling for it here is an configuration example (only OpenVZ server hosts):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# ALL----- OPENVZ&lt;br /&gt;
node &amp;quot;yourserver1.yourdns.com&amp;quot;, &amp;quot;yourserver2.yourdns.com&amp;quot;, &amp;quot;yourserver3.yourdns.com&amp;quot;, &amp;quot;yourserver4.yourdns.com&amp;quot;, &amp;quot;yourserver5.yourdns.com&amp;quot;, &amp;quot;yourserver6.yourdns.com&amp;quot;, &amp;quot;yourserver7.yourdns.com&amp;quot;{&lt;br /&gt;
    file { &amp;quot;/etc/aliases&amp;quot;:&lt;br /&gt;
        mode =&amp;gt; 644,&lt;br /&gt;
        owner =&amp;gt; root,&lt;br /&gt;
        group =&amp;gt; root,&lt;br /&gt;
        source =&amp;gt; &amp;quot;puppet://yourpuppetmaster/files/openvz-hosts/etc/aliases&amp;quot;,&lt;br /&gt;
    }&lt;br /&gt;
    exec { &amp;quot;subscribe-newaliases&amp;quot;:&lt;br /&gt;
        command =&amp;gt; &amp;quot;/usr/bin/newaliases &amp;amp;&amp;amp; /bin/echo NEALIASSES&amp;quot;,&lt;br /&gt;
        subscribe =&amp;gt; File[&amp;quot;/etc/aliases&amp;quot;],&lt;br /&gt;
        refreshonly =&amp;gt; true,&lt;br /&gt;
        logoutput =&amp;gt; true&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    file { &amp;quot;/etc/apt/sources.list&amp;quot;:&lt;br /&gt;
        mode =&amp;gt; 644,&lt;br /&gt;
        owner =&amp;gt; root,&lt;br /&gt;
        group =&amp;gt; root,&lt;br /&gt;
        source =&amp;gt; &amp;quot;puppet://yourpuppetmaster/files/openvz-hosts/etc/apt/sources.list&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    file { &amp;quot;/root/.ssh/authorized_keys2&amp;quot;:&lt;br /&gt;
        mode =&amp;gt; 644,&lt;br /&gt;
        owner =&amp;gt; root,&lt;br /&gt;
        group =&amp;gt; root,&lt;br /&gt;
        source =&amp;gt; &amp;quot;puppet://yourpuppetmaster/files/openvz-hosts/root/authorized_keys2&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    file { &amp;quot;/etc/vim/vimrc&amp;quot;:&lt;br /&gt;
        mode =&amp;gt; 644,&lt;br /&gt;
        owner =&amp;gt; root,&lt;br /&gt;
        group =&amp;gt; root,&lt;br /&gt;
        source =&amp;gt; &amp;quot;puppet://yourpuppetmaster/files/openvz-hosts/etc/vim/vimrc&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    file { &amp;quot;/etc/vz/conf/ve-vps.10.conf-sample&amp;quot;:&lt;br /&gt;
        mode =&amp;gt; 644,&lt;br /&gt;
        owner =&amp;gt; root,&lt;br /&gt;
        group =&amp;gt; root,&lt;br /&gt;
        source =&amp;gt; &amp;quot;puppet://yourpuppetmaster/files/openvz-hosts/etc/vz/conf/ve-vps.10.conf-sample&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    file { &amp;quot;/etc/sysctl.conf&amp;quot;:&lt;br /&gt;
        mode =&amp;gt; 644,&lt;br /&gt;
        owner =&amp;gt; root,&lt;br /&gt;
        group =&amp;gt; root,&lt;br /&gt;
        source =&amp;gt; &amp;quot;puppet://yourpuppetmaster/files/openvz-hosts/etc/sysctl.conf&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    exec { subscribe-sysctl:&lt;br /&gt;
        command =&amp;gt; &amp;quot;/sbin/sysctl -p &amp;amp;&amp;amp; /bin/echo SYSCTL EXECUTED&amp;quot;,&lt;br /&gt;
        logoutput =&amp;gt; true,&lt;br /&gt;
        refreshonly =&amp;gt; true,&lt;br /&gt;
        subscribe =&amp;gt; file[&amp;quot;/etc/sysctl.conf&amp;quot;]&lt;br /&gt;
    }&lt;br /&gt;
    file { &amp;quot;/etc/ntp.conf&amp;quot;:&lt;br /&gt;
        mode =&amp;gt; 644,&lt;br /&gt;
        owner =&amp;gt; root,&lt;br /&gt;
        group =&amp;gt; root,&lt;br /&gt;
        source =&amp;gt; &amp;quot;puppet://yourpuppetmaster/files/openvz-hosts/etc/ntp.conf&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    file { &amp;quot;/root/.bashrc&amp;quot;:&lt;br /&gt;
        mode =&amp;gt; 644,&lt;br /&gt;
        owner =&amp;gt; root,&lt;br /&gt;
        group =&amp;gt; root,&lt;br /&gt;
        source =&amp;gt; &amp;quot;puppet://yourpuppetmaster/files/openvz-hosts/root/bashrc&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    file { &amp;quot;/srv/exim_config.sh&amp;quot;:&lt;br /&gt;
        mode =&amp;gt; 744,&lt;br /&gt;
        owner =&amp;gt; root,&lt;br /&gt;
        group =&amp;gt; root,&lt;br /&gt;
        source =&amp;gt; &amp;quot;puppet://yourpuppetmaster/files/openvz-hosts/srv/exim_config.sh&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    exec { subscribe-exim_config:&lt;br /&gt;
        command =&amp;gt; &amp;quot;/srv/exim_config.sh &amp;amp;&amp;amp; /usr/sbin/update-exim4.conf &amp;amp;&amp;amp; /etc/init.d/exim4 restart &amp;amp;&amp;amp; /bin/echo EXIM_CONFIG&amp;quot;,&lt;br /&gt;
        logoutput =&amp;gt; true,&lt;br /&gt;
        refreshonly =&amp;gt; true,&lt;br /&gt;
        subscribe =&amp;gt; file[&amp;quot;/srv/exim_config.sh&amp;quot;]&lt;br /&gt;
    }&lt;br /&gt;
    file { &amp;quot;/etc/default/snmpd&amp;quot;:&lt;br /&gt;
        mode =&amp;gt; 644,&lt;br /&gt;
        owner =&amp;gt; root,&lt;br /&gt;
        group =&amp;gt; root,&lt;br /&gt;
        source =&amp;gt; &amp;quot;puppet://yourpuppetmaster/files/openvz-hosts/etc/default/snmpd&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    exec { subscribe-snmpd_config:&lt;br /&gt;
        command =&amp;gt; &amp;quot;/etc/init.d/snmpd restart &amp;amp;&amp;amp; /bin/echo SNMPD_CONFIG&amp;quot;,&lt;br /&gt;
        logoutput =&amp;gt; true,&lt;br /&gt;
        refreshonly =&amp;gt; true,&lt;br /&gt;
        subscribe =&amp;gt; file[&amp;quot;/etc/default/snmpd&amp;quot;]&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Boernie</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=User:Boernie&amp;diff=7414</id>
		<title>User:Boernie</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=User:Boernie&amp;diff=7414"/>
		<updated>2009-07-16T08:37:36Z</updated>

		<summary type="html">&lt;p&gt;Boernie: New page: MySandbox&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[MySandbox]]&lt;/div&gt;</summary>
		<author><name>Boernie</name></author>
		
	</entry>
</feed>