<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Shell scripting EC2 for fun and profit</title>
	<atom:link href="http://www.cerebralmastication.com/2011/05/shell-scripting-ec2-for-fun-and-profit/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.cerebralmastication.com/2011/05/shell-scripting-ec2-for-fun-and-profit/</link>
	<description>Something to Chew On</description>
	<lastBuildDate>Wed, 02 Jan 2013 17:07:00 -0500</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: John Dennison</title>
		<link>http://www.cerebralmastication.com/2011/05/shell-scripting-ec2-for-fun-and-profit/comment-page-1/#comment-34797</link>
		<dc:creator>John Dennison</dc:creator>
		<pubDate>Thu, 26 May 2011 21:36:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.cerebralmastication.com/?p=993#comment-34797</guid>
		<description>The EOF1 redirects got deleted in the copy. they should look like 

ssh -t -t -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no jdennison@$name&lt;&lt;EOF1
exit
EOF1</description>
		<content:encoded><![CDATA[<p>The EOF1 redirects got deleted in the copy. they should look like </p>
<p>ssh -t -t -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no jdennison@$name&lt;&lt;EOF1<br />
exit<br />
EOF1</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Dennison</title>
		<link>http://www.cerebralmastication.com/2011/05/shell-scripting-ec2-for-fun-and-profit/comment-page-1/#comment-34655</link>
		<dc:creator>John Dennison</dc:creator>
		<pubDate>Wed, 25 May 2011 21:47:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.cerebralmastication.com/?p=993#comment-34655</guid>
		<description>I have been working to automate the creation of ec2 for automated data runs. I have stolen your script and added some redundancies. I was having alot of problems with the EC2 machine denying my initial ssh requests so i built in if statement to retry. I am using a keypair already on the AMI. so no need for amazon key.

instance_id=$(ec2-run-instances -g $secGroup -t t1.micro $ami &#124; awk &#039;/INSTANCE/{print $2}&#039;)
echo $instance_id

name=$(ec2-describe-instances $instance_id &#124; awk &#039;/INSTANCE/{print $4}&#039;)
while [ $name = pending ] ; do
sleep 5
name=$(ec2-describe-instances $instance_id &#124; awk &#039;/INSTANCE/{print $4}&#039;)
echo $name
done
sleep 10
OUT=0
OUT1=0

ssh -t -t -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no jdennison@$name&lt;&lt;EOF
exit
EOF
OUT=$?
if [ $OUT -ne 0 ];
then
echo &quot;failed&quot;
sleep 15
ssh -t -t -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no jdennison@$name&lt;&lt;EOF1
exit
EOF1
OUT1=$?
fi

if [ $OUT1 -ne 0 ];
then
echo &quot;SECOND FAIL&quot;
sleep 10
fi</description>
		<content:encoded><![CDATA[<p>I have been working to automate the creation of ec2 for automated data runs. I have stolen your script and added some redundancies. I was having alot of problems with the EC2 machine denying my initial ssh requests so i built in if statement to retry. I am using a keypair already on the AMI. so no need for amazon key.</p>
<p>instance_id=$(ec2-run-instances -g $secGroup -t t1.micro $ami | awk &#8216;/INSTANCE/{print $2}&#8217;)<br />
echo $instance_id</p>
<p>name=$(ec2-describe-instances $instance_id | awk &#8216;/INSTANCE/{print $4}&#8217;)<br />
while [ $name = pending ] ; do<br />
sleep 5<br />
name=$(ec2-describe-instances $instance_id | awk &#8216;/INSTANCE/{print $4}&#8217;)<br />
echo $name<br />
done<br />
sleep 10<br />
OUT=0<br />
OUT1=0</p>
<p>ssh -t -t -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no jdennison@$name<<EOF<br />
exit<br />
EOF<br />
OUT=$?<br />
if [ $OUT -ne 0 ];<br />
then<br />
echo &#8220;failed&#8221;<br />
sleep 15<br />
ssh -t -t -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no jdennison@$name<<EOF1<br />
exit<br />
EOF1<br />
OUT1=$?<br />
fi</p>
<p>if [ $OUT1 -ne 0 ];<br />
then<br />
echo &#8220;SECOND FAIL&#8221;<br />
sleep 10<br />
fi</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike</title>
		<link>http://www.cerebralmastication.com/2011/05/shell-scripting-ec2-for-fun-and-profit/comment-page-1/#comment-32327</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Mon, 09 May 2011 11:38:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.cerebralmastication.com/?p=993#comment-32327</guid>
		<description>Have you checked out StarCluster, out of MIT? That sounds like it might already do almost all of what you&#039;re looking to do....



http://web.mit.edu/stardev/cluster/</description>
		<content:encoded><![CDATA[<p>Have you checked out StarCluster, out of MIT? That sounds like it might already do almost all of what you&#8217;re looking to do&#8230;.</p>
<p><a href="http://web.mit.edu/stardev/cluster/" rel="nofollow" onclick="pageTracker._trackPageview('/outgoing/web.mit.edu/stardev/cluster/?referer=');">http://web.mit.edu/stardev/cluster/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Siah</title>
		<link>http://www.cerebralmastication.com/2011/05/shell-scripting-ec2-for-fun-and-profit/comment-page-1/#comment-32301</link>
		<dc:creator>Siah</dc:creator>
		<pubDate>Mon, 09 May 2011 07:29:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.cerebralmastication.com/?p=993#comment-32301</guid>
		<description>Nice post.

Can you ping your instance? do they get some sort of sub domain name or IP? if yes you can then ping it with regular ping and continue as soon as it responds.</description>
		<content:encoded><![CDATA[<p>Nice post.</p>
<p>Can you ping your instance? do they get some sort of sub domain name or IP? if yes you can then ping it with regular ping and continue as soon as it responds.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Dennison</title>
		<link>http://www.cerebralmastication.com/2011/05/shell-scripting-ec2-for-fun-and-profit/comment-page-1/#comment-32085</link>
		<dc:creator>John Dennison</dc:creator>
		<pubDate>Sat, 07 May 2011 17:42:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.cerebralmastication.com/?p=993#comment-32085</guid>
		<description>Brilliant i have been struggling of how to capture the newly created instance id so i could pass it to my sftp/ssh. this is exactly that. one tweak to the ssh command. I&#039;m running on fedora and my key as set to the standard system variable. I had to change the order of the RSA command else the ssh would fail. ie it needed to add the key my list of trusted servers. if i used:

ssh -o StrictHostKeyChecking=no ubuntu@$name

it works!!</description>
		<content:encoded><![CDATA[<p>Brilliant i have been struggling of how to capture the newly created instance id so i could pass it to my sftp/ssh. this is exactly that. one tweak to the ssh command. I&#8217;m running on fedora and my key as set to the standard system variable. I had to change the order of the RSA command else the ssh would fail. ie it needed to add the key my list of trusted servers. if i used:</p>
<p>ssh -o StrictHostKeyChecking=no ubuntu@$name</p>
<p>it works!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul</title>
		<link>http://www.cerebralmastication.com/2011/05/shell-scripting-ec2-for-fun-and-profit/comment-page-1/#comment-32019</link>
		<dc:creator>Paul</dc:creator>
		<pubDate>Sat, 07 May 2011 06:27:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.cerebralmastication.com/?p=993#comment-32019</guid>
		<description>http://docs.amazonwebservices.com/AWSEC2/latest/CommandLineReference/ApiReference-cmd-DescribeInstances.html

There is a status attribute you can check, this still means polling the instance with ec2-describe-instances.

As suggested, you could run a script after the instance starts which actually ping you instead.
Many people launch a skeleton instance and use that &quot;after start&quot; functionality to load software, scripts and data. If you combine with a provisioning tool such as puppet/chef, you have the instance ask the puppet/chef master what it needs to install.</description>
		<content:encoded><![CDATA[<p><a href="http://docs.amazonwebservices.com/AWSEC2/latest/CommandLineReference/ApiReference-cmd-DescribeInstances.html" rel="nofollow" onclick="pageTracker._trackPageview('/outgoing/docs.amazonwebservices.com/AWSEC2/latest/CommandLineReference/ApiReference-cmd-DescribeInstances.html?referer=');">http://docs.amazonwebservices.com/AWSEC2/latest/CommandLineReference/ApiReference-cmd-DescribeInstances.html</a></p>
<p>There is a status attribute you can check, this still means polling the instance with ec2-describe-instances.</p>
<p>As suggested, you could run a script after the instance starts which actually ping you instead.<br />
Many people launch a skeleton instance and use that &#8220;after start&#8221; functionality to load software, scripts and data. If you combine with a provisioning tool such as puppet/chef, you have the instance ask the puppet/chef master what it needs to install.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dirk Eddelbuettel</title>
		<link>http://www.cerebralmastication.com/2011/05/shell-scripting-ec2-for-fun-and-profit/comment-page-1/#comment-31979</link>
		<dc:creator>Dirk Eddelbuettel</dc:creator>
		<pubDate>Sat, 07 May 2011 00:50:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.cerebralmastication.com/?p=993#comment-31979</guid>
		<description>If you can modify the AMP as well, then you can something simple such as having /etc/rc.local have a command &#039;date &gt; /var/www/DoneBooting.txt&#039;.  Your shell script could then loop, test for said file via wget or curl, sleep for a second or two and try again.  Or you leet the AMI instance tweet to a s3cr33t account and monitor that.  Just kidding....</description>
		<content:encoded><![CDATA[<p>If you can modify the AMP as well, then you can something simple such as having /etc/rc.local have a command &#8216;date &gt; /var/www/DoneBooting.txt&#8217;.  Your shell script could then loop, test for said file via wget or curl, sleep for a second or two and try again.  Or you leet the AMI instance tweet to a s3cr33t account and monitor that.  Just kidding&#8230;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt Pettis</title>
		<link>http://www.cerebralmastication.com/2011/05/shell-scripting-ec2-for-fun-and-profit/comment-page-1/#comment-31964</link>
		<dc:creator>Matt Pettis</dc:creator>
		<pubDate>Fri, 06 May 2011 22:30:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.cerebralmastication.com/?p=993#comment-31964</guid>
		<description>Very nice!  I will be stealing (and, may have posted this already, browser hung on submit...)</description>
		<content:encoded><![CDATA[<p>Very nice!  I will be stealing (and, may have posted this already, browser hung on submit&#8230;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt Pettis</title>
		<link>http://www.cerebralmastication.com/2011/05/shell-scripting-ec2-for-fun-and-profit/comment-page-1/#comment-31963</link>
		<dc:creator>Matt Pettis</dc:creator>
		<pubDate>Fri, 06 May 2011 22:28:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.cerebralmastication.com/?p=993#comment-31963</guid>
		<description>Very nice!  I will be stealing this...</description>
		<content:encoded><![CDATA[<p>Very nice!  I will be stealing this&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ken</title>
		<link>http://www.cerebralmastication.com/2011/05/shell-scripting-ec2-for-fun-and-profit/comment-page-1/#comment-31956</link>
		<dc:creator>ken</dc:creator>
		<pubDate>Fri, 06 May 2011 21:36:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.cerebralmastication.com/?p=993#comment-31956</guid>
		<description>have the instance open a port (eg a via netcat or a webport) and try connecting in a loop, or just ssh with a command instead of interactive and check the status in a loop.</description>
		<content:encoded><![CDATA[<p>have the instance open a port (eg a via netcat or a webport) and try connecting in a loop, or just ssh with a command instead of interactive and check the status in a loop.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
