<?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>John&#039;s Tidbits &#187; Bulletproof</title>
	<atom:link href="http://inodes.org/tag/bulletproof/feed/" rel="self" type="application/rss+xml" />
	<link>http://inodes.org</link>
	<description>Moo - Development, Trouble-shooting and Random thoughts...</description>
	<lastBuildDate>Thu, 19 Apr 2012 10:15:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
		<item>
		<title>Mac OS X L2TP VPN to Cisco IOS</title>
		<link>http://inodes.org/2008/12/16/mac-os-x-l2tp-vpn-to-cisco-ios/</link>
		<comments>http://inodes.org/2008/12/16/mac-os-x-l2tp-vpn-to-cisco-ios/#comments</comments>
		<pubDate>Tue, 16 Dec 2008 07:45:46 +0000</pubDate>
		<dc:creator>johnf</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Bulletproof]]></category>
		<category><![CDATA[cisco]]></category>
		<category><![CDATA[mac os x]]></category>
		<category><![CDATA[networking]]></category>

		<guid isPermaLink="false">http://inodes.org/blog/?p=108</guid>
		<description><![CDATA[Just spent a couple of hours trying to get a Mac OS X laptop connected to a Cisco IOS IPSEC/L2TP server. The existing configuration worked fine for windows and linux servers but the Mac just refused to establish a connection. The Cisco logs contained the usual cryptic message. Dec 16 16:53:47.955: IPSEC(validate_proposal_request): proposal part #1, [...]]]></description>
			<content:encoded><![CDATA[<p>Just spent a couple of hours trying to get a Mac OS X laptop connected to a Cisco IOS IPSEC/L2TP server. The existing configuration worked fine for windows and linux servers but the Mac just refused to establish a connection. The Cisco logs contained the usual cryptic message.</p>

<div class="wp_syntax"><div class="code"><pre class="cisco" style="font-family:monospace;">Dec 16 16:53:47.955: IPSEC(validate_proposal_request): proposal part #1,
  (key eng. msg.) INBOUND local= 117.53.171.241, remote= 124.171.30.131,.
    local_proxy= 117.53.171.241/255.255.255.255/17/1701 (type=1),.
    remote_proxy= 124.171.30.131/255.255.255.255/17/1701 (type=1),
    protocol= ESP, transform= esp-3des esp-sha-hmac  (Transport-UDP),.
    lifedur= 0s and 0kb,.
    spi= 0x0(0), conn_id= 0, keysize= 0, flags= 0x800
Dec 16 16:53:47.955: Crypto mapdb : proxy_match
    src addr     : 117.53.171.241
    dst addr     : 124.171.30.131
    protocol     : 17
    src port     : 1701
    dst port     : 49561
Dec 16 16:53:47.955: map_db_find_best did not find matching map
Dec 16 16:53:47.955: IPSEC(validate_transform_proposal): no IPSEC cryptomap exists for local address A.B.C.D</pre></div></div>

<p>After much googling I discovered that the problem was <em> dst port: 49561 </em>. Unlike most other L2TP clients the Mac uses a random source port for the L2TP part of the connection. Most others use 1701 for source and destination.</p>
<p>So relaxing this</p>

<div class="wp_syntax"><div class="code"><pre class="cisco" style="font-family:monospace;">ip access-list extended L2TP
 permit udp host 117.53.171.241 eq 1701 any eq 1701</pre></div></div>

<p>to this</p>

<div class="wp_syntax"><div class="code"><pre class="cisco" style="font-family:monospace;">ip access-list extended L2TP
 permit udp host 117.53.171.241 eq 1701 any</pre></div></div>

<p>solved the problem.</p>
<p>It would now normally be the time for me to rant about how IPSEC has to be one of the most badly implemented protocols by all vendors and how getting two different implementations to talk to each other always takes a minimum of 2 hours even if you&#8217;ve done it before but it would just be too exhausting.</p>
]]></content:encoded>
			<wfw:commentRss>http://inodes.org/2008/12/16/mac-os-x-l2tp-vpn-to-cisco-ios/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Melbourne Cup Dip2</title>
		<link>http://inodes.org/2008/11/04/melbourne-cup-dip2/</link>
		<comments>http://inodes.org/2008/11/04/melbourne-cup-dip2/#comments</comments>
		<pubDate>Tue, 04 Nov 2008 07:08:11 +0000</pubDate>
		<dc:creator>johnf</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[Bulletproof]]></category>
		<category><![CDATA[cup]]></category>
		<category><![CDATA[melbounre]]></category>
		<category><![CDATA[networking]]></category>

		<guid isPermaLink="false">http://inodes.org/blog/?p=80</guid>
		<description><![CDATA[To quote Justaan: This is what we call the Melbourne Cup Network Effect It seems it really is the race that stops the nation. This is a graph of Bulletproof&#8217;s outbound web traffic for today. That&#8217;s a 37% drop in outbound traffic just after 3pm. Make sure you take note of my l33t gimp skills!]]></description>
			<content:encoded><![CDATA[<p>To quote Justaan:</p>
<blockquote><p>This is what we call the Melbourne Cup Network Effect</p></blockquote>
<p><img title="mel_cup" src="http://inodes.org/blog/wp-content/uploads/2008/11/mel_cup.png" alt="Melbourne Cup network effect" width="500" height="236" /></p>
<p>It seems it really is the race that stops the nation. This is a graph of Bulletproof&#8217;s outbound web traffic for today. That&#8217;s a 37% drop in outbound traffic just after 3pm.</p>
<p>Make sure you take note of my l33t gimp skills!</p>
]]></content:encoded>
			<wfw:commentRss>http://inodes.org/2008/11/04/melbourne-cup-dip2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SFD2006 &#8211; Return to sender</title>
		<link>http://inodes.org/2007/07/11/sfd2006-return-to-sender/</link>
		<comments>http://inodes.org/2007/07/11/sfd2006-return-to-sender/#comments</comments>
		<pubDate>Tue, 10 Jul 2007 23:57:19 +0000</pubDate>
		<dc:creator>johnf</dc:creator>
				<category><![CDATA[FOSS]]></category>
		<category><![CDATA[Bulletproof]]></category>
		<category><![CDATA[justblamepia]]></category>
		<category><![CDATA[SFD]]></category>

		<guid isPermaLink="false">http://inodes.org/blog/2007/07/11/sfd2006-return-to-sender/</guid>
		<description><![CDATA[Pia posting about Software freedom day, software freedom day online shop is up, reminded me about something I&#8217;ve been meaning to post for a while. When you send in the address to get your team&#8217;s t-shirts and goodies, make sure you get it right! Last year I helped pack all the goodies that we sent [...]]]></description>
			<content:encoded><![CDATA[<p>Pia posting about Software freedom day, <a href="http://pipka.org/blog/2007/07/10/software-freedom-day-online-shop-is-up/">software freedom day online shop is up</a>, reminded me about something I&#8217;ve been meaning to post for a while.</p>
<p>When you send in the address to get your team&#8217;s t-shirts and goodies, make sure you get it right!</p>
<p>Last year I helped pack all the goodies that we sent overseas, this was sometime in August if I remember correctly. We needed to put a return address on the packages so I offered the use of Bulletproof&#8217;s address.</p>
<p>6 months later the following turned up on our doorstep.</p>
<p><img src="http://inodes.org/blog/wp-content/uploads/2007/07/photo-0004.jpg" /><br />
<br />
<img src="http://inodes.org/blog/wp-content/uploads/2007/07/photo-0005.jpg" /><br />
<br />
<img src="http://inodes.org/blog/wp-content/uploads/2007/07/photo-0006.jpg" /></p>
<p>Notice the use of hemp rope and wax seal. This box has been through a lot!</p>
]]></content:encoded>
			<wfw:commentRss>http://inodes.org/2007/07/11/sfd2006-return-to-sender/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>linux.conf.au brings about another change</title>
		<link>http://inodes.org/2007/03/26/linuxconfau-brings-about-another-change/</link>
		<comments>http://inodes.org/2007/03/26/linuxconfau-brings-about-another-change/#comments</comments>
		<pubDate>Sun, 25 Mar 2007 22:06:23 +0000</pubDate>
		<dc:creator>johnf</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Bulletproof]]></category>
		<category><![CDATA[lca2007]]></category>
		<category><![CDATA[vquence]]></category>

		<guid isPermaLink="false">http://inodes.org/blog/2007/03/26/linuxconfau-brings-about-another-change/</guid>
		<description><![CDATA[Being Technical Guru for linux.conf.au 2007 was one of the most amazing experiences I&#8217;ve had in recent years. It was a lot of hard work but it was totally worth it. Having a room burst into applause at the penguin dinner when you say your the network guy is pretty unbelievable. I went up to [...]]]></description>
			<content:encoded><![CDATA[<p>Being Technical Guru for <a href="http://lca2007.linux.org.au">linux.conf.au 2007</a> was one of the most amazing experiences I&#8217;ve had in recent years. It was a lot of hard work but it was totally worth it. Having a room burst into applause at the penguin dinner when you say your the network guy is pretty unbelievable.</p>
<p>I went up to the Hunter for a week to recover from the conference and as usual after linux.conf.au I did a lot of thinking as to whether it was time to try something new. This time change won out at the end of the day and after 6 years at <a href="http://bulletproof.net">Bulletproof</a> I decided it was time to move on.</p>
<p>At the beginning of March I started as Director of Engineering at <a href="http://www.vquence.com">Vquence</a>. Since we are a video company it was decided that we each needed to have our own <a href="http://www.vquence.com/about/john_ferlito#video">video</a> on the web.</p>
<p>The past three weeks have been so hectic that Bulletproof already seems a lifetime ago. I&#8217;ve been involved in everything from setting up the new office and the corporate infrastructure to product development.</p>
<p>Joining a startup right at the beginning is always an amazing experience. With just a few people on the ground you always get pulled in a few million directions and there is always a new challenge just another five minutes away. I definitely recommend anyone else to jump at the opportunity if it ever presents itself.</p>
]]></content:encoded>
			<wfw:commentRss>http://inodes.org/2007/03/26/linuxconfau-brings-about-another-change/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>iptables evilness</title>
		<link>http://inodes.org/2006/11/13/iptables-evilness/</link>
		<comments>http://inodes.org/2006/11/13/iptables-evilness/#comments</comments>
		<pubDate>Sun, 12 Nov 2006 22:43:10 +0000</pubDate>
		<dc:creator>johnf</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[Bulletproof]]></category>
		<category><![CDATA[itables]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://inodes.org/blog/2006/11/13/iptables-evilness/</guid>
		<description><![CDATA[Matt came to me with an interesting problem at Bulletproof this week. We have a dedicated hosting customer who talks to an external application for e-commerce. The IP for this was going to change but they needed to do to some testing before the switch. As usual with most enterprise applications, the hostname was hard [...]]]></description>
			<content:encoded><![CDATA[<p>Matt came to me with an interesting problem at <a href="http://bulletproof.net">Bulletproof</a> this week. We have a dedicated hosting customer who talks to an external application for e-commerce. The IP for this was going to change but they needed to do to some testing before the switch. As usual with most enterprise applications, the hostname was hard coded. <img src='http://inodes.org/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>Matt suggested we do some DNS poisoning or do some transparent proxying using squid or similar. While these would have worked they required firewall changes through three levels of firewalls and extra infrastructure.</p>
<p>So I turned to an evil solution, iptables. <img src='http://inodes.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   Most people use DNAT on the inbound connection from the  Internet to their internal private network to port forward to internal servers, or perform one-to-one NAT mappings. There is nothing stopping you using it the other way around.</p>
<p>Lets say that every time someone browses to <a href="http://bulletproof.net">http://bulletproof.net</a> we want them to hit <a href="http://inodes.org">http://inodes.org</a> instead. All you need to do is use DNAT to translate one IP address into the other.<br />
[code]<br />
animal:~ johnf$ host bulletproof.net<br />
bulletproof.net has address 202.44.98.174<br />
animal:~ johnf$ host inodes.org<br />
inodes.org has address 202.125.41.97<br />
animal:~ johnf$ sudo iptables -t nat -A PREROUTING -d 202.44.98.174 -j DNAT  --to 202.125.41.97</p>
<p>[/code]</p>
<p>Now for some testing, a ping looks normal</p>
<p>[code]</p>
<p>animal:~johnf$ ping www.bulletproof.net<br />
PING www.bulletproof.net.au (202.44.98.174) 56(84) bytes of data.<br />
64 bytes from 202.44.98.174: icmp_seq=1 ttl=241 time=198 ms</p>
<p>[/code]</p>
<p>but a tcpdump looks like</p>
<p>[code]</p>
<p>animal:~johnf$ sudo tcpdump -ni eth0<br />
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode<br />
listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes<br />
16:35:25.099510 IP 211.30.227.143 > 202.125.41.97: icmp 64: echo request seq 1<br />
16:35:25.301712 IP 202.125.41.97 > 211.30.227.143: icmp 64: echo reply seq 1</p>
<p>[/code]</p>
<p>Of course if anyone needs to try and debug this they are going to have a really fun time working out what is going on. <img src='http://inodes.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>If you want to test this yourself you can do it on your own machine using the OUTPUT chain instead of PREROUTING.</p>
]]></content:encoded>
			<wfw:commentRss>http://inodes.org/2006/11/13/iptables-evilness/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>ThinkingLinux &#8217;06</title>
		<link>http://inodes.org/2006/10/20/thinkinglinux-06/</link>
		<comments>http://inodes.org/2006/10/20/thinkinglinux-06/#comments</comments>
		<pubDate>Fri, 20 Oct 2006 06:32:05 +0000</pubDate>
		<dc:creator>johnf</dc:creator>
				<category><![CDATA[Presentations]]></category>
		<category><![CDATA[Bulletproof]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://inodes.org/blog/2006/10/20/thinkinglinux-06/</guid>
		<description><![CDATA[ThinkingLinux &#8217;06 was held in Melbourne a few days ago. It was organised by Synergy Plus with sponsorship by RedHat. Novel and a few others. I gave a talk on Open Source in the Data Centre. Luckily this talk was after lunch so I got to do some editing in the morning sessions to tweak [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.thinkinglinux.com.au">ThinkingLinux &#8217;06</a> was held in Melbourne a few days ago. It was organised by <a href="http://synergy.com.au">Synergy Plus</a> with sponsorship by RedHat. Novel and a few others.</p>
<p>I gave a talk on <a href="http://inodes.org/blog/presentations">Open Source in the Data Centre</a>. Luckily this talk was after lunch so I got to do some editing in the morning sessions to tweak it more towards a business rather than technical audience. <img src='http://inodes.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>The conference was pretty awesome with interesting talks, ranging from Xen to how wotif.com was started.
</p>
<p>Copies of the slides for all the talks should eventually make it onto the conference&#8217;s website.</p>
]]></content:encoded>
			<wfw:commentRss>http://inodes.org/2006/10/20/thinkinglinux-06/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Open Source in the Data Centre</title>
		<link>http://inodes.org/2006/10/12/open-source-in-the-data-centre/</link>
		<comments>http://inodes.org/2006/10/12/open-source-in-the-data-centre/#comments</comments>
		<pubDate>Wed, 11 Oct 2006 22:24:36 +0000</pubDate>
		<dc:creator>johnf</dc:creator>
				<category><![CDATA[Presentations]]></category>
		<category><![CDATA[Bulletproof]]></category>
		<category><![CDATA[justblamepia]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://inodes.org/blog/2006/10/12/open-source-in-the-data-centre/</guid>
		<description><![CDATA[Next Tuesday (17th Oct) I&#8217;ll be giving a presentation at Thinking Linux &#8217;06 in Melbourne. The talk is entitled Open Source in the Data Centre and I&#8217;ll be covering things like Load Balancing &#8220;Stuff&#8221; (IPVS, keepalived, heartbeat) Monitoring using Nagios and MRTG/rrdtool Authentication with OpenLDAP anf FreeRADIUS and a whole lot of other random things [...]]]></description>
			<content:encoded><![CDATA[<p>Next Tuesday (17th Oct) I&#8217;ll be giving a presentation at <a href="http://www.thinkinglinux.com.au">Thinking Linux &#8217;06</a> in Melbourne.</p>
<p>The talk is entitled <em>Open Source in the Data Centre</em> and I&#8217;ll be covering things like</p>
<ul>
<li>Load Balancing &#8220;Stuff&#8221; (IPVS, keepalived, heartbeat)</li>
<li>Monitoring using Nagios and MRTG/rrdtool</li>
<li>Authentication with OpenLDAP anf FreeRADIUS</li>
</ul>
<p>and a whole lot of other random things I can fit into 40 minutes.</p>
<p>I choose to blame Pia for putting me in a position to give this talk but only because it&#8217;s Jeff&#8217;s fault and there isn&#8217;t a justblamejdub.com <img src='http://inodes.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>If anyone wants to catch up on the Monday night down in Melbourne then let me know.</p>
<p>I&#8217;ll put slides up after the event.</p>
]]></content:encoded>
			<wfw:commentRss>http://inodes.org/2006/10/12/open-source-in-the-data-centre/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>TCP Window Scaling and kernel 2.6.17+</title>
		<link>http://inodes.org/2006/09/06/tcp-window-scaling-and-kernel-2617/</link>
		<comments>http://inodes.org/2006/09/06/tcp-window-scaling-and-kernel-2617/#comments</comments>
		<pubDate>Wed, 06 Sep 2006 03:15:33 +0000</pubDate>
		<dc:creator>johnf</dc:creator>
				<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[Bulletproof]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[tcpdump]]></category>

		<guid isPermaLink="false">http://inodes.org/blog/2006/09/06/tcp-window-scaling-and-kernel-2617/</guid>
		<description><![CDATA[So I was tearing my hair out today. I&#8217;d installed Ubuntu onto a new Sun X4200 so that I could migrate Bulletproof&#8217;s monitoring system to it. (Note you need to use edgy knot-1 for the SAS drives to be supported). Anyway as I was installing packages I was getting speeds like 10kB/s. Normally I would [...]]]></description>
			<content:encoded><![CDATA[<p>So I was tearing my hair out today. I&#8217;d installed Ubuntu onto a new Sun X4200 so that I could migrate Bulletproof&#8217;s monitoring system to it. (Note you need to use edgy knot-1 for the SAS drives to be supported). Anyway as I was installing packages I was getting speeds like 10kB/s. Normally I would expect 800-1000kB/s.</p>
<p>I did the usual sort of debugging, where there any errors on the switch, was it affecting other servers on the same network etc etc. Everything looked fine. Our friend tcpdump showed a dump that looked something like this.</p>
<p><code><br />
root@oldlace:~# tcpdump -ni bond0 port 80<br />
tcpdump: listening on bond0<br />
1.2.3.4.42501 > 203.16.234.85.80: S 0:0 <font color="blue">win 5840</font> &lt;mss 1460,sackOK,timestamp 94318 0,nop,<font color="blue">wscale 6</font>&gt; (DF)<br />
203.16.234.85.80 > 1.2.3.4.42501: S 0:0(0) ack 1 <font color="red">win 5840</font>&lt;mss 1460,nop,<font color="blue">wscale 2</font>&gt; (DF)<br />
1.2.3.4.42501 > 203.16.234.85.80: . ack 1 <font color="red">win 92</font> (DF)<br />
1.2.3.4.42501 > 203.16.234.85.80: P 1:352(351) ack 1 win 92 (DF)<br />
203.16.234.85.80 > 1.2.3.4.42501: . ack 352 win 1608 (DF)<br />
</code></p>
<p>You&#8217;ll notice that the server initially advertises a window size of 5840, then suddenly in the first ACK it is advertising a size of 92. This means that the other side can only send 92 bytes before waiting for an ACK!!! Not very conducive to quick WAN transfer speeds.</p>
<p>After a lot of Google searching I discovered these threads on LKLM</p>
<ul>
<li><a href="http://www.gatago.com/linux/kernel/9440712.html">http://www.gatago.com/linux/kernel/9440712.html</a></li>
<li><a href="http://lwn.net/Articles/92727/">http://lwn.net/Articles/92727/</a></li>
<li><a href="http://oss.sgi.com/archives/netdev/2004-07/msg00142.html">http://oss.sgi.com/archives/netdev/2004-07/msg00142.html</a></li>
</ul>
<p>Of course what I was missing was the <font color="blue">wscale 6</font>, which means that the windows was actually 92*2^6 = 5888. Which is pretty close to 5840 so why bother with the scaling, because towards the end of the connection we get 16022*2^6 = 1025408 which doesn&#8217;t normally fit into a TCP header.</p>
<p>So why aren&#8217;t things screaming along with this massive window, well something in the middle doesn&#8217;t like a windows scaling factor of 6 and is resetting it to zero. Which means the other end thingk the windows size really is 92.</p>
<p>There are 2 quick fixes. First you can simply turn off windows scaling all together by doing<br />
<code><br />
echo 0 > /proc/sys/net/ipv4/tcp_window_scaling<br />
</code></p>
<p>but that limits your window to 64k. Or you can limit the size of your TCP buffers back to pre 2.6.17 kernel values which means a wscale value of about 2 is used which is acceptable to most broken routers.<br />
<code><br />
echo "4096    16384   131072" > /proc/sys/net/ipv4/tcp_wmem<br />
echo "4096    87380   174760" > /proc/sys/net/ipv4/tcp_rmem<br />
</code></p>
<p>The original values would have had 4MB in the last column above which is what was allowing these massive windows.</p>
<p>In a thread somewhere which I can&#8217;t find anymore Dave Miller had a great quote along the lines of</p>
<blockquote><p>&#8220;I refuse to workaround it, window scaling has been part of the protocol since 1999, deal with it.&#8221;</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://inodes.org/2006/09/06/tcp-window-scaling-and-kernel-2617/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>VMware Consolidated Backup</title>
		<link>http://inodes.org/2006/08/23/vmware-consolidated-backup/</link>
		<comments>http://inodes.org/2006/08/23/vmware-consolidated-backup/#comments</comments>
		<pubDate>Wed, 23 Aug 2006 12:58:50 +0000</pubDate>
		<dc:creator>johnf</dc:creator>
				<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[Bulletproof]]></category>
		<category><![CDATA[VMware]]></category>

		<guid isPermaLink="false">http://inodes.org/blog/2006/08/23/vmware-consolidated-backup/</guid>
		<description><![CDATA[The last few months have seen me working at an insane pace at Bulletproof in the lead up to a launch of our latest and greatest product Dedicated Virtual Machine Hosting or DVMH for short. I&#8217;ll ramble on a bit more about it after it&#8217;s launched but basically it is similar to our existing Managed [...]]]></description>
			<content:encoded><![CDATA[<p>The last few months have seen me working at an insane pace at <a href="http://bulletproof.net">Bulletproof</a> in the lead up to a launch of our latest and greatest product Dedicated Virtual Machine Hosting or DVMH for short. I&#8217;ll ramble on a bit more about it after it&#8217;s launched but basically it is similar to our existing Managed Dedicated Hosting but running on <a href="http://vmware.org">VMware</a> and with a whole heap of cool features due to the benefits of virtualisation. </p>
<p>Today saw me working with one of these cool features, Consolidated Backup. Basically what this lets you do is have a Windows 2003 server directly plugged into the SAN which can directly see all the VM images sitting in the VMFS LUNs. It then talks to the ESX servers takes a snapshot and makes a copy of it t local disk. Hey presto Disaster Recovery. Well mostly anyway, the restoration aspect isn&#8217;t all that crash hot as you&#8217;ll see below.</p>
<p>Documentation on performing the backups is a bit scarce. VMware provide some scripts that let you tie it in to some commercial backup products like Legato, Veritas and NetBackup but no real docs on how to do it yourself.</p>
<p>So here are some quick examples. <em>(You can find all these commands in C:\Program Files\VMware\VMware Consolidated Backup Framework</em></p>
<p><strong>Getting a list of VMs on your ESX farm.</strong><br />
[code]<br />
vcbVmName.exe -h VC_HOST -u USERNAME -p PASSWORD -s any:<br />
[/code]</p>
<p><strong>Backing up a VM</strong><br />
[code]<br />
vcbMounter.exe -h VC_HOST -u USERNAME -p PASSWORD -a moref:MOREF -r DESTINATION -t fullvm -m san<br />
[/code]<br />
where MOREF comes from the list you created above and DESTINATION is a local path on your VCB proxy.</p>
<p>You should then strictly unmount it by doing<br />
[code]<br />
vcbMounter.exe  -d DESTINATION<br />
[/code]<br />
but I don&#8217;t think this does anymore than delete the files, since the snapshot on the ESX server has already been closed.</p>
<p>The above  creates something like this<br />
[code]<br />
catalog<br />
MyVM.nvram<br />
MyVM.vmx<br />
scsi0-0-0-MyVM-s001.vmdk<br />
scsi0-0-0-MyVM-s002.vmdk<br />
scsi0-0-0-MyVM-s003.vmdk<br />
scsi0-0-0-MyVM-s004.vmdk<br />
scsi0-0-0-MyVM-s005.vmdk<br />
scsi0-0-0-MyVM.vmdk<br />
unmount.dat<br />
vmware-1.log<br />
vmware-2.log<br />
vmware-3.log<br />
vmware-4.log<br />
vmware-5.log<br />
vmware.log<br />
[/code]</p>
<p><strong>Mounting a VM image locally</strong><br />
[code]<br />
vmmount.exe -d VMDK -cycleId -sysdl LOCATION<br />
[/code]<br />
VMDK needs to be <em>scsi0-0-0-MyVM.vmdk</em> from above.</p>
<p>You can then unmount it by doing<br />
[code]<br />
vmount.exe -u LOCATION<br />
[/code]</p>
<p>This is nice and easy and really useful means you can now easily backup everything to tape.</p>
<p>Recovery is another matter entirely, apparently in the Beta releases vcbRestore was distributed with Consolidated Backup but in the final release it now only exists on the ESX servers. So you need to move your directory above to one of your ESX boxes. You then do</p>
<p>[code]<br />
vcbRestore -h VC_HOST -u USERNAME -p PASSWORD -s DIRECTORY<br />
[/code]</p>
<p>This will totally replace your existing VM, if you wanted a copy then you should copy the catalog file elsewhere, edit it to change the paths and</p>
<p>[code]<br />
vcbRestore -h VC_HOST -u USERNAME -p PASSWORD -s DIRECTORY -a CATALOG<br />
[/code]</p>
<p>There are a couple more features I haven&#8217;t mentioned which you can work out for yourself by using -h. eg File level backups for Windows VMs.</p>
<p>Now all of the above is great but VMware have taken things a step further. With the above if your VM is running VMware Tools the equivalent of a sync is done before the snapshot is taken which effectively gives you slightly better than a crash consistent dump. Though you could still lose some DB data.</p>
<p>So VMware have added some functionality to rectify this. Just before the snapshot is made /usr/sbin/pre-freeze-script or C:\Windows\pre-freeze-script.bat is run and  /usr/sbin/post-thaw-script or C:\Windows\post-thaw-script.bat are run afterwards. Taking a snapshot only takes a few minutes so you could use these scripts to stop your database for example.</p>
<p>I highly recommend reading the <a href="http://www.vmware.com/pdf/vi3_vm_backup.pdf">VMware Consolidated Backup</a> manual for all the extra features I haven&#8217;t covered. </p>
]]></content:encoded>
			<wfw:commentRss>http://inodes.org/2006/08/23/vmware-consolidated-backup/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>

