Instructions for building the HIP OpenVZ test world
Jan 22, 2007
Jeff Ahrenholz
Linux preparation
- installed vmware server on a Linux machine
- installed FC5 from a mounted ISO
- deselected all of the package sets
- 1.8gb space is used initially
- install vmware-tools into guest OS
- perform `yum update` and reboot
OpenVZ preparation
Complete instructions found here: http://wiki.openvz.org/Quick_installation
- go to openvz.org and download the latest FC5 kernel source
RPM
- add the OpenHIP patch to FC5 kernel source, which adds
protocol 253 to the allowed protocols
- add openvz.socket.c.patch to /usr/src/redhat/SOURCES
- add patch to kernel-2.6.spec in /usr/src/redhat/SPECS
- yum install rpm-build redhat-rpm-config
- rpmbuild –ba --target=i686 kernel-2.6.spec from
/usr/src/redhat/SPECS
- install kernel RPM:
cd /usr/src/redhat/RPMS
rpm –ivh --force kernel-2.6.16-1.2133_FC5.026test015.i686.rpm
rpm –ivh --force kernel-devel-2.6.16-1.2133_FC5.026test015.i686.rpm
- check /etc/grub.conf, rename kernel to OpenVZ, and reboot
- add OpenVZ utilities
- rpm –ivh vzquota-3.0.9-1.i386.rpm
- rpm –ivh vzctl-libs-3.0.13-1.i386
- rpm –ivh vzctl-3.0.13-1.i386
- clean up to save disk space
- save generated RPMs for future use, or at least the
src.rpm
- remove all RPMs from /usr/src/redhat/RPMS/i686,
/usr/src/redhat/SRPMS
- rpmbuild --clean kernel-2.6.spec
- rpmbuild --rmsource kernel-2.6.spec
- should go from 4.4G used to 2.1G
- edit sysctl.conf per OpenVZ instructions
found here: http://wiki.openvz.org/Quick_installation#sysctl
- reboot
Prepare the OS Template Cache
Complete instructions here: http://wiki.openvz.org/OS_template_cache_preparation
- download template meta data
- rpm –ivh vzrpm43-4.3.3-7_nonptl.6.i386.rpm vzrpm43-python-4.3.3-7_nonptl.6.i386.rpm
- rpm –ivh vzyum-2.4.0-11.noarch.rpm
- rpm –ivh vzpkg-2.7.0-18.noarch.rpm
- download fedora-core-5-i386-default.tar.gz to
/vz/template/cache
Create VEs
Complete instructions here: http://wiki.openvz.org/VE_creation
- vzctl create 101 --ostemplate fedora-core-5
vzctl set 101 --hostname ve101 --ipadd 10.5.0.1 --save
vzctl set 101 --onboot yes --save
vzctl start 101
- vzctl create 102 --ostemplate fedora-core-5
vzctl set 102 --hostname ve102 --ipadd 10.5.0.2 --save
vzctl set 102 --onboot yes --save
vzctl start 102
- configure networking between the two VEs
- modprobe vzethdev
- vzctl set 101 --veth_add veth101.0 ,00:A0:43:52:C9:01,eth0,
00:A0:43:52:C9:02 --save
- vzctl set 102 --veth_add veth102.0 ,00:A0:43:52:C9:03,eth0,
00:A0:43:52:C9:04 --save
- yum install bridge-utils
- brctl addbr vzbr0
- brctl addif veth101.0
- brctl addif veth102.0
- ifconfig vzbr0 up
- edit /etc/sysconfig/network-scripts/ifcfg-eth0 on VE 101
and 102 to configure the IP addresses 10.4.0.1 and 10.4.0.2
Fedora customizations
- edit .bashrc and put /sbin:/usr/sbin:/usr/local/sbin into
path
- run vmware-config-tools.pl and answer questions
- run vmware-toolbox and click on time synchronization,
shrink partitions
- add OpenHIP wallpaper to /usr/share/backgrounds
- edit /usr/share/gdm/themes/OpenHIP and choose the theme
using gdmsetup
- create desktop icons for launching gnome-terminal into VE 101
and 102
OpenHIP preparations
- yum install libxml2-devel openssl-devel
- yum install autoconf autotools
- download hip source from anonymous CVS and run
./bootstrap.sh, ./configure
- run make
- cp src/hip /vz/root/101/usr/local/sbin
- cp src/hitgen /vz/root/101/usr/local/sbin
- cp src/hip /vz/root/102/usr/local/sbin
- cp src/hitgen /vz/root/102/usr/local/sbin
- run /usr/local/sbin/hitgen -conf, /usr/local/sbin/hitgen
from VE 101 and 102
- set root password for virtual servers
- run /usr/local/sbin/hitgen -publish, edit with addresses,
and scp known_host_identities.xml file to peer
- Fix firewall on host system to allow proto 253, ESP, and
HIP UDP in /etc/sysconfig/iptables
- create a script for bringing up the network bridge in
/etc/sysconfig/network-scripts/ifcfg-vzbr0 and /etc/rc.local
- brctl addbr vzbr0
- brctl addif vzbr0 veth101.0
- brctl addif vzbr0 veth102.0
- ifconfig vzbr0 up
Running HIP
- modprobe tun, add this to /etc/rc.local
- vzctl set 101 --devices c:10:200:rw --save
- vzctl set 102 --devices c:10:200:rw --save
- vzctl exec 101 mkdir -p /dev/net
- vzctl exec 101 mknod /dev/net/tun c 10 200
- vzctl exec 101 chmod 600 /dev/net/tun
- vzctl exec 102 mkdir -p /dev/net
- vzctl exec 102 mknod /dev/net/tun c 10 200
- vzctl exec 102 chmod 600 /dev/net/tun
- set preferred address to 10.4.0.x in hip.conf
Cleaning up
- rm -rf /vz/templates/cache/* (except for .tar.gz)
- remove non-essential RPMs, for example:
rpm -e beagle evolution evolution-webcal evolution-sharp cleanup yelp
seamonkey gnu-crypto jessie java-1.4.2-gcj-compat gnome-backgrounds tomboy
- rpm -e mono-data mono-web mono-data-sqlite glx-utils
foomatic system-config-printer hal-cups-utils desktop-printing
system-config-printer-gui gimp-print-utils gimp-print ppp wvdial rp-pppoe
- rm -rf /var/tmp/kernel*
- stop virtual environments (removes /vz/root/*)
- shrink the virtual disk
- first fill the disk using dd if=/dev/zero of=/empty_file
- rm /empty_file
- stop machine, from Windows VMware Server, use the
utility:
vmware-vdiskmanager.exe -k HIP-FC5-OpenVZ.vmdk