<?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>Running Systems&#187; Linux</title>
	<atom:link href="http://run.tournament.org.il/tag/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://run.tournament.org.il</link>
	<description>(and me chasing them)</description>
	<lastBuildDate>Wed, 02 Jun 2010 13:50:14 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Oracle VM post-install check list</title>
		<link>http://run.tournament.org.il/oracle-vm-post-install-check-list/</link>
		<comments>http://run.tournament.org.il/oracle-vm-post-install-check-list/#comments</comments>
		<pubDate>Fri, 21 May 2010 22:39:52 +0000</pubDate>
		<dc:creator>ez-aton</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Xen]]></category>

		<guid isPermaLink="false">http://run.tournament.org.il/?p=515</guid>
		<description><![CDATA[Following my experience with OracleVM, I am adding my post-install steps for your pleasure. These steps are not mandatory, by design, but will help you get up and running faster and easier. These steps are relevant to Oracle VM 2.2, but might work for older (and newer) versions as well.
Define bonding
You should read more about [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Following my experience with OracleVM, I am adding my post-install steps for your pleasure. These steps are not mandatory, by design, but will help you get up and running faster and easier. These steps are relevant to Oracle VM 2.2, but might work for older (and newer) versions as well.</p>
<p><span style="text-decoration: underline;">Define bonding</span></p>
<p>You should read more about it in my <a href="http://run.tournament.org.il/oracle-vm-and-network-bonding/" target="_blank">past post</a>.</p>
<p><span style="text-decoration: underline;">Define storage multipathing</span></p>
<p>You can read about it <a href="http://wiki.oracle.com/page/Oracle+VM+Server+configuration:+multiple+networks,+multipathed+SAN+storage" target="_blank">here</a>.</p>
<p><span style="text-decoration: underline;">Define NTP</span></p>
<p>Define NTP servers for your Oracle VM host. Make sure the daemon &#8216;ntpd&#8217; is running, and following an initial time update, via</p>
<blockquote><p>ntpdate -u &lt;server&gt;</p></blockquote>
<p>to set the clock right initially, perform a sync to the hardware clock, for good measures</p>
<blockquote><p>hwclock &#8211;systohc</p></blockquote>
<p>Make sure NTPD starts on boot:</p>
<blockquote><p>chkconfig ntpd on</p></blockquote>
<p><span style="text-decoration: underline;">Install Linux VM</span></p>
<p>If the system is going to be stand-alone, you might like to run your VM Manager on it (we will deal with issues of it later). To do so, you will need to install your own Linux machine, since Oracle supplied image fails (or at least &#8211; failed for me!) for no apparent reason (kernel panic, to be exact, on a fully MD5 checked image). You could perform this action from the command line by running the command</p>
<blockquote><p>virt-install -n linux_machine -r 1024 -p &#8211;nographics -l nfs://iso_server:/mount</p></blockquote>
<p>This directive installs a VM called &#8220;linux_machine&#8221; from nfs iso_server:/mount, with 1GB RAM. You will be asked about where to place the VM disk, and you should place it in /OVS/running_pool/linux_machine , accordingly.</p>
<p>It assumes you have DHCP available for the install procedure, etc.</p>
<p><span style="text-decoration: underline;">Install Oracle VM Manager on the virtual Linux machine</span></p>
<p>This should be performed if you select to manage your VMs from a VM. This is a bit tricky, as you are recommended <span style="text-decoration: underline;">not to do so</span> if you designing HA-enabled server pool.</p>
<p><span style="text-decoration: underline;">Define autostart to all your VMs</span></p>
<p>Or, at least, those you want to auto start. Create a link from <em>/OVS/running_pool/&lt;VM_NAME&gt;/vm.cfg</em> to <em>/etc/xen/auto/</em></p>
<p>The order in which &#8216;ls&#8217; command will see them in <em>/etc/xen/auto/</em> is the order in which they will be called.</p>
<p><span style="text-decoration: underline;">Disable or relocate auto-suspending</span></p>
<p>Auto-suspend is cool, but your default Oracle VM installation has shortage of space under <em>/var/lib/xen/save/</em> directory, where persistent memory dumps are kept.  On a 16GB RAM system, this can get pretty high, which is far more than your space can contain.</p>
<p>Either increase the size (mount something else there, I assume), or edit <em>/etc/sysconfig/xendomains</em> and comment the line  with the directive <em>XENDOMAINS_SAVE=</em> . You could also change the desired path to somewhere you have enough space on.</p>
<p>Hashing this directive will force regular shutdown to your VMs following a power off/reboot command to the Oracle VM.</p>
<p><span style="text-decoration: underline;">Make sure auto-start VMs actually start</span></p>
<p>This is an annoying bug. For auto-start of VMs, you need /OVS up and available. Since it&#8217;s OCFS2 file system, it takes a short while (being performed by ovs-agent).</p>
<p>Since ovs-agent takes a while, we need to implement a startup script after it and before xendomains. Since both are markes &#8220;S99&#8243; (check /etc/rc3.d/ for details), we would add a script called &#8220;sleep&#8221;.</p>
<p>The script should be placed in <em>/etc/init.d/</em></p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p515code2'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p5152"><td class="code" id="p515code2"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># sleep     Workaround Oracle VM delay issues</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># chkconfig: 2345 99 99</span>
<span style="color: #666666; font-style: italic;"># description: Adds a predefined delay to the initialization process</span>
<span style="color: #666666; font-style: italic;">#</span>
&nbsp;
<span style="color: #007800;">DELAY</span>=<span style="color: #000000;">60</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">case</span> <span style="color: #ff0000;">&quot;$1&quot;</span> <span style="color: #000000; font-weight: bold;">in</span>
start<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #c20cb9; font-weight: bold;">sleep</span> <span style="color: #007800;">$DELAY</span>
<span style="color: #000000; font-weight: bold;">;;</span>
<span style="color: #000000; font-weight: bold;">esac</span>
<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">0</span></pre></td></tr></table></div>

<p>Place the script as a file called &#8220;sleep&#8221; (omit the suffix I added in this post), set it to be executable, and then run</p>
<blockquote><p>chkconfig &#8211;add sleep</p></blockquote>
<p>This will solve VM startup problems.</p>
<p><span style="text-decoration: underline;">Fix /etc/hosts file</span></p>
<p>If you are into multi-server pool, you will need that the host name would not be defined to 127.0.0.1 address. By default, Oracle VM defines it to match 127.0.0.1, which will result in a poor attempt to create multi-server pool.</p>
<p>This is all I have had in mind for now. It should solve most new-comer issues with Oracle VM, and allow you to make good use of it. It&#8217;s a nice system, albeit it&#8217;s ugly management.</p>
<p><span style="text-decoration: underline;">Update the OracleVM</span></p>
<p>You could use Oracle&#8217;s unbreakable network, if you are a paying customer, or you could use the <a href="http://public-yum.oracle.com/" target="_blank">Public Yum Server</a> for your system.</p>
<p><span style="text-decoration: underline;">Updates to Oracle VM Manager</span></p>
<p>If you won&#8217;t use Oracle Grid Control (Enterprise Manager) to manage the pool, you will probably use Oracle VM Manager. You would need to update the ovs-console package, and you will probably want to add tightvnc-java package, so that IE users will be able to use the web-based VNC services. You would better grub these packages from <a href="http://oss.oracle.com/oraclevm/manager/RPMS/" target="_blank">here</a>.</p>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://run.tournament.org.il/oracle-vm-post-install-check-list/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NetApp SnapMirror monitor script</title>
		<link>http://run.tournament.org.il/netapp-snapmirror-monitor-script/</link>
		<comments>http://run.tournament.org.il/netapp-snapmirror-monitor-script/#comments</comments>
		<pubDate>Sun, 13 Dec 2009 09:02:18 +0000</pubDate>
		<dc:creator>ez-aton</dc:creator>
				<category><![CDATA[Disk Storage]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[bandwidth limits]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[netapp]]></category>
		<category><![CDATA[replication]]></category>
		<category><![CDATA[storage device]]></category>

		<guid isPermaLink="false">http://run.tournament.org.il/?p=499</guid>
		<description><![CDATA[I have had some work done lately with NetApp SnapMirror. I have snapped-mirrored some volumes and qtrees and I wanted to monitor their use and behavior over the line.
As you can expect, site-to-site replication of data is a fragile thing, especially when done on the level of the storage device, which is agnostic to the [...]


Related posts:<ol><li><a href='http://run.tournament.org.il/citrix-xenserver-5-0-cannot-cooperate-with-netapp-snapmirror/' rel='bookmark' title='Permanent Link: Citrix XenServer 5.0 cannot cooperate with NetApp SnapMirror'>Citrix XenServer 5.0 cannot cooperate with NetApp SnapMirror</a> <small>It has been a long while, I know. I was...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>I have had some work done lately with NetApp SnapMirror. I have snapped-mirrored some volumes and qtrees and I wanted to monitor their use and behavior over the line.</p>
<p>As you can expect, site-to-site replication of data is a fragile thing, especially when done on the level of the storage device, which is agnostic to the data kept on it. When replicating volumes, I should expect the relevant employees to be responsible regarding what&#8217;s placed there, because the storage does not filter out the junk. If someone had decided to add a new DVD image on the DB storage space, well &#8211; the DB won&#8217;t care, as long as there is enough free space, but the storage will attempt to replicate the added data to the alternate site, which means that if you are around your bandwidth limits, which is never a good thing, you will just create a delay gap you would hardly (if at all) be able to close.</p>
<p>For that, and since I don&#8217;t tend to trust people not to do stupid things, I have written this script.</p>
<p><span style="text-decoration: underline;">What does it do?</span></p>
<p>This script will perform the following:</p>
<p><strong>Alerting about non-idle SnapMirror session</strong></p>
<p>Use with &#8216;-m alert&#8217;</p>
<p>Assuming SnapMirror is scheduled to a specific time, the script will alert if a session is active. With the flag &#8216;-a no&#8217;, it will not send an e-mail (if possible, see the configuration section below). With &#8216;-r yes&#8217;, it will react, setting throttle for each non-idle session, but then &#8216;-t VALUE&#8217; should be specified, where VALUE is the numeric throttle in KB/s.</p>
<p><strong>Limiting throttle to a SnapMirror session</strong></p>
<p>Use with &#8216;-m throttle_limit&#8217;</p>
<p>The script will set a throttle for SnapMirror session(s). Setting limit by the flag &#8216;-t VALUE&#8217;, where VALUE is the numeric throttle in KB/s per each session.</p>
<p><strong>Cancelling throttle limit</strong></p>
<p>Use with &#8216;-m throttle_unlimit&#8217;</p>
<p>The script will set unlimited throttle for SnapMirror session(s).</p>
<p><strong>Checking SnapMirror lag</strong></p>
<p>Use with the &#8216;-m check_lag&#8217;</p>
<p>Since replication has a purpose of recovering, the lag of each SnapMirror session would show how far back we are. Use with &#8216;-d VALUE&#8217;, VALUE being numeric time in minutes to set alert threshold. The default threshold delay is one day (1440 minutes).</p>
<p><strong>Checking snapshots size</strong></p>
<p>Use with the &#8216;-m check_size&#8217;</p>
<p>This reports the expected delta to transfer. This can help estimate the success or failure of a future sync of data (snapmirror update) before it begins. Use with &#8216;-l&#8217; flag to set it to log date/time of measure and the expected sizes into a file. By default, in /tmp/target_name.txt, where the target is the SnapMirror target.</p>
<p><strong>General Options</strong></p>
<p>Use with &#8216;-c filename&#8217; for alternate configuration file.</p>
<p>Use with &#8216;-h&#8217; to get general help.</p>
<p>Use with a list target names in the format of storage:/vol/volname/qtree or storage:volname to ignore targets in configuration file and use your own.</p>
<p><strong>Configuration File</strong></p>
<p>The configuration file is rather simple. By default it should be called &#8220;<em>/etc/snapmirror_monitor.conf</em>&#8220;. It consists of two main variables for the system:</p>
<blockquote><p>TGTS=&#8221;storage2:/vol/volname/qtree</p>
<p>storage3:volname2</p>
<p>storage1:/vol/volnew/qtr2&#8243;</p>
<p>EMAIL=&#8221;user@domain.com another_user@domain.com&#8221;</p></blockquote>
<p><strong>Prerequisites</strong></p>
<p>This script will run on any modern Linux machine. For it to communicate with the NetApp devices, you will need SSH enabled on the NetApps, and ssh key exchange so that the Linux would be able to access the NetApp without using passwords.</p>
<p><span style="text-decoration: underline;">The Script</span></p>
<p>Below is the script. You can download it and use it as you like.</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left2">Download <a href="http://run.tournament.org.il/wp-content/plugins/wp-codebox/wp-codebox.php?p=499&amp;download=snapshot_mirror.sh">snapshot_mirror.sh</a></span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p4994"><td class="code" id="p499code4"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #666666; font-style: italic;"># This script will monitor snapmirror status</span>
<span style="color: #666666; font-style: italic;"># Assumption: Access through ssh to root on all storage devices involved</span>
<span style="color: #666666; font-style: italic;"># This will also attempt to detect the diff which is to sync</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Written by Ez-Aton. Check http://run.tournament.org.il for updates or</span>
<span style="color: #666666; font-style: italic;"># additional information</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Modes: </span>
<span style="color: #666666; font-style: italic;"># alert -&gt; alert if snapmirror is still active</span>
<span style="color: #666666; font-style: italic;"># throttle_limit -&gt; Limit throttle to a given number (default or manually set)</span>
<span style="color: #666666; font-style: italic;"># throttle_unlimit -&gt; Open throttle limitation</span>
<span style="color: #666666; font-style: italic;"># check_lag -&gt; Report the snapmirror lage</span>
<span style="color: #666666; font-style: italic;"># check_size -&gt; Report the estimated data size to move</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Global variables</span>
<span style="color: #007800;">CONF</span>=<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>snapmirror_monitor.conf
<span style="color: #007800;">LOG_PREFIX</span>=<span style="color: #000000; font-weight: bold;">/</span>tmp
&nbsp;
test_connection <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
        <span style="color: #666666; font-style: italic;"># Test to see that you can access the storage device</span>
        <span style="color: #666666; font-style: italic;"># Arguments: NetApp name</span>
        <span style="color: #007800;">SSH_OPTS</span>=<span style="color: #ff0000;">&quot;-o ConnectTimeout=2&quot;</span>
        <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #c20cb9; font-weight: bold;">ssh</span> <span style="color: #007800;">$SSH_OPTS</span> <span style="color: #007800;">$1</span> <span style="color: #c20cb9; font-weight: bold;">hostname</span> <span style="color: #000000; font-weight: bold;">&amp;&gt;/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null
        <span style="color: #000000; font-weight: bold;">then</span>
                <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Cannot communicate via SSH to $1&quot;</span>
                <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span>
        <span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
abort <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
        <span style="color: #666666; font-style: italic;"># Exit with a predefined error message</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$*</span>
        <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
get_arguments <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
        <span style="color: #666666; font-style: italic;"># Get all arguments and define options</span>
        <span style="color: #666666; font-style: italic;"># Argument: $@</span>
        <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-z</span> <span style="color: #ff0000;">&quot;$1&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #000000; font-weight: bold;">set</span> <span style="color: #660033;">--</span> <span style="color: #660033;">-h</span>
        <span style="color: #000000; font-weight: bold;">while</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;$1&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>
        <span style="color: #000000; font-weight: bold;">do</span>
                <span style="color: #000000; font-weight: bold;">case</span> <span style="color: #ff0000;">&quot;$1&quot;</span> <span style="color: #000000; font-weight: bold;">in</span>
                        -m<span style="color: #7a0874; font-weight: bold;">&#41;</span>     <span style="color: #7a0874; font-weight: bold;">shift</span>
                                <span style="color: #000000; font-weight: bold;">case</span> <span style="color: #ff0000;">&quot;$1&quot;</span> <span style="color: #000000; font-weight: bold;">in</span>
                                        alert<span style="color: #000000; font-weight: bold;">|</span>throttle_limit<span style="color: #000000; font-weight: bold;">|</span>throttle_unlimit<span style="color: #000000; font-weight: bold;">|</span>check_lag<span style="color: #000000; font-weight: bold;">|</span>check_size<span style="color: #7a0874; font-weight: bold;">&#41;</span>     <span style="color: #007800;">MODE</span>=<span style="color: #007800;">$1</span>
                                        <span style="color: #000000; font-weight: bold;">;;</span>
                                        <span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>      abort <span style="color: #ff0000;">&quot;Mode is mandatory. Use -h flag to get list of avialable flags&quot;</span>
                                        <span style="color: #000000; font-weight: bold;">;;</span>
                                <span style="color: #000000; font-weight: bold;">esac</span>
                                <span style="color: #000000; font-weight: bold;">;;</span>
                        -a<span style="color: #7a0874; font-weight: bold;">&#41;</span>     <span style="color: #7a0874; font-weight: bold;">shift</span>
                                <span style="color: #000000; font-weight: bold;">case</span> <span style="color: #ff0000;">&quot;$1&quot;</span> <span style="color: #000000; font-weight: bold;">in</span>
                                        <span style="color: #7a0874; font-weight: bold;">&#91;</span>nN<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>oO<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>       <span style="color: #007800;">NOMAIL</span>=<span style="color: #000000;">1</span>
                                                        <span style="color: #000000; font-weight: bold;">;;</span>
                                        <span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>              <span style="color: #007800;">NOMAIL</span>=<span style="color: #000000;">0</span>
                                                        <span style="color: #000000; font-weight: bold;">;;</span>
                                <span style="color: #000000; font-weight: bold;">esac</span>
                                <span style="color: #000000; font-weight: bold;">;;</span>
                        -r<span style="color: #7a0874; font-weight: bold;">&#41;</span>     <span style="color: #7a0874; font-weight: bold;">shift</span>
                                <span style="color: #000000; font-weight: bold;">case</span> <span style="color: #ff0000;">&quot;$1&quot;</span> <span style="color: #000000; font-weight: bold;">in</span>
                                        <span style="color: #7a0874; font-weight: bold;">&#91;</span>yY<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>eE<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>sS<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>   <span style="color: #007800;">REACT</span>=<span style="color: #000000;">1</span>
                                                        <span style="color: #000000; font-weight: bold;">;;</span>
                                        <span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>              <span style="color: #007800;">REACT</span>=<span style="color: #000000;">0</span>
                                                        <span style="color: #000000; font-weight: bold;">;;</span>
                                <span style="color: #000000; font-weight: bold;">esac</span>
                                <span style="color: #000000; font-weight: bold;">;;</span>
                        -d<span style="color: #7a0874; font-weight: bold;">&#41;</span>     <span style="color: #7a0874; font-weight: bold;">shift</span>
                                <span style="color: #7a0874; font-weight: bold;">declare</span> <span style="color: #660033;">-i</span> DELAY_TMP
                                <span style="color: #007800;">DELAY_TMP</span>=<span style="color: #007800;">$1</span>
                                <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$DELAY_TMP</span>&quot;</span> <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #ff0000;">&quot;$1&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> abort <span style="color: #ff0000;">&quot;Delay needs to be a number in minutes&quot;</span>
                                <span style="color: #007800;">DELAY</span>=<span style="color: #007800;">$DELAY_TMP</span>
                                <span style="color: #000000; font-weight: bold;">;;</span>
                        -t<span style="color: #7a0874; font-weight: bold;">&#41;</span>     <span style="color: #7a0874; font-weight: bold;">shift</span>
                                <span style="color: #7a0874; font-weight: bold;">declare</span> <span style="color: #660033;">-i</span> THROTTLE_TMP
                                <span style="color: #007800;">THROTTLE_TMP</span>=<span style="color: #007800;">$1</span>
                                <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$THROTTLE_TMP</span>&quot;</span> <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #ff0000;">&quot;$1&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> abort <span style="color: #ff0000;">&quot;Throttle needs to be a number&quot;</span>
                                <span style="color: #007800;">THROTTLE</span>=<span style="color: #007800;">$THROTTLE_TMP</span>
                                <span style="color: #000000; font-weight: bold;">;;</span>
                        -c<span style="color: #7a0874; font-weight: bold;">&#41;</span>     <span style="color: #7a0874; font-weight: bold;">shift</span>
                                <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-f</span> <span style="color: #ff0000;">&quot;$1&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">||</span> abort <span style="color: #ff0000;">&quot;Cannot find specified conf file&quot;</span>
                                <span style="color: #007800;">CONF</span>=<span style="color: #ff0000;">&quot;$1&quot;</span>
                                <span style="color: #000000; font-weight: bold;">;;</span>
                        -l<span style="color: #7a0874; font-weight: bold;">&#41;</span>     <span style="color: #007800;">LOG</span>=<span style="color: #000000;">1</span>
                                <span style="color: #000000; font-weight: bold;">;;</span>
                        -h<span style="color: #7a0874; font-weight: bold;">&#41;</span>     <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Usage: $0 -m [alert|throttle_limit|throttle_unlimit|check_lag|check_size] (-c CONF_FILE) [tgt_filer:volume tgt_filer:/vol/vol/qtree]&quot;</span>
                                <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Alert if SnapMirror is still running: $0 -m alert [-a no] (-r yes) [tgt_filer:volume tgt_filer:/vol/vol/qtree]&quot;</span>
                                <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Alert and throttle (react): $0 -m alert [-a no] -r yes -t [throttle_in_kb] [tgt_filer:volume tgt_filer:/vol/vol/qtree]&quot;</span>
                                <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Throttle a running SnapMirror: $0 -m throttle_limit -t throttle_in_kb [tgt_filer:volume tgt_filer:/vol/vol/qtree]&quot;</span>
                                <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Unlimit SnapMirror throttle: $0 -m throttle_unlimit [tgt_filer:volume tgt_filer:/vol/vol/qtree]&quot;</span>
                                <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;To check lag: $0 -m check_lag -d delay_in_minutes (-a no) [tgt_filer:volume tgt_filer:/vol/vol/qtree]&quot;</span>
                                <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;To check delta: $0 -m check_size [tgt_filer:volume tgt_filer:/vol/vol/qtree]&quot;</span>
                                <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">0</span>
                                <span style="color: #000000; font-weight: bold;">;;</span>
                        <span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>      <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-z</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$MODE</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> abort <span style="color: #ff0000;">&quot;$0 mode required&quot;</span>
                                <span style="color: #007800;">TGTS</span>=<span style="color: #ff0000;">&quot;$*&quot;</span>
                                <span style="color: #000000; font-weight: bold;">;;</span>
                <span style="color: #000000; font-weight: bold;">esac</span>
                <span style="color: #7a0874; font-weight: bold;">shift</span>
        <span style="color: #000000; font-weight: bold;">done</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
notify <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
        <span style="color: #666666; font-style: italic;"># Send an e-mail notification</span>
        <span style="color: #666666; font-style: italic;"># Arguments: $@ - the subject</span>
        <span style="color: #666666; font-style: italic;"># Contents are empty</span>
        <span style="color: #666666; font-style: italic;"># And yes - one e-mail per event</span>
        mail <span style="color: #660033;">-s</span> <span style="color: #ff0000;">&quot;$@&quot;</span> <span style="color: #007800;">$EMAIL</span> <span style="color: #000000; font-weight: bold;">&lt;</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
idle <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
        <span style="color: #666666; font-style: italic;"># Check if transaction is idle</span>
        <span style="color: #666666; font-style: italic;"># Arguments: Target name (example: storage:/vol/volname/qtree</span>
&nbsp;
        <span style="color: #666666; font-style: italic;"># Get the storage name out</span>
        <span style="color: #007800;">NETAPP</span>=<span style="color: #800000;">${1%%:*}</span>
        test_connection <span style="color: #007800;">$NETAPP</span> <span style="color: #666666; font-style: italic;">#Verify this netapp is accessible</span>
        <span style="color: #c20cb9; font-weight: bold;">ssh</span> <span style="color: #007800;">$NETAPP</span> snapmirror status <span style="color: #007800;">$1</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">tail</span> <span style="color: #660033;">-1</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> Idle$ <span style="color: #000000; font-weight: bold;">&amp;&gt;/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null <span style="color: #666666; font-style: italic;">#Checks if the snapmirror is idle. If so, return true</span>
        <span style="color: #7a0874; font-weight: bold;">return</span> <span style="color: #007800;">$?</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
set_throttle <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
        <span style="color: #666666; font-style: italic;"># Sets throttle for target</span>
        <span style="color: #666666; font-style: italic;"># Arguments: $1 Target name (example: storage:/vol/volname/qtree)</span>
        <span style="color: #666666; font-style: italic;"># Arguments: $2 throttle value (number)</span>
&nbsp;
        <span style="color: #666666; font-style: italic;"># Get the storage name out</span>
        <span style="color: #007800;">NETAPP</span>=<span style="color: #800000;">${1%%:*}</span>
        test_connection <span style="color: #007800;">$NETAPP</span> <span style="color: #666666; font-style: italic;">#Verify this netapp is accessible</span>
        <span style="color: #c20cb9; font-weight: bold;">ssh</span> <span style="color: #007800;">$NETAPP</span> snapmirror throttle <span style="color: #007800;">$2</span> <span style="color: #007800;">$1</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
get_lag <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
        <span style="color: #666666; font-style: italic;"># Gets the lag of snapmirror relationship in minutes</span>
        <span style="color: #666666; font-style: italic;"># Arguments: Target name (example: storage:/vol/volname/qtree)</span>
&nbsp;
        <span style="color: #666666; font-style: italic;"># Get the storage name out</span>
        <span style="color: #007800;">NETAPP</span>=<span style="color: #800000;">${1%%:*}</span>
        test_connection <span style="color: #007800;">$NETAPP</span> <span style="color: #666666; font-style: italic;">#Verify this netapp is accessible</span>
        <span style="color: #007800;">LAG</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">ssh</span> <span style="color: #007800;">$NETAPP</span> snapmirror status <span style="color: #007800;">$1</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">tail</span> <span style="color: #660033;">-1</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print $4}'</span><span style="color: #000000; font-weight: bold;">`</span>
        <span style="color: #666666; font-style: italic;"># LAG is in hh:mm:ss. We need to transfer it to minutes only</span>
        <span style="color: #007800;">H</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$LAG</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">cut</span> <span style="color: #660033;">-f</span> <span style="color: #000000;">1</span> <span style="color: #660033;">-d</span> :<span style="color: #000000; font-weight: bold;">`</span>
        <span style="color: #007800;">M</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$LAG</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">cut</span> <span style="color: #660033;">-f</span> <span style="color: #000000;">2</span> <span style="color: #660033;">-d</span> :<span style="color: #000000; font-weight: bold;">`</span>
        <span style="color: #7a0874; font-weight: bold;">let</span> <span style="color: #007800;">M</span>=<span style="color: #007800;">$M</span>+<span style="color: #007800;">$H</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #000000;">60</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$M</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
check_size <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
        <span style="color: #666666; font-style: italic;"># Checks the size of the snapshot to copy (diff)</span>
        <span style="color: #666666; font-style: italic;"># Arguments: Target name (example: storage:/vol/volname/qtree)</span>
&nbsp;
        <span style="color: #666666; font-style: italic;"># Get the storage name out</span>
        <span style="color: #007800;">NETAPP</span>=<span style="color: #800000;">${1%%:*}</span>
        test_connection <span style="color: #007800;">$NETAPP</span> <span style="color: #666666; font-style: italic;">#Verify this netapp is accessible</span>
        <span style="color: #666666; font-style: italic;"># Get source storage name and path</span>
        <span style="color: #007800;">SRC</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">ssh</span> <span style="color: #007800;">$NETAPP</span> snapmirror status <span style="color: #007800;">$1</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">tail</span> <span style="color: #660033;">-1</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print $1}'</span><span style="color: #000000; font-weight: bold;">`</span>
        <span style="color: #666666; font-style: italic;"># Get the source filer and vol name from that</span>
        <span style="color: #007800;">NETAPP</span>=<span style="color: #800000;">${SRC%%:*}</span>
        <span style="color: #007800;">SPATH</span>=<span style="color: #800000;">${SRC##*:}</span>
        <span style="color: #007800;">SPATH</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$SPATH</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> s<span style="color: #000000; font-weight: bold;">/</span><span style="color: #ff0000;">'\/vol\/'</span><span style="color: #000000; font-weight: bold;">//`</span>
        <span style="color: #007800;">SPATH</span>=<span style="color: #800000;">${SPATH%%/*}</span>
&nbsp;
        test_connection <span style="color: #007800;">$NETAPP</span> <span style="color: #666666; font-style: italic;"># Verify the target NetApp is accessible</span>
        <span style="color: #007800;">SNAP</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">ssh</span> <span style="color: #007800;">$NETAPP</span> snap list <span style="color: #660033;">-n</span> <span style="color: #007800;">$SPATH</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> snapmirror <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">tail</span> <span style="color: #660033;">-1</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print $4}'</span><span style="color: #000000; font-weight: bold;">`</span>
        <span style="color: #007800;">DELTA</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">ssh</span> <span style="color: #007800;">$NETAPP</span> snap delta <span style="color: #007800;">$SPATH</span> <span style="color: #007800;">$SNAP</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">tail</span> <span style="color: #660033;">-2</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">head</span> <span style="color: #660033;">-1</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print $5}'</span><span style="color: #000000; font-weight: bold;">`</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Snap delta for $1 is <span style="color: #007800;">$DELTA</span> KB&quot;</span>  
        <span style="color: #007800;">LOG_TARGET</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$1</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">tr</span> <span style="color: #000000; font-weight: bold;">/</span> _<span style="color: #000000; font-weight: bold;">`</span>.txt
        <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$LOG</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #780078;">`date`</span> <span style="color: #007800;">$DELTA</span>&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #007800;">$LOG_PREFIX</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$LOG_TARGET</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
&nbsp;
<span style="color: #666666; font-style: italic;">### MAIN ###</span>
get_arguments $<span style="color: #000000; font-weight: bold;">@</span>
. <span style="color: #007800;">$CONF</span> <span style="color: #000000; font-weight: bold;">&amp;&gt;/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null
<span style="color: #666666; font-style: italic;"># if e-mail is not set, don't try to send</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-z</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$EMAIL</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #007800;">NOMAIL</span>=<span style="color: #000000;">1</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-z</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$TGTS</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> abort <span style="color: #ff0000;">&quot;You need at least one snapmirror target&quot;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">case</span> <span style="color: #007800;">$MODE</span> <span style="color: #000000; font-weight: bold;">in</span>
        alert<span style="color: #7a0874; font-weight: bold;">&#41;</span>  <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$REACT</span>&quot;</span> == <span style="color: #ff0000;">&quot;1&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>
                <span style="color: #000000; font-weight: bold;">then</span>
                        <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-z</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$THROTTLE</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> abort <span style="color: #ff0000;">&quot;When setting 'react' flag, you must specify throttle&quot;</span>
                <span style="color: #000000; font-weight: bold;">fi</span>
                <span style="color: #000000; font-weight: bold;">for</span> i <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #007800;">$TGTS</span>
                <span style="color: #000000; font-weight: bold;">do</span>
                        <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #000000; font-weight: bold;">!</span> idle <span style="color: #007800;">$i</span>
                        <span style="color: #000000; font-weight: bold;">then</span>
                                <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$i</span> is not idle. &quot;</span>
                                <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$NOMAIL</span>&quot;</span> <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #ff0000;">&quot;1&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> notify <span style="color: #ff0000;">&quot;<span style="color: #007800;">$i</span> is not idle&quot;</span>
                                <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$REACT</span>&quot;</span> == <span style="color: #ff0000;">&quot;1&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>
                                <span style="color: #000000; font-weight: bold;">then</span>
                                        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;We are set to react. Limiting throttle&quot;</span>
                                        set_throttle <span style="color: #007800;">$i</span> <span style="color: #007800;">$THROTTLE</span>
                                <span style="color: #000000; font-weight: bold;">fi</span>
                                <span style="color: #7a0874; font-weight: bold;">echo</span>
                        <span style="color: #000000; font-weight: bold;">fi</span>
                <span style="color: #000000; font-weight: bold;">done</span>
                <span style="color: #000000; font-weight: bold;">;;</span>
        throttle_limit<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-z</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$THROTTLE</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> abort <span style="color: #ff0000;">&quot;Throttle requires throttle value&quot;</span>
                        <span style="color: #000000; font-weight: bold;">for</span> i <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #007800;">$TGTS</span>
                        <span style="color: #000000; font-weight: bold;">do</span>
                                <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Setting throttle for <span style="color: #007800;">$i</span> to <span style="color: #007800;">$THROTTLE</span>&quot;</span>
                                set_throttle <span style="color: #007800;">$i</span> <span style="color: #007800;">$THROTTLE</span>
                        <span style="color: #000000; font-weight: bold;">done</span>
                        <span style="color: #000000; font-weight: bold;">;;</span>
        throttle_unlimit<span style="color: #7a0874; font-weight: bold;">&#41;</span>       <span style="color: #000000; font-weight: bold;">for</span> i <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #007800;">$TGTS</span>
                                <span style="color: #000000; font-weight: bold;">do</span>
                                        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Setting throttle for <span style="color: #007800;">$i</span> to unlimited&quot;</span>
                                        set_throttle <span style="color: #007800;">$i</span> <span style="color: #000000;">0</span>
                                <span style="color: #000000; font-weight: bold;">done</span>
                        <span style="color: #000000; font-weight: bold;">;;</span>
        check_lag<span style="color: #7a0874; font-weight: bold;">&#41;</span>      <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-z</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$DELAY</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #007800;">DELAY</span>=<span style="color: #000000;">1440</span>
                        <span style="color: #000000; font-weight: bold;">for</span> i <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #007800;">$TGTS</span>
                        <span style="color: #000000; font-weight: bold;">do</span>
                                <span style="color: #007800;">LAG</span>=<span style="color: #000000; font-weight: bold;">`</span>get_lag <span style="color: #007800;">$i</span><span style="color: #000000; font-weight: bold;">`</span>
                                <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$LAG</span>&quot;</span> <span style="color: #660033;">-gt</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$DELAY</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>
                                <span style="color: #000000; font-weight: bold;">then</span>
                                        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Failure: The delay for <span style="color: #007800;">$i</span> is <span style="color: #007800;">$LAG</span> minutes&quot;</span>
                                        <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$NOMAIL</span>&quot;</span> <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #ff0000;">&quot;1&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> notify <span style="color: #ff0000;">&quot;<span style="color: #007800;">$i</span> is lagged <span style="color: #007800;">$LAG</span> minutes, above the threshold <span style="color: #007800;">$DELAY</span>&quot;</span>
                                <span style="color: #000000; font-weight: bold;">else</span>
                                        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Normal: The delay for <span style="color: #007800;">$i</span> is <span style="color: #007800;">$LAG</span> minutes&quot;</span>
                                <span style="color: #000000; font-weight: bold;">fi</span>
                        <span style="color: #000000; font-weight: bold;">done</span>
                        <span style="color: #000000; font-weight: bold;">;;</span>
        check_size<span style="color: #7a0874; font-weight: bold;">&#41;</span>     <span style="color: #000000; font-weight: bold;">for</span> i <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #007800;">$TGTS</span>
                        <span style="color: #000000; font-weight: bold;">do</span>
                                check_size <span style="color: #007800;">$i</span>
                        <span style="color: #000000; font-weight: bold;">done</span>
                        <span style="color: #000000; font-weight: bold;">;;</span>
        <span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>      <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Option <span style="color: #007800;">$MODE</span> is not implemented yet&quot;</span>
                <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">0</span>
                <span style="color: #000000; font-weight: bold;">;;</span>
<span style="color: #000000; font-weight: bold;">esac</span></pre></td></tr></table></div>



<p>Related posts:<ol><li><a href='http://run.tournament.org.il/citrix-xenserver-5-0-cannot-cooperate-with-netapp-snapmirror/' rel='bookmark' title='Permanent Link: Citrix XenServer 5.0 cannot cooperate with NetApp SnapMirror'>Citrix XenServer 5.0 cannot cooperate with NetApp SnapMirror</a> <small>It has been a long while, I know. I was...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://run.tournament.org.il/netapp-snapmirror-monitor-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rapid-guide &#8211; Updating RedHat initrd</title>
		<link>http://run.tournament.org.il/rapid-guide-updating-redhat-initrd/</link>
		<comments>http://run.tournament.org.il/rapid-guide-updating-redhat-initrd/#comments</comments>
		<pubDate>Sat, 05 Dec 2009 21:46:09 +0000</pubDate>
		<dc:creator>ez-aton</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[boot loader]]></category>
		<category><![CDATA[initrd]]></category>
		<category><![CDATA[storage drivers]]></category>

		<guid isPermaLink="false">http://run.tournament.org.il/?p=497</guid>
		<description><![CDATA[Warning: This is not the recommended method if you&#8217;re not sure you know what you&#8217;re doing.
Linux Initial Ram Disk (initrd) is a mechanism to perform disk-independent actions before attempting to mount the &#8216;/&#8217; disk. These actions usually include loading disk drivers, setting up LVM or software RAID, etc.
The reason these actions are performed within initrd is that [...]


Related posts:<ol><li><a href='http://run.tournament.org.il/quick-and-dirty-modifying-boel-initrd-files-manually/' rel='bookmark' title='Permanent Link: Quick and dirty &#8211; modifying Boel initrd files manually'>Quick and dirty &#8211; modifying Boel initrd files manually</a> <small>Boel initrd files are actually compressed cramfs files. This is...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Warning: This is not the recommended method if you&#8217;re not sure you know what you&#8217;re doing.</p>
<p>Linux Initial Ram Disk (initrd) is a mechanism to perform disk-independent actions before attempting to mount the &#8216;/&#8217; disk. These actions usually include loading disk drivers, setting up LVM or software RAID, etc.</p>
<p>The reason these actions are performed within initrd is that it is all based on Ram Disk loaded by the boot loader, and thus it breaks the loop of &#8220;how would I load storage drivers without storage access?&#8221;</p>
<p>It happens that due to some special even we need to modify it manually. To do so we need first to open it, and then to close it back in, replacing (backup the old one, will you?) the previous one.</p>
<p>This is rather simple. The tools used by us will be &#8216;gzip&#8217; and &#8216;cpio&#8217;.</p>
<p>Lets begin.</p>
<p>First &#8211; create a temporary directory:</p>
<blockquote><p>mkdir /tmp/initrd</p></blockquote>
<p><span style="text-decoration: underline;">Extracting</span></p>
<p>We have our temporary directory, so now, we need to extract the initrd into it. I assume the name of the file is /boot/initrd.img. You should replace my line with whatever the name of your initrd file:</p>
<blockquote><p>cd /tmp/initrd</p>
<p>cat /boot/initrd.img | gzip -dc |  cpio -id</p></blockquote>
<p>This will extract the contents of the initrd into /tmp/initrd.</p>
<p>Now you can edit its contents directly.</p>
<p><span style="text-decoration: underline;">Package</span></p>
<p>To package initrd back in, we will need to perform the following actions.</p>
<p>Warning &#8211; before you do it, make sure you have an available copy of your original initrd file, in case you have created some damage.</p>
<blockquote><p>cd /tmp/initrd</p>
<p>find . | cpio -o -H newc | gzip -9 &gt; /boot/initrd.img</p></blockquote>
<p>This line packages the initrd, and replaces the old one.</p>
<p>That&#8217;s all for today <img src='http://run.tournament.org.il/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>


<p>Related posts:<ol><li><a href='http://run.tournament.org.il/quick-and-dirty-modifying-boel-initrd-files-manually/' rel='bookmark' title='Permanent Link: Quick and dirty &#8211; modifying Boel initrd files manually'>Quick and dirty &#8211; modifying Boel initrd files manually</a> <small>Boel initrd files are actually compressed cramfs files. This is...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://run.tournament.org.il/rapid-guide-updating-redhat-initrd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quickly install Xen Community Linux VM</title>
		<link>http://run.tournament.org.il/quickly-install-xen-community-linux-vm/</link>
		<comments>http://run.tournament.org.il/quickly-install-xen-community-linux-vm/#comments</comments>
		<pubDate>Sat, 05 Dec 2009 21:35:01 +0000</pubDate>
		<dc:creator>ez-aton</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[provisioning]]></category>
		<category><![CDATA[Xen]]></category>

		<guid isPermaLink="false">http://run.tournament.org.il/?p=494</guid>
		<description><![CDATA[On RHEL-type of systems, with virt-manager (libvirt), you can make use of virt-manager to easy your life. I, for myself, prefer to work with &#8216;xm&#8216; tools, but for the initial install, virt-manager is the quickest and most simple available tool.
To install a new Linux VM, all you need to follow this flow
Create an LV for [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>On RHEL-type of systems, with virt-manager (libvirt), you can make use of virt-manager to easy your life. I, for myself, prefer to work with &#8216;<em>xm</em>&#8216; tools, but for the initial install, virt-manager is the quickest and most simple available tool.</p>
<p>To install a new Linux VM, all you need to follow this flow</p>
<p>Create an LV for your VM (I use LVs because it&#8217;s easier to manage). If not LV, use a file. To create an LV, run the following command</p>
<blockquote><p>lvcreate -L 10G -n new_vm1 VolGroup00</p></blockquote>
<p>I assume that the name you wish to grant is &#8216;new_vm1&#8242; (better maintain order there, else you will find yourself with hundreds of small LVs you have no idea what to do with), and that the name of the volume group is &#8216;VolGroup00&#8242;. Change to different values to match your environment.</p>
<p>Next, make sure you have your ISO contents unpacked (you can use loop device) and exported via NFS (my favorite method).</p>
<p>To mount a CD/DVD ISO, you should use &#8216;mount&#8217; command with the &#8216;loop&#8217; options. This would look like this:</p>
<blockquote><p>mount -o loop my_iso.iso /mnt/temp</p></blockquote>
<p>Again, I assume the name of the ISO is my_iso.iso and that the target directory /mnt/temp is available.</p>
<p>Now, export your newly created directory. If you have NFS already running, you can either add to /etc/exports the newly mounted directory /mnt/temp and restart the &#8216;nfs&#8217; service, or you could use &#8216;exportfs&#8217; to add it:</p>
<p>exportfs -o no_root_squash *:/mnt/temp</p>
<p>would probably do the trick. I added &#8216;no_root_squash&#8217; to make sure no permission/access problems present themselves during the installation phase. Test your export to verify it&#8217;s working.</p>
<p>Now you could begin your installation. Run the following command:</p>
<blockquote><p>virt-install -n new_vm1 -r 512 -p -f /dev/VolGroup00/new_vm1 &#8211;nographics nfs://nfs_server:/mnt/temp</p></blockquote>
<p>The name follows the &#8216;-n&#8217; flag. The amount of RAM to give is 512MB. The -p means it&#8217;s paravirtualized. The -f shows which device will be the block device, and the last argument is the source of the installation. Do not use local files, as the VM installer should be able to access the installation source.</p>
<p>Following that, you should have a very nice TUI installation experience.</p>
<p>Now &#8211; let&#8217;s make this machine &#8216;xm&#8217; compatible.</p>
<p>Currently, the VM is virt-manager compatible. It means you need virt-manager to start/stop it correctly. Since I prefer &#8216;xm&#8217; commands, I will show you how to convert this machine to VM.</p>
<p>First &#8211; export its XML file:</p>
<blockquote><p>virsh dumpxml new_vm1 &gt; /tmp/new_vm1.xml</p>
<p>virsh domxml-to-native xen-xm /tmp/new_vm1.xml &gt; /etc/xen/new_vm1</p></blockquote>
<p>This should do the trick.</p>
<p>Now you can turn the newly created VM off, and remove the VM from virt-manager using</p>
<blockquote><p>virsh undefine new_vm1</p></blockquote>
<p>and you&#8217;re back to &#8216;xm&#8217;-only interface.</p>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://run.tournament.org.il/quickly-install-xen-community-linux-vm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XenServer &#8220;Internal error: Failure&#8230; no loader found&#8221;</title>
		<link>http://run.tournament.org.il/xenserver-internal-error-failure-no-loader-found/</link>
		<comments>http://run.tournament.org.il/xenserver-internal-error-failure-no-loader-found/#comments</comments>
		<pubDate>Sat, 24 Oct 2009 11:42:13 +0000</pubDate>
		<dc:creator>ez-aton</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[grub]]></category>
		<category><![CDATA[troubleshooting]]></category>
		<category><![CDATA[Xen]]></category>
		<category><![CDATA[XenServer]]></category>

		<guid isPermaLink="false">http://run.tournament.org.il/?p=489</guid>
		<description><![CDATA[It has been long since I had the time to write here. I have recently been involved more and more with XenServer virtualization, as you might see in the blogs, and following a solution to a rather common problem, I have decided to post it here.
The problem: When attempting to boot a Linux VM on [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>It has been long since I had the time to write here. I have recently been involved more and more with XenServer virtualization, as you might see in the blogs, and following a solution to a rather common problem, I have decided to post it here.</p>
<p>The problem: When attempting to boot a Linux VM on XenServer (5.0 and 5.5), you get the following error message:</p>
<blockquote><p>Error: Starting VM &#8216;Cacti&#8217; &#8211; Internal error: Failure(&#8220;Error from xenguesthelper: caught exception: Failure(\\\&#8221;Subprocess failure: Failure(\\\\\\\&#8221;xc_dom_linux_build: [2] xc_dom_find_loader: no loader found\\\\\\\\n\\\\\\\&#8221;)\\\&#8221;)&#8221;)</p></blockquote>
<p>This is very common with Linux VMs which were converted from physical (or other, non-PV virtualization) to XenServer.</p>
<p>This will probably either happen during the P2V process, or after a successful update to the Linux VM.</p>
<p>The cause is that the original kernel, non PV-aware one, has not been removed, and GRUB likes to load from it. XenServer will use the GRUB menu, but will not display it to us to select our desired kernel.</p>
<p>With no chance to intervene, XenServer will attempt to load a PV-enabled machine using non-PV kernel, and will fail.</p>
<p>Preventing the problem is quite simple &#8211; remove your non-PV kernel (non-xen) so that future updates will not attempt to update it as well and set it to be the default kernel. Very simple.</p>
<p>Solving the problem in less than two minutes is a bit more tricky. Let&#8217;s see how to solve it.</p>
<p>All operations are performed from within the control domain. This guide does not apply to StorageLink or NetApp/Equalogic devices, as they behave differently. This applies only to LVM-over-something, whatever it may be.</p>
<p>First, we will need to find the name of the VDI we are to work on. Use xe in the following manner, using the VM&#8217;s name:</p>
<blockquote><p>xe vbd-list vm-name-label=Cacti</p>
<p>uuid ( RO)             : 128f29dc-4a14-1a2d-75d1-8674d3d2403b<br />
vm-uuid ( RO): eae053de-4a20-28a5-f335-f5a18dd79993<br />
vm-name-label ( RO): Cacti<br />
vdi-uuid ( RO): <strong>90524af4-5b20-4412-9bfe-f1fe27f220b1</strong><br />
empty ( RO): false<br />
device ( RO): xvda</p>
<p>uuid ( RO)             : de177727-b28a-8b79-e73e-d08366d56277<br />
vm-uuid ( RO): eae053de-4a20-28a5-f335-f5a18dd79993<br />
vm-name-label ( RO): Cacti<br />
vdi-uuid ( RO): &lt;not in database&gt;<br />
empty ( RO): true<br />
device ( RO): xvdd</p></blockquote>
<p>It is very common that xvdd is used for CDROM, so we can safely ignore the second section. The first section is the more interesting one. There is a correlation between the name of the VDI and the name of the LVM on the disk. We can find this specific LV using the following command. Notice that the name of the VDI is used here as the argument for the &#8216;grep&#8217; command:</p>
<blockquote><p>lvs | grep <strong>90524af4-5b20-4412-9bfe-f1fe27f220b1 </strong></p>
<p>LV-90524af4-5b20-4412-9bfe-f1fe27f220b1 VG_XenStorage-4aa20fc2-fd92-20c2-c549-bed2597c622b -wi-a-  10.00G</p></blockquote>
<p>We now have our LV path! As you can see, its status is offline. We need to set it to online state. Using both the LV and the VG name, we can do it like that:</p>
<blockquote><p>lvchange -ay /dev/VG_XenStorage-4aa20fc2-fd92-20c2-c549-bed2597c622b/LV-90524af4-5b20-4412-9bfe-f1fe27f220b1</p></blockquote>
<p>Now we can access the volume. We can actually check that the problem is the one we look for, using pygrub:</p>
<blockquote><p>pygrub /dev/VG_XenStorage-4aa20fc2-fd92-20c2-c549-bed2597c622b/LV-90524af4-5b20-4412-9bfe-f1fe27f220b1</p></blockquote>
<p>We should now see the GRUB menu of the VM at question. If you don&#8217;t see any menu, either you have missed a step or used the wrong disk.</p>
<p>The menu should show you all the list of kernels. The default one is the one highlighted, and if it doesn&#8217;t include the word &#8220;xen&#8221; with it, most likely that we have found the problem.</p>
<p>We now need to change to a PV-capable kernel. We will need to access the &#8220;/boot&#8221; partition of the Linux VM, and change GRUB&#8217;s options there.</p>
<p>First we map the disk to a loop device, so we can access its partitions:</p>
<blockquote><p>losetup /dev/loop1 /dev/VG_XenStorage-4aa20fc2-fd92-20c2-c549-bed2597c622b/LV-90524af4-5b20-4412-9bfe-f1fe27f220b1</p></blockquote>
<p>Notice that you need to use the entire path to the LV, that the LV is online, and that loop1 is not in use. If it is, you will have a message saying something like &#8220;LOOP_SET_FD: Device or resource busy&#8221;</p>
<p>Now we need to access its partitions. We will map them using &#8216;kpartx&#8217; to /dev/mapper/ devices. Notice we&#8217;re using the same loop device name:</p>
<blockquote><p>kaprtx -a /dev/loop1</p></blockquote>
<p>Now, new files present themselves in /dev/mapper:</p>
<blockquote><p>ls -la /dev/mapper/<br />
total 0<br />
drwxr-xr-x  2 root root     220 Oct 24 12:39 .<br />
drwxr-xr-x 14 root root   16560 Oct 24 12:31 ..<br />
crw&#8212;&#8212;-  1 root root  10, 62 Sep 29 10:15 control<br />
brw-rw&#8212;-  1 root disk 252,  5 Oct 24 12:39 <strong>loop1p1</strong><br />
brw-rw&#8212;-  1 root disk 252,  6 Oct 24 12:39 <strong>loop1p2</strong><br />
brw-rw&#8212;-  1 root disk 252,  7 Oct 24 12:39 <strong>loop1p3</strong></p></blockquote>
<p>Usually, the first partition represents /boot, so we can now mount it and work on it:</p>
<blockquote><p>mount /dev/mapper/loop1p1 /mnt</p></blockquote>
<p>All we need to do is edit /mnt/grub/menu.lst to match our requirements, and then wrap everything back up:</p>
<blockquote><p>umount /mnt</p>
<p>kpartx -u /dev/loop1</p>
<p>losetup -d /dev/loop1</p></blockquote>
<p>We don&#8217;t have to change the LV to offline, because the XenServer will activate it if it&#8217;s not, however, we could do it, to be on the safe side:</p>
<blockquote><p>lvchange -an /dev/VG_XenStorage-4aa20fc2-fd92-20c2-c549-bed2597c622b/LV-90524af4-5b20-4412-9bfe-f1fe27f220b1</p></blockquote>
<p>Now we can activate the VM, and see it boot successfully.</p>
<p>This whole process takes several minutes the first time, and even less later.</p>
<p>I hope this helps.</p>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://run.tournament.org.il/xenserver-internal-error-failure-no-loader-found/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>XenServer create snapshots for all machines</title>
		<link>http://run.tournament.org.il/xenserver-create-snapshots-for-all-machines/</link>
		<comments>http://run.tournament.org.il/xenserver-create-snapshots-for-all-machines/#comments</comments>
		<pubDate>Fri, 07 Aug 2009 09:35:03 +0000</pubDate>
		<dc:creator>ez-aton</dc:creator>
				<category><![CDATA[Disk Storage]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Scripting/Programing]]></category>
		<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[netapp]]></category>
		<category><![CDATA[shell functions]]></category>
		<category><![CDATA[snapshot]]></category>
		<category><![CDATA[storage]]></category>
		<category><![CDATA[vm]]></category>
		<category><![CDATA[XenServer]]></category>

		<guid isPermaLink="false">http://run.tournament.org.il/?p=483</guid>
		<description><![CDATA[XenServer is a wonderful tool. One of the better parts of it is its powerful scripting language, powered by the &#8216;xe&#8217; command.
In order to capture a mass of snapshots, you can either do it manually from the GUI, or scripted. The script supplied below will include shell functions to capture Quiesce snapshots, and it that [...]


Related posts:<ol><li><a href='http://run.tournament.org.il/quick-provisioning-of-virtual-machines/' rel='bookmark' title='Permanent Link: Quick provisioning of virtual machines'>Quick provisioning of virtual machines</a> <small>When one wants to achieve fast provisioning of virtual machines,...</small></li>
<li><a href='http://run.tournament.org.il/relocating-lvs-with-snapshots/' rel='bookmark' title='Permanent Link: Relocating LVs with snapshots'>Relocating LVs with snapshots</a> <small>Linux LVM is a wonderful thing. It is scalable, flexible,...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>XenServer is a wonderful tool. One of the better parts of it is its powerful scripting language, powered by the &#8216;xe&#8217; command.</p>
<p>In order to capture a mass of snapshots, you can either do it manually from the GUI, or scripted. The script supplied below will include shell functions to capture Quiesce snapshots, and it that fails, normal snapshots of every <strong>running</strong> VM on the system.</p>
<p>Reason: NetApp SnapMirror, or other backup (maybe for later export) scheduled actions.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left2">Download <a href="http://run.tournament.org.il/wp-content/plugins/wp-codebox/wp-codebox.php?p=483&amp;download=xen_functions.sh">xen_functions.sh</a></span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p4838"><td class="code" id="p483code8"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #666666; font-style: italic;"># This script will supply functions for snapshotting and snapshot destroy including disks</span>
<span style="color: #666666; font-style: italic;"># Written by Ez-Aton</span>
<span style="color: #666666; font-style: italic;"># Visit my web blog for more stuff, at http://run.tournament.org.il</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Global variables:</span>
<span style="color: #007800;">UUID_LIST_FILE</span>=<span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>SNAP_UUIDS.txt
&nbsp;
<span style="color: #666666; font-style: italic;"># Function</span>
<span style="color: #000000; font-weight: bold;">function</span> assign_all_uuids <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
	<span style="color: #666666; font-style: italic;"># Construct artificial non-indexed list with name (removing annoying characters) and UUID</span>
	<span style="color: #007800;">LIST</span>=<span style="color: #ff0000;">&quot;&quot;</span>
	<span style="color: #000000; font-weight: bold;">for</span> UUID <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">`</span>xe vm-list power-state=running is-control-domain=<span style="color: #c20cb9; font-weight: bold;">false</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> uuid <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print $NF}'</span><span style="color: #000000; font-weight: bold;">`</span>
	<span style="color: #000000; font-weight: bold;">do</span>
		<span style="color: #007800;">NAME</span>=<span style="color: #000000; font-weight: bold;">`</span>xe vm-param-get param-name=name-label <span style="color: #007800;">uuid</span>=<span style="color: #007800;">$UUID</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">tr</span> <span style="color: #ff0000;">' '</span> _ <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">tr</span> <span style="color: #660033;">-d</span> <span style="color: #ff0000;">'('</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">tr</span> <span style="color: #660033;">-d</span> <span style="color: #ff0000;">')'</span><span style="color: #000000; font-weight: bold;">`</span>
		<span style="color: #007800;">LIST</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$LIST</span> <span style="color: #007800;">$NAME</span>:<span style="color: #007800;">$UUID</span>&quot;</span>
	<span style="color: #000000; font-weight: bold;">done</span>
	<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$LIST</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> take_snap_quiesce <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
	<span style="color: #666666; font-style: italic;"># We attempt to take a snapshot with quench</span>
	<span style="color: #666666; font-style: italic;"># Arguments: $1 name ; $2 uuid</span>
	<span style="color: #666666; font-style: italic;"># We attempt to snapshot the machine and set the value of snap_uuid to the snapshot uuid, if successful.</span>
	<span style="color: #666666; font-style: italic;"># Return 1 if failed</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #007800;">SNAP_UUID</span>=<span style="color: #000000; font-weight: bold;">`</span>xe vm-snapshot-with-quiesce <span style="color: #007800;">vm</span>=<span style="color: #007800;">$2</span> new-name-label=<span style="color: #800000;">${1}</span>_snapshot<span style="color: #000000; font-weight: bold;">`</span>
	<span style="color: #000000; font-weight: bold;">then</span>
		<span style="color: #666666; font-style: italic;"># echo &quot;Snapshot-with-quiesce for $1 successful&quot;</span>
		<span style="color: #7a0874; font-weight: bold;">return</span> <span style="color: #000000;">0</span>
	<span style="color: #000000; font-weight: bold;">else</span>
		<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Snapshot-with-quiesce for $1 failed&quot;</span>
		<span style="color: #7a0874; font-weight: bold;">return</span> <span style="color: #000000;">1</span>
	<span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> take_snap <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
	<span style="color: #666666; font-style: italic;"># We attempt to take a snapshot</span>
	<span style="color: #666666; font-style: italic;"># Arguments: $1 name ; $2 uuid</span>
	<span style="color: #666666; font-style: italic;"># We attempt to snapshot the machine and set the value of snap_uuid to the snapshot uuid, if successful.</span>
	<span style="color: #666666; font-style: italic;"># Return 1 if failed</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #007800;">SNAP_UUID</span>=<span style="color: #000000; font-weight: bold;">`</span>xe vm-snapshot <span style="color: #007800;">vm</span>=<span style="color: #007800;">$2</span> new-name-label=<span style="color: #800000;">${1}</span>_snapshot<span style="color: #000000; font-weight: bold;">`</span>
	<span style="color: #000000; font-weight: bold;">then</span>
		<span style="color: #666666; font-style: italic;">#echo &quot;Snapshot for $1 successful&quot;</span>
		<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$SNAP_UUID</span>
		<span style="color: #7a0874; font-weight: bold;">return</span> <span style="color: #000000;">0</span>
	<span style="color: #000000; font-weight: bold;">else</span>
		<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Snapshot-with-quiesce for $1 failed&quot;</span>
		<span style="color: #7a0874; font-weight: bold;">return</span> <span style="color: #000000;">1</span>
	<span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> stop_ha_template <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
	<span style="color: #666666; font-style: italic;"># Templates inherit their settings from the origin</span>
	<span style="color: #666666; font-style: italic;"># We need to turn off HA</span>
	<span style="color: #666666; font-style: italic;"># $1 : Template UUID</span>
	<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-z</span> <span style="color: #ff0000;">&quot;$1&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>
	<span style="color: #000000; font-weight: bold;">then</span>
		<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Missing template UUID&quot;</span>
		<span style="color: #7a0874; font-weight: bold;">return</span> <span style="color: #000000;">1</span>
	<span style="color: #000000; font-weight: bold;">fi</span>
	xe template-param-set ha-always-run=<span style="color: #c20cb9; font-weight: bold;">false</span> <span style="color: #007800;">uuid</span>=<span style="color: #007800;">$1</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> get_vdi <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
	<span style="color: #666666; font-style: italic;"># This function will get a space delimited list of VDI UUIDs of a given snapshot/template UUID</span>
	<span style="color: #666666; font-style: italic;"># Arguments: $1 template UUID</span>
	<span style="color: #666666; font-style: italic;"># It will also verify that each VBD is an actual snapshot</span>
	<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-z</span> <span style="color: #ff0000;">&quot;$1&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>
	<span style="color: #000000; font-weight: bold;">then</span>
		<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;No arguments? We need the template UUID&quot;</span>
		<span style="color: #7a0874; font-weight: bold;">return</span> <span style="color: #000000;">1</span>
	<span style="color: #000000; font-weight: bold;">fi</span>
	<span style="color: #007800;">VDIS</span>=<span style="color: #ff0000;">&quot;&quot;</span>
	<span style="color: #000000; font-weight: bold;">for</span> VBD <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">`</span>xe vbd-list vm-uuid=<span style="color: #007800;">$1</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> ^uuid <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print $NF}'</span><span style="color: #000000; font-weight: bold;">`</span>
	<span style="color: #000000; font-weight: bold;">do</span>
		<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;VBD: <span style="color: #007800;">$VBD</span>&quot;</span>
		<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #000000; font-weight: bold;">`</span>xe vbd-param-get param-name=<span style="color: #7a0874; font-weight: bold;">type</span> <span style="color: #007800;">uuid</span>=<span style="color: #007800;">$VBD</span><span style="color: #000000; font-weight: bold;">`</span> = <span style="color: #ff0000;">&quot;CD&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>
		<span style="color: #000000; font-weight: bold;">then</span>
			<span style="color: #007800;">CUR_VDI</span>=<span style="color: #000000; font-weight: bold;">`</span>xe vdi-list vbd-uuids=<span style="color: #007800;">$VBD</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> ^uuid <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print $NF}'</span><span style="color: #000000; font-weight: bold;">`</span>
			<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #000000; font-weight: bold;">`</span>xe vdi-param-get <span style="color: #007800;">uuid</span>=<span style="color: #007800;">$CUR_VDI</span> param-name=is-a-snapshot<span style="color: #000000; font-weight: bold;">`</span>
			<span style="color: #000000; font-weight: bold;">then</span>
				<span style="color: #007800;">VDIS</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$VDIS</span> <span style="color: #007800;">$CUR_VDI</span>&quot;</span>
			<span style="color: #000000; font-weight: bold;">else</span>
				<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;VDI is not a snapshot!&quot;</span>
				<span style="color: #7a0874; font-weight: bold;">return</span> <span style="color: #000000;">1</span>
			<span style="color: #000000; font-weight: bold;">fi</span>
			<span style="color: #007800;">CUR_VDI</span>=<span style="color: #ff0000;">&quot;&quot;</span>
		<span style="color: #000000; font-weight: bold;">fi</span>
	<span style="color: #000000; font-weight: bold;">done</span>
	<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$VDIS</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> remove_vdi <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
	<span style="color: #666666; font-style: italic;"># This function will get a list of VDIs and remove them</span>
	<span style="color: #666666; font-style: italic;"># Carefull!</span>
	<span style="color: #000000; font-weight: bold;">for</span> VDI <span style="color: #000000; font-weight: bold;">in</span> $<span style="color: #000000; font-weight: bold;">@</span>
	<span style="color: #000000; font-weight: bold;">do</span>
		<span style="color: #000000; font-weight: bold;">if</span> xe vdi-destroy <span style="color: #007800;">uuid</span>=<span style="color: #007800;">$VDI</span>
		<span style="color: #000000; font-weight: bold;">then</span>
			<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Success in removing VDI <span style="color: #007800;">$VDI</span>&quot;</span>
		<span style="color: #000000; font-weight: bold;">else</span>
			<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Failure in removing VDI <span style="color: #007800;">$VDI</span>&quot;</span>
			<span style="color: #7a0874; font-weight: bold;">return</span> <span style="color: #000000;">1</span>
		<span style="color: #000000; font-weight: bold;">fi</span>
	<span style="color: #000000; font-weight: bold;">done</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> remove_template <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
	<span style="color: #666666; font-style: italic;"># This funciton will remove a template</span>
	<span style="color: #666666; font-style: italic;"># $1 template UUID</span>
	<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-z</span> <span style="color: #ff0000;">&quot;$1&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>
	<span style="color: #000000; font-weight: bold;">then</span>
		<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Required UUID&quot;</span>
		<span style="color: #7a0874; font-weight: bold;">return</span> <span style="color: #000000;">1</span>
	<span style="color: #000000; font-weight: bold;">fi</span>
	xe template-param-set is-a-template=<span style="color: #c20cb9; font-weight: bold;">false</span> <span style="color: #007800;">uuid</span>=<span style="color: #007800;">$1</span>
	<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #000000; font-weight: bold;">!</span> xe vm-uninstall <span style="color: #007800;">force</span>=<span style="color: #c20cb9; font-weight: bold;">true</span> <span style="color: #007800;">uuid</span>=<span style="color: #007800;">$1</span>
	<span style="color: #000000; font-weight: bold;">then</span>
		<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Failure to remove VM/Template&quot;</span>
		<span style="color: #7a0874; font-weight: bold;">return</span> <span style="color: #000000;">1</span>
	<span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> remove_all_template <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
	<span style="color: #666666; font-style: italic;"># This function will completely remove a template</span>
	<span style="color: #666666; font-style: italic;"># The steps are as follow:</span>
	<span style="color: #666666; font-style: italic;"># $1 is the UUID of the template</span>
	<span style="color: #666666; font-style: italic;"># Calculate its VDIs</span>
	<span style="color: #666666; font-style: italic;"># Remove the template</span>
	<span style="color: #666666; font-style: italic;"># Remove the VDIs</span>
	<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-z</span> <span style="color: #ff0000;">&quot;$1&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>
	<span style="color: #000000; font-weight: bold;">then</span>
		<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;No Template UUID was supplied&quot;</span>
		<span style="color: #7a0874; font-weight: bold;">return</span> <span style="color: #000000;">1</span>
	<span style="color: #000000; font-weight: bold;">fi</span>
	<span style="color: #666666; font-style: italic;"># We now collect the value of $VDIS</span>
	get_vdi <span style="color: #007800;">$1</span>
	<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;$?&quot;</span> <span style="color: #660033;">-ne</span> <span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>
	<span style="color: #000000; font-weight: bold;">then</span>
		<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Failed to get VDIs for Template $1&quot;</span>
		<span style="color: #7a0874; font-weight: bold;">return</span> <span style="color: #000000;">1</span>
	<span style="color: #000000; font-weight: bold;">fi</span>
	<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #000000; font-weight: bold;">!</span> remove_template <span style="color: #007800;">$1</span>
	<span style="color: #000000; font-weight: bold;">then</span>
		<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Failure to remove template $1&quot;</span>
		<span style="color: #7a0874; font-weight: bold;">return</span> <span style="color: #000000;">1</span>
	<span style="color: #000000; font-weight: bold;">fi</span>
	<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #000000; font-weight: bold;">!</span> remove_vdi <span style="color: #007800;">$VDIS</span>
	<span style="color: #000000; font-weight: bold;">then</span>
		<span style="color: #7a0874; font-weight: bold;">return</span> <span style="color: #000000;">1</span>
	<span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> create_all_snapshots <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
	<span style="color: #666666; font-style: italic;"># In this function we will run all over $LIST and create snapshots of each machine, keeping the UUID of it inside a file</span>
	<span style="color: #666666; font-style: italic;"># $@ - list of machines in the $LIST format</span>
	<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-f</span> <span style="color: #007800;">$UUID_LIST_FILE</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>
	<span style="color: #000000; font-weight: bold;">then</span>
		<span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #007800;">$UUID_LIST_FILE</span> <span style="color: #007800;">$UUID_LIST_FILE</span>.<span style="color: #007800;">$$</span>
	<span style="color: #000000; font-weight: bold;">fi</span>
	<span style="color: #000000; font-weight: bold;">for</span> i <span style="color: #000000; font-weight: bold;">in</span> $<span style="color: #000000; font-weight: bold;">@</span>
	<span style="color: #000000; font-weight: bold;">do</span>
		<span style="color: #007800;">SNAP_UUID</span>=<span style="color: #000000; font-weight: bold;">`</span>take_snap_quiesce <span style="color: #800000;">${i%%:*}</span> <span style="color: #800000;">${i##*:}</span><span style="color: #000000; font-weight: bold;">`</span>
		<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;$?&quot;</span> <span style="color: #660033;">-ne</span> <span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>
		<span style="color: #000000; font-weight: bold;">then</span>
			<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Problem taking snapshot with quiesce for <span style="color: #007800;">${i%%:*}</span>&quot;</span>
			<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Attempting normal snapshot&quot;</span>
			<span style="color: #007800;">SNAP_UUID</span>=<span style="color: #000000; font-weight: bold;">`</span>take_snap <span style="color: #800000;">${i%%:*}</span> <span style="color: #800000;">${i##*:}</span><span style="color: #000000; font-weight: bold;">`</span>
			<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;$?&quot;</span> <span style="color: #660033;">-ne</span> <span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>
                	<span style="color: #000000; font-weight: bold;">then</span>
                        	<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Problem taking snapshot for <span style="color: #007800;">${i%%:*}</span>&quot;</span>
				<span style="color: #007800;">SNAP_UUID</span>=<span style="color: #ff0000;">&quot;&quot;</span>
			<span style="color: #000000; font-weight: bold;">fi</span>
		<span style="color: #000000; font-weight: bold;">fi</span>
		stop_ha_template <span style="color: #007800;">$SNAP_UUID</span>
		<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$SNAP_UUID</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #007800;">$UUID_LIST_FILE</span>
	<span style="color: #000000; font-weight: bold;">done</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span></pre></td></tr></table></div>

<p>Possible use will be like this:</p>
<blockquote><p>. /usr/local/bin/xen_functions.sh</p>
<p>create_all_snapshots `assign_all_uuids` &#038;> /tmp/snap_create.log</p></blockquote>


<p>Related posts:<ol><li><a href='http://run.tournament.org.il/quick-provisioning-of-virtual-machines/' rel='bookmark' title='Permanent Link: Quick provisioning of virtual machines'>Quick provisioning of virtual machines</a> <small>When one wants to achieve fast provisioning of virtual machines,...</small></li>
<li><a href='http://run.tournament.org.il/relocating-lvs-with-snapshots/' rel='bookmark' title='Permanent Link: Relocating LVs with snapshots'>Relocating LVs with snapshots</a> <small>Linux LVM is a wonderful thing. It is scalable, flexible,...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://run.tournament.org.il/xenserver-create-snapshots-for-all-machines/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oracle Clusterware as a 3rd party HA framework</title>
		<link>http://run.tournament.org.il/oracle-clusterware-as-a-3rd-party-ha-framework/</link>
		<comments>http://run.tournament.org.il/oracle-clusterware-as-a-3rd-party-ha-framework/#comments</comments>
		<pubDate>Thu, 11 Jun 2009 23:17:11 +0000</pubDate>
		<dc:creator>ez-aton</dc:creator>
				<category><![CDATA[Clusters]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[cluster]]></category>
		<category><![CDATA[crs]]></category>
		<category><![CDATA[failover]]></category>
		<category><![CDATA[HA]]></category>
		<category><![CDATA[nfs]]></category>
		<category><![CDATA[ocfs]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[storage]]></category>

		<guid isPermaLink="false">http://run.tournament.org.il/?p=477</guid>
		<description><![CDATA[Oracle begin to push their Clusterware as a 3rd party HA framework. In this article we will review a quick example of how to do it. I will refer to this post as a quick-guide, as this is by no means any full-scale guide.
This article assumes you have installed Oracle Clusterware following one of the [...]


Related posts:<ol><li><a href='http://run.tournament.org.il/oracle-rac-with-emc-iscsi-storage-panics/' rel='bookmark' title='Permanent Link: Oracle RAC with EMC iSCSI Storage Panics'>Oracle RAC with EMC iSCSI Storage Panics</a> <small>I have had a system panicking when running the mentioned...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Oracle begin to push their Clusterware as a 3rd party HA framework. In this article we will review a quick example of how to do it. I will refer to this post as a quick-guide, as this is by no means any full-scale guide.</p>
<p>This article assumes you have installed <a href="http://www.oracle.com/technology/products/database/clusterware/index.html" target="_blank">Oracle Clusterware</a> following <a href="http://www.oracle.com/technology/pub/articles/smiley_rac10g_install.html" target="_blank">one of the few links</a> <a href="http://youngcow.net/doc/oracle10g/install.102/b14203/crsunix.htm" target="_blank">and guides</a> <a href="http://onlineappsdba.com/index.php/2007/07/22/oracle-rac-part-iv-install-oracle-clusterware-and-cluster-database/" target="_blank">available</a> <a href="http://oracle.su/install.111/b28263/crsunix.htm" target="_blank">on the net</a>. This quick-guide applies to both Clusterware 10 and Clusterware 11.</p>
<p>We will discuss the method of adding an additional NFS service on Linux.</p>
<p>In order to do so, you will need a shared storage &#8211; assuming the goal of the exercise is to supply the clients with a consistent storage services based on NFS. I, for myself, prefer to use OCFS2 as the choice file system for shared disks. This goes well with Oracle Clusterware, as this cluster framework does not handle disk mounts very well, and unless you are to write/search an agent which will make sure that every mount and umount behave correctly (you wouldn&#8217;t want to get a file system corruption, would you?), you will probably prefer to do the same. The lack of need to manage the disk mount actions will both save time on planned failover, and will guarantee storage safety. If you have not placed your CRS and Vote on OCFS2, you will need to install OCFS2 from <a href="http://oss.oracle.com/projects/ocfs2/" target="_blank">here</a> and <a href="http://oss.oracle.com/projects/ocfs2-tools/" target="_blank">here</a>, and then to configure it. We will not discuss OCFS2 configuration in this post.</p>
<p>We will need to assume the following prerequisites:</p>
<ul>
<li>Service-related IP address: 1.2.3.4. Netmask 255.255.255.248. You need this IP to be member of the same class as your public network card is.</li>
<li>Shared Storage: Formatted to OCFS2, and mounted on both nodes on /shared</li>
<li>Oracle Clusterware installed and working</li>
<li>Cluster nodes names are &#8220;node1&#8243; and &#8220;node2&#8243;</li>
<li>Have $CRS_HOME point to your CRS installation</li>
<li>Have $CRS_HOME/bin in your $PATH</li>
</ul>
<p>We need to create the service-related IP resource first. I would recommend to have an entry in /etc/hosts for this IP address on both nodes. Assuming the public NIC is eth0, The command would be</p>
<blockquote><p>crs_profile -create nfs_ip -t application -a $CRS_HOME/bin/usrvip -o oi=eth0,ov=1.2.3.4,on=255.255.255.248</p></blockquote>
<p>Now you will need to set running permissions for the oracle user. In my case, the user name is actually &#8220;oracle&#8221;:</p>
<blockquote><p>crs_setperm nfs_ip -o root<br />
crs_serperm nfs_ip -u user:oracle:r-x</p></blockquote>
<p>Test that you can start the service as the oracle user:</p>
<blockquote><p>crs_start nfs_ip</p></blockquote>
<p>Now we need to setup NFS. For this to work, we need to setup the NFS daemon first. Edit /etc/exports and add a line such as this:</p>
<blockquote><p>/shared *(rw,no_root_sqush,sync)</p></blockquote>
<p>Make sure that nfs service is disabled during startup:</p>
<blockquote><p>chkconfig nfs off<br />
chkconfig nfslock off</p></blockquote>
<p>Now is the time to setup Oracle Clusterware for the task:</p>
<blockquote><p>crs_profile -create share_nfs -t application -B /etc/init.d/nfs -d &#8220;Shared NFS&#8221; -r nfs_ip -a sharenfs.scr -p favored -h &#8220;node1 node2&#8243; -o ci=30,ft=3,fi=12,ra=5<br />
crs_register share_nfs</p></blockquote>
<p>Deal with permissions:</p>
<blockquote><p>crs_setperms share_nfs -o root<br />
crs_setperms share_nfs -u user:oracle:r-x</p></blockquote>
<p>Fix the &#8220;sharenfs.scr&#8221; script. First, find it. It should reside in $CRS_HOME/crs/scripts if everything is OK. If not, you will be able to find it in $CRS_HOME using find.</p>
<p>Edit the &#8220;sharenfs.scr&#8221; script and modify the following variables which are defined relatively in the beginning of the script:</p>
<blockquote><p>PROBE_PROCS=&#8221;nfsd&#8221;<br />
START_APPCMD=&#8221;/etc/init.d/nfs start<br />
START_APPCMD2=&#8221;/etc/init.d/nfslock start&#8221;<br />
STOP_APPCMD=&#8221;/etc/init.d/nfs stop&#8221;<br />
STOP_APPCMD2=&#8221;/etc/init.d/nfslock stop&#8221;</p></blockquote>
<p>Copy the modified script file to the other node. Verify this script has execution permissions on both nodes.</p>
<p>Start the service as the oracle user:</p>
<blockquote><p>crs_start sharenfs</p></blockquote>
<p>Test the service. The following command should return the export path:</p>
<blockquote><p>showmount -e 1.2.3.4</p></blockquote>
<p>Relocate the service and test again:</p>
<blockquote><p>crs_relocate -f sharenfs<br />
showmount -e 1.2.3.4</p></blockquote>
<p>Done. You now have HA NFS service above Oracle Clusterware framework.</p>
<p>I used <a href="http://www.nextre.it/oracledocs/oracleclusterware01.html" target="_blank">this web page</a> as a reference. I thank him for his great work!</p>


<p>Related posts:<ol><li><a href='http://run.tournament.org.il/oracle-rac-with-emc-iscsi-storage-panics/' rel='bookmark' title='Permanent Link: Oracle RAC with EMC iSCSI Storage Panics'>Oracle RAC with EMC iSCSI Storage Panics</a> <small>I have had a system panicking when running the mentioned...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://run.tournament.org.il/oracle-clusterware-as-a-3rd-party-ha-framework/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Work around ISP QoS limitations</title>
		<link>http://run.tournament.org.il/work-around-isp-qos-limitations/</link>
		<comments>http://run.tournament.org.il/work-around-isp-qos-limitations/#comments</comments>
		<pubDate>Fri, 29 May 2009 09:38:32 +0000</pubDate>
		<dc:creator>ez-aton</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[cacti]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[ISP]]></category>
		<category><![CDATA[Linux router]]></category>
		<category><![CDATA[masquerade]]></category>
		<category><![CDATA[mrtg]]></category>
		<category><![CDATA[nntp]]></category>
		<category><![CDATA[QoS]]></category>
		<category><![CDATA[VPN]]></category>

		<guid isPermaLink="false">http://run.tournament.org.il/?p=466</guid>
		<description><![CDATA[ISPs which enforce QoS limitations suddenly, without alerting the customer, are abusing their force. QoS limitation is not a bad thing, from the ISP&#8217;s point of view, but changing the customer deal without notifying him seems to me to be unfair.
This is a recipe for a QoS workaround.
Ingredients:

One fast Internet connection which is not used [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>ISPs which enforce QoS limitations suddenly, without alerting the customer, are abusing their force. QoS limitation is not a bad thing, from the ISP&#8217;s point of view, but changing the customer deal without notifying him seems to me to be unfair.</p>
<p>This is a recipe for a QoS workaround.</p>
<p>Ingredients:</p>
<ul>
<li>One fast Internet connection which is not used to its full capacity</li>
<li>Defined target service provider. I use <a href="http://www.giganews.com/?c=ezaton" target="_blank">Giganews</a> as an NNTP, which is the fastest method of obtaining content today. You should have the service list of IPs. Luckily, Giganews use only two IP addresses</li>
<li>One &#8220;evil&#8221; ISP which enforces QoS for external targets</li>
<li>One server in the ISP&#8217;s hosting farm, which has no speed or transfer limitations, and is probably not bound by the ISP&#8217;s QoS</li>
<li>For a better looking dish &#8211; some graphing solution, such as <a href="http://cacti.net" target="_blank">Cacti</a> or MRTG</li>
</ul>
<p>Directions:</p>
<ul>
<li>Setup <a href="http://openvpn.net/index.php/open-source/documentation/howto.html" target="_blank">OpenVPN Server</a> on the hosted server</li>
<li>Setup OpenVPN Client on your NNTP/Other service client (your desktop, your <a href="http://run.tournament.org.il/cables-connection-in-israel-for-linux/" target="_blank">Linux router</a>, etc) &#8211; This can also be a Windows machine, but configuration varies a bit.</li>
<li>Define, in your OpenVPN client.conf line(s) which look like this:</li>
</ul>
<blockquote><p>route &lt;SERVICE_IP&gt;</p>
<p>route &lt;SERVICE_IP2&gt;</p></blockquote>
<ul>
<li>If this is a router machine, activate NAT on it. Of course &#8211; remember to set this rule to work after reboot too!</li>
</ul>
<blockquote><p>iptables -t nat -A POSTROUTING -o tun+ -j MASQUERADE</p></blockquote>
<ul>
<li>For your good feeling, try to pickup data from before and after, and compare.</li>
<li>Start the OpenVPN Service on the server, on the client, and restart your NNTP/Other service downloads.</li>
<li>Serve with a smile <img src='http://run.tournament.org.il/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </li>
</ul>
<p>The result dish is both tasty and good looking! see below:</p>
<p><a href="http://run.tournament.org.il/files/2009/05/Qos_override.png"><img class="alignnone size-full wp-image-467" title="QoS_override.png" src="http://run.tournament.org.il/files/2009/05/graph_imagephp.png" alt="QoS_override.png" width="603" height="286" /></a></p>
<p>A word of warning &#8211; OpenVPN is a VPN tool. As such, it uses encryption and varios methods which are very secure. This means that for high througput, such as mine (about 10Mb/s) you will see the impact on the router/workstation&#8217;s CPU. Under virtualization, I get about 2% additional system CPU utilization from a 2&#215;3GHz Xeon CPU. For older router devices this could result in an overworked router. I am so glad I got rid of my old P2 350MHz router in favor of the virtualized one.</p>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://run.tournament.org.il/work-around-isp-qos-limitations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LVM Recovery</title>
		<link>http://run.tournament.org.il/lvm-recovery/</link>
		<comments>http://run.tournament.org.il/lvm-recovery/#comments</comments>
		<pubDate>Thu, 28 May 2009 23:33:48 +0000</pubDate>
		<dc:creator>ez-aton</dc:creator>
				<category><![CDATA[Disk Storage]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[HA]]></category>
		<category><![CDATA[LVM]]></category>
		<category><![CDATA[lvm pv]]></category>
		<category><![CDATA[restore]]></category>

		<guid isPermaLink="false">http://run.tournament.org.il/?p=462</guid>
		<description><![CDATA[A friend of mine made a grieve mistake &#8211; partition a disk containing Linux LVM directly on it, without any partition table. Oops.
When dealing with multi-Tera sized disks, one gets to encounter limitations not known on smaller scales &#8211; the 2TB limitation. Normal partition table can contain only around 2TB mapping, meaning that to create [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>A friend of mine made a grieve mistake &#8211; partition a disk containing Linux LVM directly on it, without any partition table. Oops.</p>
<p>When dealing with multi-Tera sized disks, one gets to encounter limitations not known on smaller scales &#8211; the 2TB limitation. Normal partition table can contain only around 2TB mapping, meaning that to create larger partitions, or even smaller partitions which exceed that specific limit, you have to take one of two actions:</p>
<ul>
<li>Use GPT partition tables, which is meant for large disks, and partition the disk to the size limits you desire</li>
<li>Define LVM PV directly on the block device (the command would look like &#8216;pvcreate /dev/sdb -&gt; see? No partitions)</li>
</ul>
<p>&#8220;Surprisingly&#8221; and for no good reason, it appears that the disk which was used completely for the LVM PV suddenly had a single GPT partition on it. Hmmmm.</p>
<p>This is/was a single disk in a two-PV VG continging a single LV spanned all over the VG space. Following the &#8220;mysterious&#8221; actions, the VG refused to start, claiming that it could not find PV with PVID &lt;some UID&gt;.</p>
<p>This is a step where one should stop and call a professional if he doesn&#8217;t know for sure how to continue. These following actions are very risky to your data, and could result in you either recovering from tapes (if exist) or seeking a new job, if this is/was some mission-critical data.</p>
<p>First &#8211; go to /etc/lvm/archive and find the latest file named after the VG which has been destroyed. Look into it &#8211; you should see the PV is in there. Search the PV based on the UID reported not to repond on the logs.</p>
<p>Second &#8211; you need to remove the GPT partition from the disk. The PV will be recreated exactly as it was suppoed to be before. Replace /dev/some_disk with your own device file.</p>
<blockquote><p>fdisk /dev/some_disk</p>
<p>d</p>
<p>w</p></blockquote>
<p>Third &#8211; Reread the VG archive file, to be on the safe side. Verify again that the PV you are about to recreate is the one you are to. When done, run the following command</p>
<blockquote><p>pvcreate -u &lt;UID&gt; /dev/some_disk</p></blockquote>
<p>Again &#8211; the name of the device file has been changed in this example to prevent copy-paste incidents from happening.</p>
<p>Fourth &#8211; Run vgcfgrestore with the name of the VG as parameter. This command would restore your meta information into the PV and VG.</p>
<blockquote><p>vgcfgrestore VG_TEST</p></blockquote>
<p>Fifth &#8211; Activate the VG:</p>
<blockquote><p>vgchange -ay VG_TEST</p></blockquote>
<p>Now the volumes should be up, and you have the ability to attempt to mount these volumes.</p>
<p>Notice that the data might be corrupted in some way. Running fsck is recommended, although time-consuming.</p>
<p>Good luck!</p>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://run.tournament.org.il/lvm-recovery/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Cables connection in Israel for Linux</title>
		<link>http://run.tournament.org.il/cables-connection-in-israel-for-linux/</link>
		<comments>http://run.tournament.org.il/cables-connection-in-israel-for-linux/#comments</comments>
		<pubDate>Thu, 14 May 2009 21:38:51 +0000</pubDate>
		<dc:creator>ez-aton</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Scripting/Programing]]></category>
		<category><![CDATA[cables]]></category>
		<category><![CDATA[dialer]]></category>
		<category><![CDATA[GUI]]></category>
		<category><![CDATA[l2tp]]></category>
		<category><![CDATA[redhat]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://run.tournament.org.il/?p=454</guid>
		<description><![CDATA[Update to 0.2. Links remain the same. At the moment I cannot host many versions (it&#8217;s mostly uncomfortable), but this might change in the future.
I have created a GUI cables installer and configurator for L2TP on Linux.
I have noticed that there is no GUI solution, so, after this has been brought up, I have done [...]


Related posts:<ol><li><a href='http://run.tournament.org.il/cables-in-israel-and-l2tp-on-fedora-core-3-linux/' rel='bookmark' title='Permanent Link: Cables in Israel and L2TP on Fedora Core 3 Linux'>Cables in Israel and L2TP on Fedora Core 3 Linux</a> <small>I have noticed there is no fixed guide for L2TP...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Update to 0.2. Links remain the same. At the moment I cannot host many versions (it&#8217;s mostly uncomfortable), but this might change in the future.</p>
<p>I have created a GUI cables installer and configurator for L2TP on Linux.</p>
<p>I have noticed that there is no GUI solution, so, after this has been brought up, I have done it (!!!)</p>
<p>I have uploaded these files here, and you are welcome to use them.</p>
<p>Remember &#8211; they are designed for a blank Ubuntu (currently. More distros will be supported in the future, upon request) with not much of junk installed. Also &#8211; they are designed for the simple user. Double-click and run. That&#8217;s it.</p>
<p>Quoting my readme file:</p>
<blockquote><p>L2TP Cables connection in Israel (and across the world, where relevant) by Ez-Aton</p>
<p>&#8212;About:<br />
This is an installer and configurator for L2TP over cables in Israel<br />
With some luck, by running this installer, you will be able to connect<br />
to the Internet with a dialer!</p>
<p>The system assumes you have little technical knowledge of Linux and you<br />
are not expected to have any. Follow the defaults, and you should be fine.</p>
<p>This configuration will be cross distro in the future, meaning it will work<br />
both on your Ubuntu, your RHEL, your Centos, Mandrake, etc. In order for me<br />
to be able to do so, please assist by sending information on systems I am<br />
not familiar with yet, per the appendix at the bottom.<br />
Also, you can feel free to send me info in case the system did not work for<br />
you (and let me know what are the differences from a default installation),<br />
or, as always, send me money.</p>
<p>Visit my technical blog for updates and all kind of other technical stuff, at</p>
<p>http://run.tournament.org.il</p>
<p>OSS work is meant to be based on others work, and that I have done. I would<br />
like to thank (and mention below) the resources for without this would not<br />
have happened.</p>
<p>I hope you enjoy this dialer!</p>
<p>Ez</p>
<p>&#8212;How to use<br />
Simply double-click on the &#8220;cables&#8221; icon on your desktop, and the system will<br />
get you connected.<br />
For CLI utilization: Run /usr/local/bin/cables</p>
<p>&#8212;Tools and resources used:<br />
To create this package I have used the following tools and resources<br />
makeself http://megastep.org/makeself/<br />
xl2tpd by http://www.xelerance.com/software/xl2tpd/<br />
xl2tpd guide for Israel Cables http://stuff.pulkes.org/l2tp/<br />
ISP LNS list http://www.cables.org.il/cable-vpn/vpn.html<br />
My connect/disconnect scripts from http://run.tournament.org.il</p>
<p>&#8212;License<br />
This package contents are under GNUv2 license, meaning you have full permission<br />
to modify the contents of this package, except for the binary packages included<br />
with it, where you are binded by their respective licenses.</p>
<p>&#8212;My Distro/ISP is not supported!<br />
Well, these things happen. Over 300 distros our there, and I can&#8217;t have them all.<br />
However &#8211; you have your own distro, right? For me to add it to this package<br />
(assuming you don&#8217;t want to do this yourself) you will have to supply me with the<br />
following info:<br />
* What distro, kernel and version, and how you get the distro name<br />
(for example &#8211; on Redhat &#8211; /etc/redhat-release. On Ubuntu &#8211; /etc/lsb-release)<br />
* The file containing the version inforamtion (see above)<br />
* The versions available from your repositories of xl2tpd or l2tpd for older<br />
releases, and where you can get them<br />
* Your ISP, your ISPs LNS names/addresses<br />
* Your country<br />
* All other info you think relevant</p>
<p>&#8212;Change log<br />
0.2 &#8211; Added ability to enter manual LNS address. Added Orange LNS. Fixed fixroute to allow both IP and hostname without problems. Fixed cables connection script to run fixroute anyhow.<br />
0.1 &#8211; Initial release</p></blockquote>
<p>Download it here: <a href="http://run.tournament.org.il/files/2009/05/cables_connect.sh">cables_connect.sh</a></p>
<p>If you want the scripts and sources (not for the simple user!), you can get there here: <a href="http://run.tournament.org.il/wp-content/blogs.dir/27/files/2009/05/l2tp-cables.tgz">l2tp-cables</a><a href="http://run.tournament.org.il/files/2009/05/l2tp-cablestar.gz"></a></p>


<p>Related posts:<ol><li><a href='http://run.tournament.org.il/cables-in-israel-and-l2tp-on-fedora-core-3-linux/' rel='bookmark' title='Permanent Link: Cables in Israel and L2TP on Fedora Core 3 Linux'>Cables in Israel and L2TP on Fedora Core 3 Linux</a> <small>I have noticed there is no fixed guide for L2TP...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://run.tournament.org.il/cables-connection-in-israel-for-linux/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
