Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
kopiluwak [2009/06/23 13:13] 193.190.76.58 |
kopiluwak [2010/10/02 17:26] (current) |
||
---|---|---|---|
Line 10: | Line 10: | ||
===== Idea ====== | ===== Idea ====== | ||
The machine hosts virtual machines. Other than that no functionality runs on the machine. | The machine hosts virtual machines. Other than that no functionality runs on the machine. | ||
- | ===== KVM ===== | + | |
- | === Guest 1: buildbot.xfce.org === | + | ===== Host ===== |
- | == Configuration == | + | ==== Software ==== |
- | * Start the machine: | + | ^ software ^ version ^ website ^ |
+ | | Lunar Linux | 1.6.4 x86_64 | [[http://lunar-linux.org]] | | ||
+ | | Linux | 2.6.30.5 | | | ||
+ | | kvm | 88 | [[http://kvm.qumranet.com]] | | ||
+ | | vde | 2.2.2 | [[http://vde.sourceforge.net]] | | ||
+ | | lvm2 | 2.02.45 | [[http://sources.redhat.com/lvm2]] | | ||
+ | | tunctl | 1.5 | [[http://tunctl.sourceforge.net]] | | ||
+ | ==== Configuration ==== | ||
+ | === Storage === | ||
+ | * root and boot | ||
+ | | /dev/md1 | / | ext3 | | ||
+ | | /dev/md0 | /boot | ext3 | | ||
+ | * var, home, luns for vm's | ||
+ | VolumeGroup: vg on /dev/md2 | ||
+ | | /dev/mapper/vg-home | /home | ext4 | | ||
+ | | /dev/mapper/vg-var | /var | ext4 | | ||
+ | |||
+ | === Network === | ||
+ | * eth0 - bridged to br0, ip assigned with dhcp | ||
+ | * br0: run script in screen | ||
+ | <code bash> | ||
+ | #!/bin/bash | ||
+ | if [ $TERM == screen ]; then | ||
+ | /usr/bin/killall dhcpcd | ||
+ | /bin/rm -fr /var/db/dhcpcd* | ||
+ | /sbin/modprobe tun | ||
+ | /usr/sbin/tunctl -t tap0 | ||
+ | /usr/sbin/brctl addbr br0 | ||
+ | /usr/sbin/brctl addif br0 eth0 | ||
+ | /usr/sbin/brctl addif br0 tap0 | ||
+ | /sbin/ifconfig eth0 0.0.0.0 promisc up #still need to test if promisc is needed | ||
+ | /sbin/ifconfig tap0 0.0.0.0 promisc up #still need to test if promisc is needed | ||
+ | /sbin/ifconfig br0 up | ||
+ | /usr/sbin/dhcpcd br0 | ||
+ | |||
+ | echo "Sleep for 5 minutes, Ctrl ^ C to stop, will revert changes if you don't" | ||
+ | sleep 5m | ||
+ | |||
+ | echo "revert changes" | ||
+ | /sbin/ifconfig br0 down | ||
+ | /usr/bin/killall dhcpcd | ||
+ | /bin/rm -fr /var/db/dhcpcd* | ||
+ | /usr/sbin/brctl delif br0 eth0 | ||
+ | /usr/sbin/brctl delif br0 tap0 | ||
+ | /usr/sbin/brctl delbr br0 | ||
+ | /usr/sbin/tunctl -d tap0 | ||
+ | /sbin/ifconfig eth0 up | ||
+ | /usr/sbin/dhcpcd eth0 | ||
+ | |||
+ | echo "Sleep for 5 minutes, Ctrl ^ C to stop, will revert changes if you don't" | ||
+ | sleep 5m | ||
+ | echo "reboot" | ||
+ | /sbin/reboot | ||
+ | else | ||
+ | echo "USE SCREEN"; | ||
+ | fi | ||
+ | </code> | ||
+ | * vde_switch: Switch that the virtual machines (buildslaves) will use to communicate with the buildmaster. | ||
+ | <code bash> | ||
+ | vde_switch -tap tap1 -daemon; | ||
+ | ifconfig tap1 10.0.0.1; | ||
+ | echo "1" > /proc/sys/net/ipv4/ip_forward; | ||
+ | iptables -t nat -A POSTROUTING -o br0 -j MASQUERADE | ||
+ | </code> | ||
+ | |||
+ | ===== Hosted Virtual Machines ===== | ||
+ | ==== Guest 1: buildbot.xfce.org ==== | ||
+ | === Configuration === | ||
+ | == Start the machine == | ||
<code bash> | <code bash> | ||
#!/bin/bash | #!/bin/bash | ||
# This script starts the buildbot | # This script starts the buildbot | ||
vdeq qemu-system-x86_64 -vnc :1 -hda /dev/vg/BuildBot -m 512 -net nic,vlan=0 -net tap,vlan=0,ifname=tap0,script=no -net vde,vlan=1 -net nic,vlan=1 -daemonize | vdeq qemu-system-x86_64 -vnc :1 -hda /dev/vg/BuildBot -m 512 -net nic,vlan=0 -net tap,vlan=0,ifname=tap0,script=no -net vde,vlan=1 -net nic,vlan=1 -daemonize | ||
- | ze | ||
</code> | </code> | ||
- | * network | + | == network == |
- | * eth0: fixed ip - external ip (dns: buildbot.xfce.org) | + | * eth0: fixed ip - external ip (dns: buildbot.xfce.org) |
- | * eth1: internal nic connected to the virtual switch (ip: 10.0.0.2) | + | * eth1: internal nic connected to the virtual switch (ip: 10.0.0.2) |
- | * software | + | == software == |
- | * lunar-linux 1.6.4 x86_64 | + | * buildbot 0.7.10p1 |
- | * buildbot 0.7.10p1 | + | == config buildbot == |
- | == Guest 2: buildslave == | + | * create the user buildmaster |
+ | * Create instance of buildbot: | ||
+ | <code bash> | ||
+ | buildbot create-master /home/buildmaster/xfce | ||
+ | </code> | ||
+ | * start the buildbot instance: | ||
+ | <code bash> | ||
+ | buildbot start /home/buildmaster/xfce | ||
+ | </code> | ||
+ | * configure the buildbot instance: edit master.cfg | ||
+ | * validate the edits: | ||
+ | <code bash> | ||
+ | buildbot checkconfig master.cfg | ||
+ | </code> | ||
+ | * reread the config in the current instance: | ||
+ | <code bash> | ||
+ | buildbot reconfig /home/buildmaster/xfce | ||
+ | </code> | ||
+ | * master.cfg: | ||
+ | <code python> | ||
+ | </code> | ||
+ | ==== Guest 2: buildslave ==== | ||
- | === buildbot === | + | lunar |
+ | ip 10.0.0.3 | ||
+ | vdeq qemu-system-x86_64 -vnc :2 -hda /dev/vg/lunar -m 512 -net vde,vlan=1 -net nic,vlan=1 -daemonize |