<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Aptivate &#124; A Blog for ICT4D &#187; AfNOG</title>
	<atom:link href="http://blog.aptivate.org/tag/afnog/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.aptivate.org</link>
	<description>International I.T. Development</description>
	<lastBuildDate>Wed, 01 Feb 2012 14:09:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.6</generator>
		<item>
		<title>AfNOG 2011, Part 2</title>
		<link>http://blog.aptivate.org/2011/05/30/afnog-2011-part-2/</link>
		<comments>http://blog.aptivate.org/2011/05/30/afnog-2011-part-2/#comments</comments>
		<pubDate>Mon, 30 May 2011 19:12:11 +0000</pubDate>
		<dc:creator>Chris Wilson</dc:creator>
				<category><![CDATA[Africa]]></category>
		<category><![CDATA[Engineer's Log]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Training]]></category>
		<category><![CDATA[AfNOG]]></category>
		<category><![CDATA[afnog2011]]></category>
		<category><![CDATA[bootcamp]]></category>
		<category><![CDATA[freebsd]]></category>
		<category><![CDATA[imaging]]></category>
		<category><![CDATA[tanzania]]></category>
		<category><![CDATA[virtualisation]]></category>

		<guid isPermaLink="false">http://blog.aptivate.org/?p=823</guid>
		<description><![CDATA[AfNOG boot camp was absolutely massive this year. I think they had 75 people when they were only expecting 40. They took over half our classroom as well, which made setup tricky as we had to work around people and ask them to move repeatedly, and we couldn&#8217;t get all of our tables in to [...]]]></description>
			<content:encoded><![CDATA[<div class="wp-caption alignright" style="width: 250px"><a href="http://www.flickr.com/photos/chris_wilson/5777620432/in/photostream"><img alt="People sitting at computers in a lecture" src="http://farm3.static.flickr.com/2153/5777620432_60df2b4a1f_m.jpg" title="Boot Camp" width="240" height="160" /></a><p class="wp-caption-text">Boot Camp</p></div>
<p><a href="http://www.afnog.org/afnog2011/">AfNOG</a> boot camp was absolutely massive this year. I think they had 75 people when they were only expecting 40. They took over half our classroom as well, which made setup tricky as we had to work around people and ask them to move repeatedly, and we couldn&#8217;t get all of our tables in to cable them up.</p>
<p>It was followed by the obligatory welcome dinner, at the White Sands&#8217; outdoor restaurant, with the requisite number of speeches and applauses.</p>
<p>Today we had the first day of Scalable Services. Desktop installation hadn&#8217;t gone too well. My attempt to respin with fixes, wiping the unused space after the imaged partition, failed badly and resulted in a corrupted image, so we had to reimage those boxes.</p>
<div class="wp-caption alignright" style="width: 250px"><a href="http://www.flickr.com/photos/chris_wilson/5777647720/in/photostream"><img alt="People sitting around dinner tables in front of a stage on the beach" src="http://farm4.static.flickr.com/3587/5777647720_4fcca7866f_m.jpg" title="Welcome" width="240" height="160" /></a><p class="wp-caption-text">Welcome</p></div>
<p>Luckily it seems that everyone brought laptops, so the PCs aren&#8217;t really needed. And the virtual machines seem to be working well so far. We haven&#8217;t yet had to compile any software on the virtual machines, and I hope it won&#8217;t be too slow when we do. We&#8217;re using 34 out of the 35 virtual machines that we created.</p>
<p>Tomorrow is my first session, a 1 hour practical on virtualisation, installing VirtualBox and FreeBSD, after Joel&#8217;s theory session.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.aptivate.org/2011/05/30/afnog-2011-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AfNOG 2011, Part 1</title>
		<link>http://blog.aptivate.org/2011/05/28/afnog-2011-part-1/</link>
		<comments>http://blog.aptivate.org/2011/05/28/afnog-2011-part-1/#comments</comments>
		<pubDate>Sat, 28 May 2011 20:57:06 +0000</pubDate>
		<dc:creator>Chris Wilson</dc:creator>
				<category><![CDATA[Engineer's Log]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[System Administration]]></category>
		<category><![CDATA[Training]]></category>
		<category><![CDATA[AfNOG]]></category>
		<category><![CDATA[afnog2011]]></category>
		<category><![CDATA[computers]]></category>
		<category><![CDATA[freebsd]]></category>
		<category><![CDATA[ghost]]></category>
		<category><![CDATA[imaging]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[tanzania]]></category>

		<guid isPermaLink="false">http://blog.aptivate.org/?p=791</guid>
		<description><![CDATA[I&#8217;m in Dar es Salaam, Tanzania for AfNOG 2011. I arrived on Wednesday morning at 7am (on the red-eye flight from London Heathrow) and I&#8217;m here until Tuesday 7th June. Until now we&#8217;ve been setting up the venue. We&#8217;ve been super busy, working until midnight every night so far. We had to run our own [...]]]></description>
			<content:encoded><![CDATA[<div class="wp-caption alignright" style="width: 170px"><a href="http://www.flickr.com/photos/chris_wilson/5768083663/in/photostream"><img alt="Alan Barrett laying cable" src="http://farm3.static.flickr.com/2472/5768083663_6c02262a48_m.jpg" title="Alan Barrett laying cable" width="160" height="240" /></a><p class="wp-caption-text">Alan Barrett laying cable</p></div>
<p>I&#8217;m in <strong>Dar es Salaam, Tanzania</strong> for <a href="http://www.afnog.org/afnog2011/">AfNOG 2011</a>. I arrived on Wednesday morning at 7am (on the red-eye flight from London Heathrow) and I&#8217;m here until Tuesday 7th June.</p>
<p>Until now we&#8217;ve been setting up the venue. We&#8217;ve been super busy, working until midnight every night so far. We had to run our own cables, quite a lot of them (over 600 metres).</p>
<p>Running them through the windows was tricky, since we needed to be able to close them for security, and to allow the air conditioning to work. Someone (Alan?) came up with the genius idea of using tough palm leaves wrapped around them to protect them as they pass through the narrow gap between window panes. Bio-degradable trunking!</p>
<p>To cope with the power failures, Geert Jan built a monster Power-over-Ethernet injector to power the wireless access points in each room and keep the wireless network running.</p>
<p>The training workshops start tomorrow, Sunday 29th May, with the Unix Boot Camp, an introduction to Unix and the command line. We expect that many of the participants will have little experience with Unix, as has been the case in previous years. These free tools have immense benefits, both for us running the workshops and for the participants when they return home. But they are very different to the Windows environments that the participants are most familiar with. Without basic skills, they would struggle and hold back the group during the rest of the workshops.</p>
<div class="wp-caption alignright" style="width: 250px"><a href="http://www.flickr.com/photos/chris_wilson/5768609278/in/photostream"><img alt="Feeding the cable monster" src="http://farm3.static.flickr.com/2088/5768609278_e4921feb42_m.jpg" title="Feeding the cable monster" width="240" height="160" /></a><p class="wp-caption-text">Feeding the cable monster</p></div>
<p>I&#8217;m not involved in the boot camp, but after it finishes, we move straight into the main tracks, which last for five days. This year we have some new tracks: Network Monitoring &#038; Management, Advanced Routing Techniques and Computer Emergency Response Team training.</p>
<p>We have also cancelled the basic Unix System Administration track (SA-E) this year, as it has finally been localised to most African countries, and therefore people have the opportunity to attend it locally at lower cost and build local communities. However, this leaves us with nowhere to cover more advanced systems administration techniques, which are some of my favourite topics, including:</p>
<div class="wp-caption alignright" style="width: 170px"><a href="http://www.flickr.com/photos/chris_wilson/5768063791/in/photostream"><img alt="Geert Jan with his 8-way Power over Ethernet injector" src="http://farm4.static.flickr.com/3212/5768063791_fbfc2f5f1e_m.jpg" width="160" height="240" /></a><p class="wp-caption-text">Geert Jan and the Monster Injector</p></div>
<ul>
<li>virtualisation (desktops, servers and thin clients, VirtualBox, Xen, KVM, jails, lxc)</li>
<li>system imaging (ghost, snapshots)</li>
<li>backups (snapshots, Rsync, Rdiff-backup, Duplicity)</li>
<li>file servers (NFS, Samba, sshfs, AFS, ZFS)</li>
<li>virtualised storage (iSCSI, ATAoE, Fibre Channel, DRBD)</li>
<li>cloud computing (Amazon and Linode virtual servers, scripting and APIs)</li>
<li>cluster computing (Mosix, virtual machine host clusters)</li>
<li>DHCP (for network management and booting)</li>
<li>network security (firewalls, port locking, 802.1x)</li>
<li>wireless networks (planning, monitoring, troubleshooting, WEP and WPA, 802.1x authentication)</li>
<li>Windows domains and security (including Samba 4)</li>
</ul>
<p>If participants show enough interest in these topics, they could be added in future. I think it&#8217;s unfortunate that the course is arranged into week-long tracks rather than half-day or one-day sessions from which people could pick and choose, Bar Camp style. That would make it much easier for people to run sessions on many new topics.</p>
<div class="wp-caption alignright" style="width: 170px"><a href="http://www.flickr.com/photos/chris_wilson/5768568162/in/photostream"><img alt="Stacked up computers" src="http://farm4.static.flickr.com/3560/5768568162_e46ef5dd97_m.jpg" title="Stacked up computers" width="160" height="240" /></a><p class="wp-caption-text">Some of our 80 desktop computers</p></div>
<p>In the past this would have been difficult, because we provided desktop computers for participants. It used to take us 3-4 days to set up 80-odd desktop PCs with customised FreeBSD installations. We&#8217;ve noticed that more and more people are coming to the workshops with their laptops, and this time we&#8217;ve made a big effort to shift from dedicated to virtual platforms, to reduce setup time and costs in future.</p>
<p>The hardest track to do this for, in my opinion, was <a href="http://www.ws.afnog.org/afnog2011/sse/index.html">Scalable Services English</a> (SS-E), the one I&#8217;m working on. We were all pretty much agreed to stay with desktop PCs this year, making us the only track to do so. But when we arrived, we discovered that the mains power situation here is pretty awful. On Wednesday we had four power failures. We only have five UPS, not nearly enough to protect every desktop.</p>
<p>For participants with laptops, they effectively have their own built-in UPS. If we give them virtual machines to work with, then we only have to protect the hosts. We can keep those in the NOC (Network Operations Centre), where the UPS are, so they&#8217;ll be protected for around 15 minutes of any power outage, which we have to hope will be enough for the hotel to start their generator.</p>
<div class="wp-caption alignright" style="width: 170px"><a href="http://www.flickr.com/photos/chris_wilson/5768062067/in/photostream"><img alt="Cannibalising RAM" src="http://farm6.static.flickr.com/5145/5768062067_366b9f17e4_m.jpg" title="Cannibalising RAM" width="160" height="240" /></a><p class="wp-caption-text">Cannibalising RAM</p></div>
<p>Some participants will probably forget their laptops, so we&#8217;ll provide them with desktops, but we have no way to UPS them. These desktops will be set up with FreeBSD, <a href="http://blog.aptivate.org/2010/07/22/free-system-imaging-using-g4l/">as in previous years</a>.</p>
<p>We rented 80 machines from a local company. Some had Windows, in varying states of repair, some had no operating system installed. We decided to use some of these desktops as hosts for the participants&#8217; virtual machines.They only had 2 GB of RAM each, but since we had plenty, we cannibalised eight others for their RAM to upgrade our machines to 4 GB each.</p>
<p>We decided to use VirtualBox for the virtual machines. It&#8217;s free, open source, can host on all major platforms (Windows, Mac, Linux and even <a href="http://wiki.freebsd.org/VirtualBox">FreeBSD</a>), has a nice GUI and a command-line automation tool, supports bridged networking easily, and is relatively fast and efficient.</p>
<div class="wp-caption alignright" style="width: 250px"><a href="http://www.flickr.com/photos/chris_wilson/5768060603/in/photostream"><img alt="Backs of systems being imaged" src="http://farm3.static.flickr.com/2701/5768060603_c87a822c98_m.jpg" width="240" height="160" /></a><p class="wp-caption-text">Imaging backend</p></div>
<p>We configured the master (that we&#8217;ll copy onto the other machines) starting with the <a href="http://blog.aptivate.org/2010/07/22/free-system-imaging-using-g4l/">setup from last year</a>. We then had to install VirtualBox and build our first virtual machine inside it. Then we discovered that the virtual machine was unable to access the network in bridged mode. Packets sent by the virtual machine we simply never sent by the host. We needed to use bridged mode so that participants could run services on their machines simply by installing them. without requiring extra configuration on the host.</p>
<p>We had no Internet access for most of that day, because all three of our redundant providers were down for different reasons. Eventually we managed to use Geert Jan&#8217;s 3G dongle to get online and research the problem. We found that <a href="http://forums.freebsd.org/showthread.php?t=22773">bridged networking doesn&#8217;t work</a> in the binary package of VirtualBox 3.2.12 that comes with FreeBSD 8.2, so we had to wait until Internet access was fixed to download 120 MB of software (ports updates and VirtualBox 4.0.8) like this:</p>
<div class="wp-caption alignright" style="width: 170px"><a href="http://www.flickr.com/photos/chris_wilson/5768058967/in/photostream"><img alt="Michuki Mwangi configuring a PC for imaging" src="http://farm4.static.flickr.com/3281/5768058967_76c5ded76f_m.jpg" width="160" height="240" /></a><p class="wp-caption-text">Imaging frontend</p></div>
<pre>
pkg_add -r portupgrade
portsnap fetch extract update
portupgrade virtualbox-ose virtualbox-ose-kmod
</pre>
<p>This took a long time, as VirtualBox is a large piece of software which also required us to download and build a new version of QT, but eventually it succeeded and the problem was solved.</p>
<p>We decided to put only five virtual machines on each host. Sometimes we would have the whole class compiling software from ports, which would slow down all of them significantly. We will use six or seven servers to host 30-35 virtual machines. On the master host, we created five copies of our master virtual machine by copying its hard disk like this:</p>
<pre>
cd .VirtualBox/HardDisks
for i in 1 2 3 4 5; do
	cp AfNOG\ SSE\ Master.vdi vm0$i.vdi
	VBoxManage internalcommands sethduuid vm0$i.vdi
done
</pre>
<div class="wp-caption alignright" style="width: 250px"><a href="http://www.flickr.com/photos/chris_wilson/5768051191/in/photostream"><img alt="Moving the systems to the NOC" src="http://farm3.static.flickr.com/2727/5768051191_85e48a532a_m.jpg" width="240" height="160" /></a><p class="wp-caption-text">Relocation</p></div>
<p>Then we created the virtual machines in the VirtualBox GUI and attached them to these new images. We needed to generate a new UUID for each disk image copy, using the undocumented <code>sethduuid</code> command above, otherwise VirtualBox would refuse to add the copies because it had a disk image already registered with the same UUID.</p>
<p>We could have created the virtual machines using the <code>VBoxManage</code> command as well, but it would have taken longer to work out how to use it than simply to create the five machines by hand. I later worked out the commands that we could have used:</p>
<pre>
cd ~/"VirtualBox VMs"
for i in {1..5}; do
	echo $i
	vmname=VM0$i
	diskimage="$vmname/FreeBSD.vdi"
	VBoxManage createvm --name "$vmname" --ostype FreeBSD
	VBoxManage modifyvm "$vmname" --memory 256 \
		--nic1 bridged --bridgeadapter1 bge0.219 \
		--nic2 bridged --bridgeadapter2 bge0.$[50+$i] \
		--vram 4 --pae off --audio none --usb on \
		--uart1 0x3f8 4 --uartmode1 server /home/chris/"$vmname"-console.pipe
	VBoxManage storagectl "$vmname" --name "IDE Controller" --add ide
	cp VM01/FreeBSD.vdi "$diskimage"
	VBoxManage internalcommands sethduuid "$diskimage"
	VBoxManage storageattach "$vmname" --storagectl "IDE Controller" \
		--port 0 --device 0 --type hdd --medium "$diskimage"
done
</pre>
<p>We named the images VM01 to VM05, which was important for running automated scripts on them. Then we configured VirtualBox to start them automatically at boot time, in headless mode, by adding the following lines to <code>/etc/rc.conf</code>:</p>
<pre>
vboxheadless_enable="YES"
vboxheadless_machines="VM01 VM02 VM03 VM04 VM05"
vboxheadless_user="inst"
</pre>
<p>We wrote a short script to help us apply the same command to all five virtual machines:</p>
<pre>
#!/bin/sh
# script to control all five virtual machines

command=$1
shift

for i in 1 2 3 4 5; do
	VBoxManage $command VM0$i "$@"
done
</pre>
<p>This allows us to log into a machine and do things like:</p>
<ul>
<li><code>./manage acpipowerbutton</code> to initiate a controlled shutdown of all five virtual machines</li>
<li><code>./manage modifyvm --macaddress1 auto</code> to generate new, random MAC addresses after cloning the host</li>
<li><code>./manage startvm --type headless</code> to get the virtual machines running again (headlessly, independent of the GUI)</li>
</ul>
<div class="wp-caption alignright" style="width: 250px"><a href="http://www.flickr.com/photos/chris_wilson/5768037931/in/photostream"><img alt="Room with desks around the edge, covered in computers and equipment" src="http://farm6.static.flickr.com/5101/5768037931_50ec9e4a70_m.jpg" width="240" height="160" /></a><p class="wp-caption-text">The NOC</p></div>
<p>We knew that we wouldn&#8217;t have space to attach monitors and keyboards to all the hosts, and we&#8217;d have to fiddle about with cables in the hot NOC room (without working aircon) if we needed access to their consoles, so we added the ability to log into them remotely using VNC and GDM. To do this, we had to install the VNC server:</p>
<pre>
pkg_add -r vnc
</pre>
<p>Which unfortunately doesn&#8217;t come with the nice <code>xorg</code> loadable module that adds a built-in VNC server to the X server, making a fast and stateless remote control session possible. So we had to hack about with <code>inetd</code>, first by adding a service name with a port number to <code>/etc/services</code>:</p>
<pre>
vnc		5900/tcp
</pre>
<p>And then a service line in <code>/etc/inetd.conf</code>:</p>
<pre>
vnc	stream	tcp	nowait		root	/usr/local/bin/Xvnc Xvnc -inetd :1 -query localhost -geometry 1024x768 -depth 24 -once -fp /usr/local/lib/X11/fonts/misc/ -securitytypes=none
</pre>
<p>This requires us to enable the XDMCP protocol in GDM, in order for VNC to communicate with it to present a GDM login screen. So we replaced the contents of <code>/usr/local/etc/gdm/custom.conf</code> with the following:</p>
<pre>
[xdmcp]
Enable=true

[security]
DisallowTCP=false
</pre>
<p>And then restarted GDM:</p>
<pre>
sudo /usr/local/etc/rc.d/gdm restart
</pre>
<p>And checked that we could connect from another machine and got a login prompt:</p>
<pre>
vncviewer 196.200.217.128
</pre>
<p>Which did indeed give us a working login screen:</p>
<div id="attachment_794" class="wp-caption aligncenter" style="width: 510px"><a href="http://blog.aptivate.org/?attachment_id=794"><img src="http://blog.aptivate.org/wp-content/uploads/2011/05/afnog-vnc-freebsd-gdm-screenshot-500x312.png" alt="VNC graphical login on a FreeBSD virtual machine host" title="VNC graphical login on a FreeBSD virtual machine host" width="500" height="312" class="size-large wp-image-794" /></a><p class="wp-caption-text">VNC graphical login on a FreeBSD virtual machine host</p></div>
<p>This method is very slow. I wanted to find a better way to access the guests, especially if their network configuration was broken. I tried to connect a host serial port to a pipe and then access that pipe from a shell command, eventually over ssh, in a similar way to the text-only console offered by Xen (<code>xm console</code>). The above <code>VBoxManage</code> commands set up a pipe in my home directory, and I wrote the following short script to access it:</p>
<pre>
#!/bin/sh
set -x
echo "Console for $USER"
nc -U /home/chris/$USER-console.pipe
</pre>
<p>I created user accounts for each virtual machine, with the same name, and set their shells to this script, so that when they log in, they would automatically be connected to the pipe. However I was unable to make it work well. In particular, because of incompatible terminal emulations, I was unable to run <code>vi</code> to edit configuration files in the guest. If you find a way around this, please let me know. I haven&#8217;t tried it yet, but <a href="http://code.google.com/p/conman/">conman</a> looks like it might be a good bet.</p>
<p>I spent a long time searching for the hidden VNC support in VirtualBox 4. It&#8217;s undocumented (the manual only talks about RDP) and people on the IRC channel say that it doesn&#8217;t exist, but it does, at least when starting the guests in headless mode. I added the following lines to <code>/etc/rc.conf</code>:</p>
<pre>
vboxheadless_VM01_flags="-n -m 5901"
vboxheadless_VM02_flags="-n -m 5902"
vboxheadless_VM03_flags="-n -m 5903"
vboxheadless_VM04_flags="-n -m 5904"
vboxheadless_VM05_flags="-n -m 5905"
</pre>
<p>And then, after starting the guests in headless mode, I could connect to these ports and access the virtual displays, much more conveniently and much faster than by shutting down the guests using <code>VBoxManage</code> and starting them again using the <code>VirtualBox</code> GUI.</p>
<p>We <a href="http://blog.aptivate.org/2010/07/22/free-system-imaging-using-g4l/">used multicast</a> to image the six virtual machine hosts from the master. This took about three hours, so we left it running overnight.</p>
<p>In the morning we checked that the hosts had been imaged successfully by booting them with their newly installed images, and gave them unique hostnames  (<code>host1.sse.ws.afnog.org</code> etc.) and IP addresses. </p>
<p>We used the <code>manage</code> script to reset the MAC addresses of the network cards of each virtual machine on each host:</p>
<pre>
for i in 128 129 130 131 132 133 134; do ssh 196.200.217.$i ./manage acpipowerbutton; done
for i in 128 129 130 131 132 133 134; do ssh 196.200.217.$i ./manage modifyvm --macaddress1 auto; done
for i in 128 129 130 131 132 133 134; do ssh 196.200.217.$i ./manage startvm; done
</pre>
<div class="wp-caption alignright" style="width: 250px"><a href="http://www.flickr.com/photos/chris_wilson/5768032569/in/photostream"><img alt="Michuki Mwangi setting up a projector" src="http://farm4.static.flickr.com/3542/5768032569_8128df0ca6_m.jpg" width="240" height="160" /></a><p class="wp-caption-text">Astral projection</p></div>
<p>Since they were all configured for DHCP, we could have got their IP addresses from the DHCP server, but we wanted to give them a nice naming scheme, so we logged in to each one (using the console and the VirtualBox GUI) and assigned it a unique hostname and a static IP address.</p>
<p>We checked that we could log into each virtual machine remotely using the SSH keys that we&#8217;d installed, and then we shut down the hosts and moved them to the NOC.</p>
<p>Boot camp starts tomorrow, next door, but we still have to arrange our room.</p>
<div class="wp-caption alignright" style="width: 250px"><a href="http://www.flickr.com/photos/chris_wilson/5768794328/in/photostream"><img alt="Michuki Mwangi surrounded by rows of desks covered with computers" src="http://farm3.static.flickr.com/2128/5768794328_ece07d9c17_m.jpg" width="240" height="160" /></a><p class="wp-caption-text">Classroom</p></div>
<p>We may have up to 37 people, our biggest class ever, in a room that&#8217;s about eight metres on a side, so layout of the room is a real challenge.</p>
<p>I wanted to do something to facilitate working in groups, such as each table having four places (two each side) and with its long axis front-to-back. This was vetoed because participants would have to turn their heads to see the projected screen, and it might be hard for them to take notes as a result. </p>
<p>So we&#8217;re going to have long, cramped benches instead. I think this is unfortunate, and I hope I can persuade people to try something more imaginative in future.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.aptivate.org/2011/05/28/afnog-2011-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>System Imaging for Free using G4L</title>
		<link>http://blog.aptivate.org/2010/07/22/free-system-imaging-using-g4l/</link>
		<comments>http://blog.aptivate.org/2010/07/22/free-system-imaging-using-g4l/#comments</comments>
		<pubDate>Thu, 22 Jul 2010 13:05:34 +0000</pubDate>
		<dc:creator>Chris Wilson</dc:creator>
				<category><![CDATA[Engineer's Log]]></category>
		<category><![CDATA[Infrastructure]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[System Administration]]></category>
		<category><![CDATA[AfNOG]]></category>
		<category><![CDATA[ghost]]></category>
		<category><![CDATA[imaging]]></category>
		<category><![CDATA[installation]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[system]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://blog.aptivate.org/?p=594</guid>
		<description><![CDATA[This is a copy of the notes that I wrote at AfNOG 2010 as a guide to using system imaging at future workshops. Unfortunately that wiki is not accessible without signing up for an account, so I&#8217;m posting the information here too. How to Install Computer Labs If you ever need to set up a [...]]]></description>
			<content:encoded><![CDATA[<p>This is a copy of the <a href="http://nsrc.org/workshops/2010/afnog/wiki/SystemImaging">notes</a> that I wrote at AfNOG 2010 as a guide to using system imaging at future workshops. Unfortunately that wiki is not accessible without signing up for an account, so I&#8217;m posting the information here too.</p>
<h3>How to Install Computer Labs</h3>
<p>If you ever need to set up a large number of computers in identical configurations, you have a few options:</p>
<ul>
<li>Install each one individually by hand</li>
<li>Automate the standard install process, for example using:
<ul>
<li><a href="http://en.wikipedia.org/wiki/Windows_Automated_Installation_Kit">AIK</a> for Windows;</li>
<li><a href="https://help.ubuntu.com/7.04/installation-guide/i386/automatic-install.html">Kickstart</a> for Red Hat Linux, CentOS and Ubuntu; or</li>
<li><a href="http://people.freebsd.org/~dwhite/bsdconpaper.html">sysinstall and mfsroot</a> for FreeBSD.</li>
</ul>
</li>
<li>Configure one machine exactly how you like it, and then exactly duplicate the hard disk to the others (disk imaging)</li>
</ul>
<p>The first option (manual installation) is extremely slow, tedious, error-prone, unlikely to result in identical machines, and does not speed up future installations or reinstallations.</p>
<p>The second option requires using rarely-used and less tested parts of the installer, slows down badly with multiple simultaneous installations (due to limited network bandwidth and bugs in the inetd TFTP server), and places limits on what you can customise. For example, it seems impossible to customise <code>/etc/rc.conf</code> using the installer on FreeBSD, and pre-installing SSH keys is tricky. I spent days writing a <code>sysinstall</code> script to automate the process. It would have taken just half an hour to set one machine up perfectly by hand, and then copy the system image onto all the other PCs in a few unattended hours.</p>
<p>Therefore I prefer the third option, system imaging.</p>
<h3>What is System Imaging</h3>
<p>Imaging is the process of making exact copies of one machine&#8217;s hard disk, including all partitions, onto another. This only works when the second hard disk is at least as large as the first. It works best when all the PCs are identical.</p>
<p>Imaging is independent of the operating system. You can image Windows, FreeBSD, any version of Linux, dual-boot and triple-boot installations, whatever you like.</p>
<p>We successfully used imaging to set up the PCs for these workshops:</p>
<ul>
<li><a href="http://www.ws.afnog.org/afnog2009/">AfNOG 2009</a>, Cairo, all tracks</li>
<li><a href="http://oer.aptivate.org/wiki/KBT/BMO_Training_KENET">KENET BMO Training</a>, Nairobi 2009</li>
<li><a href="http://www.ws.afnog.org/afnog2010/">AfNOG 2010</a>, Kigali, for three tracks: SA-E, SS-E and SI-F</li>
</ul>
<h3>How to Image</h3>
<p>Many systems administrators have heard of <a href="http://www.symantec.com/norton/ghost">Norton Ghost</a> and <a href="http://www.acronis.com/homecomputing/products/trueimage/index.html">Acronis True Image</a>, two of the most popular commercial applications.</p>
<p>However, open source alternatives such as <a href="http://freshmeat.net/projects/g4l/">G4L</a> (Linux-based) and its ancestor <a href="http://www.feyrer.de/g4u/">G4U</a> (FreeBSD-based) are pretty good, and completely free. G4L however lacks a website, and it&#8217;s not obvious how best to use it, hence this post.</p>
<p>G4L is quite similar to G4U, and I could have used G4U instead. But I find the Linux kernel&#8217;s hardware support a bit better than FreeBSD&#8217;s, and G4L supports multicasting, which enables it to install many machines at the same time with good performance.</p>
<h3>Using Ghost for Linux (G4L)</h3>
<p>I&#8217;ve successfully used Ghost 4 Linux (G4L) versions 0.27 and 0.33 for this process. 0.33 has multicast support, which allows setting up an entire room in one go, without wasting network bandwidth copying the same 4 GB disk image to each of 50 machines independently.</p>
<p>Set up an FTP server on your network with an account that supports downloads and uploads (e.g. on a local server on your network). Make sure it has plenty of disk space free, perhaps 40 GB. Create an &#8220;img&#8221; directory under the FTP user&#8217;s home directory for the images.</p>
<p>Download G4L and burn some CDs, maybe about five copies, or set up network booting (this conflicts with FreeBSD PXE installation and may require BIOS setup changes to enable PXE).</p>
<p>It&#8217;s a good idea to explore G4L and get used to the options, but please <strong>be very careful</strong>, as it has the potential to wipe your hard disk! So please use a machine with a fresh hard disk or which you don&#8217;t mind wiping.</p>
<p>To boot into G4L (you will need to do this several times below, but not yet, unless you just want to explore):</p>
<ul>
<li>Reboot or power up the machine</li>
<li>Press the key to choose boot device</li>
<li>If CD-ROM is not on the list, reboot, go into the BIOS and enable booting from CD-ROM</li>
<li>Choose to boot from the CD</li>
<li>Choose the default kernel at the GRUB screen (just press Enter)
<ul>
<li>If for some reason the default kernel doesn&#8217;t work, the machine hangs or crashes or doesn&#8217;t detect the network interface, then try one or two other kernels</li>
</ul>
</li>
<li>Wait for the kernel and initrd to be loaded (two long lines of dots)</li>
<li>Then you can remove the CD, about one minute from cold boot, and start booting another PC</li>
<li>Press space to skip each of the information/advertising screens (about 8 of them)</li>
<li>Enter <code>g4l</code> at the prompt (if you go past this and get a shell, just type <code>g4l</code> at the shell prompt)</li>
<li>You can access other consoles with Ctrl-Alt-F1 to F4, log in as <code>g4l</code> with no password, and run <code>g4l</code>, <code>ifconfig</code>, <code>ping</code> or whatever</li>
<li>Choose <em>Network Use</em> (default)</li>
<li>Choose <em>Raw Mode</em> (default)</li>
<li>Check that you have an IP address (option B) or try again to acquire one by DHCP</li>
<li>If you can&#8217;t get an IP address by DHCP, check your cabling and DHCP server</li>
</ul>
<h3>Create a Restore Image (optional)</h3>
<p>Back up one of your PCs if necessary (if you plan to restore the PCs later) by:</p>
<ul>
<li>Follow the procedure above to get into Ghost for Linux</li>
<li>Enter the FTP server&#8217;s IP address, username and password</li>
<li>Choose an image name, e.g. <code>backup_original_2010_07_22.img</code></li>
<li>Choose the <em>back up</em> option</li>
<li>Press Space to select the entire disk (mark it with an asterisk [*])</li>
<li>Start backing up the image</li>
</ul>
<p>This process can take 1-2 hours. In the mean time&#8230;</p>
<h3>Set up the Master PC</h3>
<p>If you don&#8217;t already have a master computer set up, it&#8217;s a good idea to WIPE THE DISK first. This makes the image much smaller, and transfer much faster. Please DO NOT do this if you have anything valuable on the master computer, for example an existing operating system installation that you want to keep.</p>
<p>Boot G4L on the PC that you will use as the master. Use DD to wipe the entire disk with zeroes:</p>
<pre>
dd if=/dev/zero of=/dev/sda bs=1M
</pre>
<p>Install FreeBSD or whatever operating system(s) on the master PC, and set it up exactly the way you want all of the PCs to be. Examples include:</p>
<ul>
<li>Install Gnome (gnome/gnome2)</li>
<li>Install Xorg (x11/xorg)</li>
<li>Install Firefox (www/firefox35)</li>
<li>Install Xpdf (print/xpdf)</li>
<li>Enable gnome and sshd in <code>/etc/rc.conf</code>, and add templates for the IP address configuration (this saves typing when setting all the machines to static IPs):
<pre>
hostname="pc01.sse.ws.afnog.org"
ifconfig_bge0="dhcp"
# ifconfig_bge0="196.200.219.101/24"
defaultrouter="196.200.219.254"
gnome_enable="YES"
sshd_enable="YES"
</pre>
</li>
<li>Create a user account (e.g. username <code>afnog</code>, password <code>afnog</code>)</li>
<li>Log into Gnome, add firefox, terminal and the Downloads folder to your toolbar, and remove epiphany and evolution</li>
<li>Edit /etc/fstab and add the proc filesystem:
<pre>
proc /proc procfs rw 0 0
</pre>
<p>(this allows GDM to display the user list and shut down and restart the machine)</li>
<li>Edit /etc/profile and set the default pager to less by adding:
<pre>
PAGER=less; export PAGER
</pre>
</li>
<li>Set the timezone by softlinking <code>/etc/localtime</code> to something like /usr/share/zoneinfo/Africa/Kigali</li>
<li>Create <code>/etc/rc.local</code> and have it run <code>/usr/sbin/ntpd -qg</code> to set the time once at boot</li>
</ul>
<p>I recommend using DHCP on this machine. Otherwise all the imaged machines will boot up with the same IP address, causing IP address conflicts, and you will have to reconfigure them before you can access the Internet at all, or reconfigure them automatically.</p>
<p>Create some SSH keys for use in administering the machines. You may wish to set up the local server already and generate the keys there for security. I recommend adding the keys to <code>/root/.ssh/authorized_keys</code>. Please test that they work, and that sshd comes up automatically after boot!</p>
<h3>Imaging the other PCs</h3>
<p>On all the PCs (master and clones):</p>
<ul>
<li>Boot G4L as above</li>
<li>Check that it has an IP address (option B)</li>
</ul>
<p>Once a master is online, all the PCs will show &#8220;press any key to start&#8221;. Pressing any key on any computer will start all the machines imaging. If any PCs are not ready yet, you will have to cancel the imaging process on all of them and start again, or image those PCs later. So:</p>
<p><strong>Start the master last!</strong> (when all the other PCs are ready)</p>
<p>Start the clones first, by following these steps on each one:</p>
<ul>
<li>Choose UDP Multicast Client (option U)</li>
<li>Select the entire disk, <code>/dev/sda</code> with the space key</li>
<li>Say yes, you&#8217;re sure</li>
<li>When it says &#8220;Compressed UDP receiver&#8221;, it&#8217;s ready and waiting for a master to appear on the network</li>
</ul>
<p>Then start the master:</p>
<ul>
<li>Get ALL the clones ready, as above, before doing this!</li>
<li>On the master, choose UDP Multicast Server (option W)</li>
<li>Select the entire disk, <code>/dev/sda</code>, with the space key</li>
<li>Leave the options blank</li>
<li>Say yes, you&#8217;re sure</li>
<li>The master start accepting connections from clients, which will happen automatically. The screens on the clients will also change.</li>
<li>Please check that every client says &#8220;Press any key to start&#8221;.</li>
<li>If not, please check it for network problems, etc.</li>
<li><strong>DO NOT</strong> stop or kill the server now, unless you want to visit every client again!</li>
<li>You can press Ctrl+C <strong>on the client</strong> and run <code>g4l</code> again to check the IP address, retry DHCP, and try the UDP Multicast Client option again.</li>
<li>This is your last chance to join any remaining clients to the group for this imaging session!</li>
<li>When all the clients are ready, press a key on the master to start transfer.</li>
</ul>
<p>The master will show progress of the transfer, and an error line if any clients fail to respond. Clients that cause too many errors will be kicked out of the group and appear to &#8220;finish&#8221; early.</p>
<p>It&#8217;s difficult to tell if the imaging process finished successfully or failed on the clients. However it appears that FreeBSD is very good at detecting filesystem corruption, and will fail to boot if the image was not completely transferred. So you can test them by trying to boot FreeBSD and seeing if it boots completely or stops with a filesystem error. Ideally this would be improved in future versions of G4L.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.aptivate.org/2010/07/22/free-system-imaging-using-g4l/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Large Wireless Networks</title>
		<link>http://blog.aptivate.org/2010/01/05/wireless-networks-for-2000-clients/</link>
		<comments>http://blog.aptivate.org/2010/01/05/wireless-networks-for-2000-clients/#comments</comments>
		<pubDate>Tue, 05 Jan 2010 21:23:07 +0000</pubDate>
		<dc:creator>Chris Wilson</dc:creator>
				<category><![CDATA[Appropriate Technology]]></category>
		<category><![CDATA[Infrastructure]]></category>
		<category><![CDATA[AfNOG]]></category>
		<category><![CDATA[deployment]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[Wireless]]></category>

		<guid isPermaLink="false">http://blog.aptivate.org/?p=233</guid>
		<description><![CDATA[I saw an interesting request on the AfNOG mailing list: How does one determine the number of users,  a wireless network can support. I need to buy a wireless router to support 2000 users within an organization. The problem is how do I determine this capability given the specs of the wireless router. To put it [...]]]></description>
			<content:encoded><![CDATA[<p>I saw an interesting <a title="Original message (request)" href="http://afnog.org/pipermail/afnog/2010-January/005696.html">request</a> on the AfNOG mailing list:</p>
<blockquote><p>How does one determine the number of users,  a wireless network can support. I need to buy a wireless router to support 2000 users within an organization. The problem is how do I determine this capability given the specs of the wireless router.</p>
<p>To put it in a better way &#8220;what determines the number of users a wireless router can support&#8221;[?]</p></blockquote>
<p>Although I&#8217;m not an expert on wireless networks, I have worked with them a bit, and I sent a <a title="My reply (post)" href="http://afnog.org/pipermail/afnog/2010-January/005697.html">reply</a> that might be useful to others (I hope).</p>
<p>I&#8217;m not sure there&#8217;s an easy answer to that question. Some factors that may influence the decision are:</p>
<ul>
<li>The total bandwidth available to a single wireless access point (AP), e.g. 54 MBps for an 802.11g router. This also depends on the level of 802.11 that the clients support. An 802.11b client will use much more airtime per packet than an 802.11g client, so if most of your clients are 802.11b then you won&#8217;t get more than 11MBps per AP, regardless of the theoretical maximum of the AP.</li>
<li>The frequency space available. There are only three non-overlapping 802.11b bands (maybe fewer for 802.11g), so no matter how many APs you have, the most bandwidth you could get in a given spot cannot be more than three times the bandwidth of one AP. Also, if they form a contiguous roaming network (same SSID and key) you have little or no control over which one a client will associate with, so you can&#8217;t evenly divide the available bandwidth between the three that you can see.</li>
<li>The guard time between different transmissions and for RTS/CTS round trips. This will cut your available bandwidth at least in half from the theoretical maximum, and more if you have hidden nodes (which is close to inevitable with thousands of clients, unless they are all in the same room).</li>
<li>The maximum number of clients that can associate with a given router. Most APs don&#8217;t publish this number, but Cradlepoint routers can handle <a href="http://www.cradlepoint.com/knowledge-base/maximum-clients-router">between 4 and 64 clients per router</a>. Keenan Systems <a href="http://www.keenansystems.com/wififaq.htm">reckons</a> that &#8220;Once you have more than 25 clients associated most access points start to break down&#8221;. I&#8217;d guess that Cisco kit has the highest limit, especially the professional versions (not Linksys branded) and el cheapo generic Chinese kit has the lowest.</li>
<li>If the AP is serving DHCP and running NAT (acting as a router as well as an AP) then the translation and DHCP tables of the router will be a limit. Some router DHCP servers only allow class C subnets, with a maximum of 253 usable client IP addresses per AP. It&#8217;s probably more advisable to use a real machine (with a hard disk) as a DHCP server.</li>
<li>Similarly, if you don&#8217;t do NAT on the AP, then whatever handles the NAT on your Internet gateway will see the IPs of the individual machines, and will therefore need to be able to handle however many simultaneous IPs your clients have, and connections that they make.</li>
<li>Whatever your DHCP server, the number of IPs available in your network subnet will limit the number of clients who can have a valid unique IP address at one time.</li>
<li>The bandwidth of your Internet connection. The minimum that I&#8217;ve seen working at all is 3kbps per client, or 6 MBps with 2000 clients. That should be real bandwidth, not contended upstream by the ISP, otherwise multiply by the contention ratio. Don&#8217;t forget to include your fixed clients as well.</li>
</ul>
<p>The best advice I can give you, never having built a wireless network this large myself, is to:</p>
<ul>
<li>Grit your teeth and buy the best kit you can find on the market. Be prepared to pay through the nose, e.g. $1000 per AP or more.</li>
<li>Talk to the manufacturers about the maximum number of associated clients, and get assurances in writing that their kit can handle the load. Preferably get them to propose a solution for 2000 clients, also in writing.</li>
<li>Use small cells with directional antennae and lots of APs in areas where you expect more than 10 clients at peak times.</li>
<li>Try to scale your network up smoothly rather than buying a complete solution in one go. Don&#8217;t try to support 2000 clients in the first year, let alone the first day.</li>
<li>Monitor and graph the performance of the network, particularly bandwidth, wireless contention, number of errors and number of associated clients, and identify hotspots.</li>
<li>Keep one or two APs spare, and deploy them in the areas that are seeing the most activity.</li>
</ul>
<p>Sunday Folayan <a title="Sunday Folayan's post" href="http://afnog.org/pipermail/afnog/2010-January/005698.html">wrote</a>:</p>
<blockquote><p>Must this network be implemented with JUST ONE wireless router? With one router &#8230; If you run 802.11bg at 2.4ghz, you have just about 2Mbps of bandwidth to play with, from one AP. If you deploy 802.11a at 5.8Ghz, you should get better than 10Mbps. If any of the clients is 802.11bg, the AP will default to 802.11bg, even if it is capable of 802.11a. With 2000 users, that is an average of 1Kbps or 5kbps at the best per subscriber! Could this be what you want?</p>
<p>To put it in a different way &#8230; One single AP cannot do it.</p></blockquote>
<p>And Hervey Allen <a title="Hervey Allen's post" href="http://afnog.org/pipermail/afnog/2010-January/005699.html">wrote</a>:</p>
<blockquote><p>From what I&#8217;ve experienced wireless router specifications and claims often do not match what you will experience in real-world use. I know of several large-scale installations (10,000+ users and above) who ended up using Cisco Aironet series routers with Power over Ethernet capabilities (PoE).</p>
<p>I will double-check, but last time I was on-site the upper limit for one of these wireless routers was around 50 concurrent users with light to moderate use. That is, a single user running a torrent can make an access point almost unusable for the other 49 potential users&#8230;</p>
<p>It would be interesting to hear from others on the list who have large wireless installations what their experience has been, and what hardware they have used.</p>
<p>Issues of giving out addresses, roaming, recapturing addresses, etc&#8230; are quite important.</p></blockquote>
<p>Patrick Okui wrote:</p>
<blockquote><p>Joel Ja did a pretty good <a href="http://nanog.org/meetings/nanog27/presentations/joel.pdf">presentation</a> on what he&#8217;s learned from setting up wifi installations for the various meetings/events at NANOG27. A few things have changed in the wifi world since 2003 but the concepts are still valid.</p></blockquote>
<p>Hamish Downer wrote in a comment to this post:</p>
<blockquote><p><a href="http://serverfault.com/questions/72767/why-is-internet-access-and-wi-fi-always-so-terrible-at-large-tech-conferences">This page</a> has some good answers. It is about tech conferences, but the basic problem of getting lots of people on wifi in a single space is covered by the solutions.</p></blockquote>
<p>I fully agree with Hamish, the page has excellent advice from people who have actually done this, unlike me.</p>
<p>Finally, Mark Tinka replied:</p>
<blockquote><p>I generally wouldn&#8217;t recommend vendors on a public mailing list in such variable matters as wireless deployments, but given the scale you&#8217;re considering, Aruba came to see me once (uninvited, as usual), and they seemed to have some rather interesting things to say re: their wireless product portfolio, with particular regard to <a href="http://www.arubanetworks.com/solutions/large_site.php">large scale installations</a>.</p>
<p>You might want to add them to your shopping list, but my guess is the price point is way-up-there, what with their controllers and all.</p>
<p>But be careful about &#8220;buying&#8221; everything they tell you (same goes for other vendors). As others have mentioned, binding assurances from them as well as PoC&#8217;s (proof of concept) before you sign would be great!</p></blockquote>
<p>I hope this helps someone. Please let us know how you get on.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.aptivate.org/2010/01/05/wireless-networks-for-2000-clients/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

