You are not logged in.
Hi all!
I've created (ok, i've modified the original one
) a script to create an OpenVZ template for ArchServer. You can see the script and usage information by visiting this wiki article.
Feel free to contribute and correct mistakes.
Warning: it's not ready for daily usage yet (some packages are missing, and they'll be included in core repository in future)
Last edited by ras0ir (2010-Jan-31 13:38:26)
Offline
According to Wikipedia OpenVZ is: OpenVZ is an...
changed to :
According to Wikipedia, OpenVZ is an
Thank you for your contribution ![]()
Offline
Does OpenVZ require any specific kernel configuration? Should this "just work" (tm)?
Offline
fukawi2 wrote:
Does OpenVZ require any specific kernel configuration? Should this "just work" (tm)?
well it doesnt need any specific configuration, the script and template will work when the packages in PACKS variable available in the repositories ![]()
crond, zip, unzip and joe (feel free to drop joe :p) are missing at the moment.
Offline
Yikes, I didn't realize we were missing a cron package :-|
http://git.archserver.org/?p=server-cor … 4782ce1051
Offline
OpenVZ would be a perfect usage of ArchServer, I believe.
The given Script is really nice. I think we could probably replace the contents of the PACKS variable with something more streamlined (e.g. replace all Packages belonging to base with the group base).
ras0ir, are you going to maintain this one? Is there anything you need for this script, which is not already there?
Offline
PACKS="sed gawk coreutils filesystem texinfo grep pacman logrotate \ module-init-tools wget curl net-tools procps tar cpio \ gzip bzip2 psmisc initscripts iptables iputils dnsutils iproute2 \ less dash bash which openssh sudo vixie-cron syslog-ng \ util-linux-ng"
i've removed zip, unzip and lzma-utils from the list (they'll be useful, but not needed ATM). I'm compiling kernel26-ovz26 at the moment, i'll test vz template tonight.
Offline
Happy end ![]()
Note: I've updated OpenVZ Template page.
Last edited by ras0ir (2010-Feb-07 08:14:24)
Offline
Great stuff, I think that Virtualiation is the future so as more we support it, the better it is.
Thanks ras0ir.
Offline
Awesome.... good work ras0ir ![]()
So what are you hosting on it? Sourceforge mirror? Reddit clone? FOSS version of YouTube/Vimeo? ![]()
Offline
![]()
BTW, it's possible to use these OpenVZ templates in LXC as it supports OpenVZ templates by default.
see http://lxc.teegra.net/ for container setup.
Offline
I had to make some changes to the buildtemplate script to get the container creation to work.
I needed to add the server-core repo, and delete the unzip package from PACKS
Below is the script I got to work
# simple script to create OpenVZ ArchServer template.
# For the original script see http://wiki.openvz.org/Talk:Archlinux_Template_creation
DISTRO=archserver
VERSION=20100702
PACKS="sed gawk coreutils texinfo filesystem grep pacman logrotate
module-init-tools wget curl net-tools procps tar cpio zip
gzip bzip2 psmisc initscripts iputils dnsutils iproute2
less dash which openssh vim vixie-cron sudo htop dcron rsyslog
util-linux-ng"
MIRROR1=http://repo.archserver.org/redgum
MIRROR2=ftp://repo.archserver.org/redgum
if [[ ${1} == 64 ]]; then
ARCH=x86_64
else
if [[ ${1} == 32 ]]; then
ARCH=i686
else
echo "Usage: ${0} 32|64"
exit 1
fi
fi
ROOT=${DISTRO}-${VERSION}-${ARCH}
TEMPLATE=$(pwd)/${ROOT}.tar.gz
if [[ "$(whoami)" == "root" ]]; then
echo "Building template: ${ROOT}"
else
echo "This script must be run as root (or with sudo)"
exit 1
fi
cat <<EOF > pacman.conf
[options]
HoldPkg = pacman glibc
SyncFirst = pacman
[server-core]
Server = ${MIRROR1}/server-core/os/${ARCH}
Server = ${MIRROR2}/server-core/os/${ARCH}
[testing]
Server = ${MIRROR1}/testing/os/${ARCH}
Server = ${MIRROR2}/testing/os/${ARCH}
EOF
mkarchroot -C pacman.conf ${ROOT} ${PACKS}
chmod 666 ${ROOT}/dev/null
chmod 666 ${ROOT}/dev/zero
mknod -m 666 ${ROOT}/dev/random c 1 8
mknod -m 666 ${ROOT}/dev/urandom c 1 9
mkdir -m 755 ${ROOT}/dev/pts
mkdir -m 1777 ${ROOT}/dev/shm
mknod -m 666 ${ROOT}/dev/tty c 5 0
mknod -m 666 ${ROOT}/dev/full c 1 7
mknod -m 600 ${ROOT}/dev/initctl p
mknod -m 666 ${ROOT}/dev/ptmx c 5 2
# we don't need any getty entries in a container
sed 's/^.*getty.*$/#&/' -i ${ROOT}/etc/inittab
echo "sshd: ALL: ALLOW" >> ${ROOT}/etc/hosts.allow
cd ${ROOT}
tar czvf ${TEMPLATE} .
echo "Created template: ${ROOT}"i can start a VE created from this template, but I've got a problem with the /dev/tty
[root@ks369514 ~]# vzctl --verbose enter 888 entered into CT 888 [root@meagan /]# ls -lh /dev total 4.0K drwxr-xr-x 2 root root 160 2010-07-25 12:07 char crw------- 1 root root 5, 1 2010-02-04 17:41 console lrwxrwxrwx 1 root root 11 2010-07-25 11:52 core -> /proc/kcore lrwxrwxrwx 1 root root 13 2010-07-25 11:52 fd -> /proc/self/fd crw-rw-rw- 1 root root 1, 7 2010-07-25 12:07 full crw-rw-rw- 1 root root 10, 229 2010-02-04 17:41 fuse prw------- 1 root root 0 2010-07-25 12:07 initctl crw-rw-rw- 1 root root 1, 11 2010-02-04 17:41 kmsg srw-rw-rw- 1 root root 0 2010-07-25 12:07 log brw-rw---- 1 root disk 7, 0 2010-02-04 17:41 loop0 drwxr-xr-x 2 root root 60 2010-02-04 17:41 net crw-rw-rw- 1 root root 1, 3 2010-07-25 12:07 null crw------- 1 root root 108, 0 2010-02-04 17:41 ppp crw-rw-rw- 1 root tty 5, 2 2010-07-25 12:15 ptmx drwxr-xr-x 2 root root 0 2010-07-25 12:07 pts crw-rw-rw- 1 root root 1, 8 2010-07-25 12:07 random drwxrwxrwt 2 root root 40 2010-07-25 12:07 shm lrwxrwxrwx 1 root root 15 2010-07-25 11:52 stderr -> /proc/self/fd/2 lrwxrwxrwx 1 root root 15 2010-07-25 11:52 stdin -> /proc/self/fd/0 lrwxrwxrwx 1 root root 15 2010-07-25 11:52 stdout -> /proc/self/fd/1 -rw-r--r-- 1 root root 3 2010-07-25 12:07 tty[0-9]* crw-rw-rw- 1 root root 1, 9 2010-07-25 12:07 urandom crw-rw-rw- 1 root root 1, 5 2010-07-25 12:07 zero
With this I can't ssh from the box to other box:
debug1: read_passphrase: can't open /dev/tty: No such file or directory
On the HN (running CentOS 5.5), I also had to execute one command, to have the network working fine in the VE:
cp /etc/vz/dists/arch.conf /etc/vz/dists/archserver.conf
Last edited by slubman (2010-Jul-25 10:21:23)
Offline
Hi slubman, welcome to AS ![]()
Thanks for the testing and feedback -- would you be able to report it on the Bug Tracker please? ![]()
Cheers,
~p
Offline
Offline
I'm still working on the template, and indeed, the /etc/rc.sysinit is now heavily "patched" to have the good devices created, and other things sorted out (like the output of df -h). I still have to solve the problem with the creation of the /dev/tty[0-9]* file.
Offline