<?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>AtrisoAtriso</title>
	<atom:link href="http://www.atriso.be/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.atriso.be</link>
	<description>Solving problems using cloud computing...</description>
	<lastBuildDate>Fri, 08 Feb 2013 13:31:11 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Git, source code, spaces or tabs?</title>
		<link>http://www.atriso.be/2013/02/git-source-code-spaces-or-tabs/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=git-source-code-spaces-or-tabs</link>
		<comments>http://www.atriso.be/2013/02/git-source-code-spaces-or-tabs/#comments</comments>
		<pubDate>Fri, 08 Feb 2013 13:31:11 +0000</pubDate>
		<dc:creator>Ringo</dc:creator>
				<category><![CDATA[Source Control]]></category>

		<guid isPermaLink="false">http://www.atriso.be/?p=147</guid>
		<description><![CDATA[In a previous article, I talked about converting from TFS to Git and documented the normalization of the line endings in the converted Git repository. Another aspect of source code is whether spaces or tabs should be used. Again, I&#8217;m not going to argument in favor of one or the other, but just document how [...]]]></description>
				<content:encoded><![CDATA[<p>In a previous article, I talked about <a title="Migrating from TFS to Git with converted metadata" href="http://www.atriso.be/2013/02/migrating-from-tfs-to-git/">converting from TFS to Git</a> and documented the normalization of the line endings in the converted Git repository. Another aspect of source code is whether spaces or tabs should be used.</p>
<p>Again, I&#8217;m not going to argument in favor of one or the other, but just document how you can get a consistent setup for your team. This setup however is something that can&#8217;t be easily committed in the repository itself like it was done with the line ending configuration. The main reason are the scripts that need to be executed to make sure that any content is processed when checking out or into the repository.</p>
<h2>Converting spaces to tabs</h2>
<p>To get a good setup, use the <a href="http://git-scm.com/book/ch7-2.html#Keyword-Expansion">same git attributes</a> to process any file. In my repository, the C# code was indented with 4 spaces while the XML files where indented with 2 spaces. If you want everything to be tabs, but you want to keep consistent indentation, you set up 2 filters in <code>.git/config</code>, one for each file type:</p>
<pre class="brush: bash; title: ; notranslate">[filter &quot;tabspace4&quot;]
    clean = cat
    smudge = unexpand -t 4 --first-only
[filter &quot;tabspace2&quot;]
    clean = cat
    smudge = unexpand -t 2 --first-only</pre>
<p>Our filters are defined, now we only have to make them active by adding the following to <code>.git/info/attributes</code>:</p>
<pre class="brush: bash; title: ; notranslate">*.cs     filter=tabspace4
*.xml     filter=tabspace2</pre>
<p>Similar to the line endings, git needs to reprocess all your files. This is done by clearing the working copy and getting a new set of working copy files:</p>
<pre class="brush: bash; title: ; notranslate">user@host:MyComponent$ git rm --cached -r .
user@host:MyComponent$ git reset --hard
user@host:MyComponent$ git add .
user@host:MyComponent$ git commit -m &quot;Introducing space to tab conversion&quot;</pre>
<p>This should transform all spaces to tabs in C# and XML files and commit the tabbed files to the git database.</p>
<h2>Platform dependency</h2>
<p>The filter definitions use the Unix <a title="unexpand man page" href="http://linux.about.com/library/cmd/blcmdl1_unexpand.htm">unexpand</a> command. This setup is not portable to Windows, neither will it work on Mac OS X as the standard unexpand is not real GNU unexpand. This means that every developer needs to have a different setup based on the tools available. This is very cumbersome.</p>
<p>Another option is <a title="EditorConfig" href="http://editorconfig.org/">EditorConfig</a>. EditorConfig is a tool that can be plugged into a number of different editors and IDE&#8217;s and takes over your source file formatting regarding indentation and line endings. The source file formatting definition can be committed to the source code repository. Although not all developers will probably use the same editor, with the EditorConfig plugin installed the team will nevertheless have consistent source code formatting.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.atriso.be/2013/02/git-source-code-spaces-or-tabs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Migrating from TFS to Git with converted metadata</title>
		<link>http://www.atriso.be/2013/02/migrating-from-tfs-to-git/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=migrating-from-tfs-to-git</link>
		<comments>http://www.atriso.be/2013/02/migrating-from-tfs-to-git/#comments</comments>
		<pubDate>Tue, 05 Feb 2013 20:21:24 +0000</pubDate>
		<dc:creator>Ringo</dc:creator>
				<category><![CDATA[Source Control]]></category>

		<guid isPermaLink="false">http://www.atriso.be/?p=146</guid>
		<description><![CDATA[If you are tasked with migrating a Team Foundation Server (TFS) code repository to Git and search the net, you will quickly find a number of tools: git-tfs TFS2GIT Git-TF The latter two solutions were tried in converting from the TFS repository to a Git repository. TFS2Git has the drawback that it is a shell [...]]]></description>
				<content:encoded><![CDATA[<p>If you are tasked with migrating a Team Foundation Server (TFS) code repository to Git and search the net, you will quickly find a number of tools:</p>
<ul>
<li><a title="git-tfs" href="https://github.com/git-tfs/git-tfs"><span style="line-height: 13px;">git-tfs</span></a></li>
<li><a title="TFS2GIT" href="https://github.com/WilbertOnGithub/TFS2GIT">TFS2GIT</a></li>
<li><a title="Git-TF" href="http://gittf.codeplex.com/">Git-TF</a></li>
</ul>
<p>The latter two solutions were tried in converting from the TFS repository to a Git repository.</p>
<p><span id="more-146"></span></p>
<p>TFS2Git has the drawback that it is a shell wrapper around the tfs and git command line commands. It just replays the history but all git commits are timestamped with the execution time of the conversion, not the initial timestamp from the TFS repository. This was not favorable.</p>
<p>Git-TF is created by Microsoft to provide access to a TFS repository from non-Microsoft platforms like Linux and Mac OS X. It is a two-way bridge between a local Git checkout and a TFS server, meaning that you can work on the client with your Git toolchain, but pull and push to the central TFS server. As such, it works flawlessly with your TFS server. In a normal developer setup, you only pull the latest changes from TFS, continue working in your local git clone, and push your changes back as TFS changesets. However, performing a deep clone, even from a single branch with a bit of history, takes quite some time. Do you consider 26 hours acceptable for a history of around 2500 commits?</p>
<p>Besides the conversion, a bit of git post-processing was done on the converted repository before it was pushed to the new git server. Let&#8217;s get started!</p>
<h2>Converting from TFS to Git</h2>
<p>To convert MyComponent with full history, without tagging the git revisions with the TFS commit info, run:</p>
<pre class="brush: bash; title: ; notranslate">user@host:~$ git tf clone --deep --no-tag http://tfs.domain.local:8080/tfs/MyCode $/MyComponent/Development/Development MyComponent</pre>
<p>In the above example, only the Development branch was converted. The team already used a minimal <a title="Git Flow" href="http://nvie.com/posts/a-successful-git-branching-model/">gitflow</a> like branch structure and the most granular commit info was on this branch. Given the conversion time mentioned above, converting all branches was not on option.</p>
<p>The intention is to execute a one-time conversion to Git and continue to work in Git. As such, we can remove the remote ref to the TFS server:</p>
<pre class="brush: bash; title: ; notranslate">user@host:~$ cd MyComponent
user@host:MyComponent$ git branch -rd origin_tfs/tfs</pre>
<h2>Cleaning up the commit author information</h2>
<p>After conversion, the author in every git revision refers to the respective Active Directory user account. As git users, we are used to the regular email style information. So let&#8217;s rewrite some git history. Most people seem to know the <a title="Changing author info" href="https://help.github.com/articles/changing-author-info">Github script for changing author info</a>, but the script below can change multiple authors at once in a single rewrite run:</p>
<pre class="brush: bash; title: ; notranslate">
#!/bin/sh

git filter-branch -f --env-filter '

case ${GIT_COMMITTER_NAME} in
		&quot;DOMAIN\joe&quot;) name=&quot;Joe&quot; ; email=&quot;&#x6a;&#x6f;&#101;&#64;&#x64;&#x6f;&#x6d;&#97;i&#x6e;&#x2e;&#x63;&#111;m&quot; ;;
		&quot;DOMAIN\foo&quot;) name=&quot;Foo&quot; ; email=&quot;&#x66;&#x6f;&#x6f;&#64;dom&#x61;&#x69;&#x6e;&#46;com&quot; ;;
		&quot;DOMAIN\baz&quot;) name=&quot;Baz&quot; ; email=&quot;&#x62;&#x61;&#x7a;&#x40;&#100;&#111;mai&#x6e;&#x2e;&#x63;&#x6f;&#x6d;&quot;
esac

export GIT_AUTHOR_NAME=&quot;$name&quot;
export GIT_AUTHOR_EMAIL=&quot;$email&quot;
export GIT_COMMITTER_NAME=&quot;$name&quot;
export GIT_COMMITTER_EMAIL=&quot;$email&quot;
'
</pre>
<p>After running this conversion script in your git repo, it is a good idea to perform some cleanup:</p>
<pre class="brush: bash; title: ; notranslate">user@host:MyComponent$ git gc --prune=now</pre>
<p>Your git repository should shrink considerably.</p>
<h2>Line endings&#8230;</h2>
<p>The never ending debate of line endings. I&#8217;m not going to enter this debate of which is better. A good article on how Git handles line endings is <a title="Mind the End of Your Line" href="http://timclem.wordpress.com/2012/03/01/mind-the-end-of-your-line/">the one written by Tim Clem</a>. The only thing to mention is what I wanted and how I set it up: only Line-Feed (LF) wanted in the database, and platform dependent line endings in the working copy. This means also LF on Unices but CRLF on Windows.</p>
<p>Add the following to a .gitattributes file in the root of your repository:</p>
<pre class="brush: bash; title: ; notranslate"># These files are text and should be normalized (convert crlf =&gt; lf)
*.cmd        text
*.config     text
*.Config     text
*.cs         text diff=csharp
*.csproj     text
*.datasource text
*.disco      text
*.edmx       text
*.map        text
*.md         text
*.msbuild    text
*.ps1        text
*.settings   text
*.sln        text
*.svcinfo    text
*.svcmap     text
*.t4properties text
*.tt         text
*.txt        text
*.vspscc     text
*.wsdl       text
*.xaml       text
*.xsd        text

# Images should be treated as binary
# (binary is a macro for -text -diff)
*.ico        binary
*.jepg       binary
*.jpg        binary
*.sdf        binary
*.pdf        binary
*.png        binary</pre>
<p>Add additional suffixes that you need mapped to either text or binary type. Now commit this file in your repository:</p>
<pre class="brush: bash; title: ; notranslate">user@host:MyComponent$ git add .gitattributes
user@host:MyComponent$ git commit -m &quot;Central repository configuration&quot;</pre>
<p>As you can see from the code samples, everything is executed on a Unix machine. As the content in the TFS repository contains Windows line endings, we need a single full conversion to make sure that everything is not correctly normalized:</p>
<pre class="brush: bash; title: ; notranslate">user@host:MyComponent$ git rm --cached -r .
user@host:MyComponent$ git reset --hard
user@host:MyComponent$ git add .
user@host:MyComponent$ git commit -m &quot;Introducing normalised line-endings&quot;</pre>
<p>The working copy was removed, we checked out a new working copy with our new settings active. This results in a all text files having LF only now. We add all these changed files to the staging area and commit them. The database now correctly contains LF only for text files.</p>
<h2>Results</h2>
<p>Our workstation now contains a Git repository with a single master branch, with correct author information and normalized line endings working on all platforms. The only thing left to do is to push this to the new Git server and let the team work on it:</p>
<pre class="brush: bash; title: ; notranslate">user@host:MyComponent$ git remote add origin http:/&#x2f;&#x6d;e&#64;&#x67;i&#116;&#x73;e&#114;&#x76;er&#x2e;&#x64;o&#x6d;&#x61;i&#110;&#x2e;c&#111;&#x6d;/MyComponent.git
user@host:MyComponent$ git push origin master</pre>
<p>That&#8217;s all folks!</p>
<p>If you have comments or questions, please leave them below!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.atriso.be/2013/02/migrating-from-tfs-to-git/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VirtualBox and raw host disk access</title>
		<link>http://www.atriso.be/2012/08/virtualbox-raw-disk/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=virtualbox-raw-disk</link>
		<comments>http://www.atriso.be/2012/08/virtualbox-raw-disk/#comments</comments>
		<pubDate>Tue, 21 Aug 2012 08:44:41 +0000</pubDate>
		<dc:creator>Ringo</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.atriso.be/?p=133</guid>
		<description><![CDATA[The VirtualBox forums lists numerous reports of people not being able to get VirtualBox to work with raw disk partitions. Initially I bumped into the same problems, but got it working in the end. The setup used in this article is an Ubuntu 12.04 host system with VirtualBox 4.1.18 installed. From disk /dev/sda the partitions [...]]]></description>
				<content:encoded><![CDATA[<p>The <a title="VirtualBox Forums" href="http://forums.virtualbox.org" target="_blank">VirtualBox forums</a> lists <a href="https://forums.virtualbox.org/viewtopic.php?f=8&amp;t=50946&amp;p=233322" target="_blank">numerous</a> <a href="https://forums.virtualbox.org/viewtopic.php?f=7&amp;t=50280&amp;p=229697" target="_blank">reports</a> of people not being able to get VirtualBox to work with raw disk partitions. Initially I bumped into the same problems, but got it working in the end.</p>
<p>The setup used in this article is an Ubuntu 12.04 host system with VirtualBox 4.1.18 installed. From disk <code>/dev/sda</code> the partitions 3 and 4 will be made available to a virtual machine. All virtual machines are run as user <code>virtualbox</code>. All console samples show clearly the user that runs the command.<br />
<span id="more-133"></span><br />
On Ubuntu, raw devices have the following default access rights:</p>
<pre class="brush: bash; title: ; notranslate">root@host:~# ls -l /dev/sda*
brw-rw---- 1 root disk 8,  0 Aug 20 15:11 /dev/sda
brw-rw---- 1 root disk 8,  1 Aug 10 17:37 /dev/sda1
brw-rw---- 1 root disk 8,  2 Aug 10 17:37 /dev/sda2
brw-rw---- 1 root disk 8,  3 Aug 21 09:43 /dev/sda3
brw-rw---- 1 root disk 8,  4 Aug 21 09:43 /dev/sda4</pre>
<p>To give the <code>virtualbox</code> user proper access to the disks, the <code>disk</code> group will be extended:</p>
<pre class="brush: bash; title: ; notranslate">root@host:~# usermod --groups disk -a virtualbox</pre>
<p><strong>Before going any further, please make sure that any processes currently running as user virtualbox are restarted!</strong> This is needed for these processes to pick up the changed permissions. Next to the VirtualBox subsystems, don&#8217;t forget to restart the active shell sessions. By adding the <code>virtualbox</code> user to the group <code>disk</code>, the change is also persisted over system reboots.</p>
<p>With the proper access in place, we first create the VMDK file pointing to the raw device:</p>
<pre class="brush: bash; title: ; notranslate">virtualbox@host:~$ VBoxManage internalcommands createrawvmdk -filename /home/virtualbox/virtualmachines/machine1/machine1-sda.vmdk -rawdisk /dev/sda -partitions 3,4 -relative
RAW host disk access VMDK file /home/virtualbox/virtualmachines/machine1/machine1-sda.vmdk created successfully.</pre>
<p>Assuming that the VM <code>machine1</code> is already created and contains a storage controller, the raw disk is now attached to the virtual machine:</p>
<pre class="brush: bash; title: ; notranslate">virtualbox@host:~$ VBoxManage storageattach machine1 --storagectl &quot;SATA Controller&quot; --port 0 --type hdd --medium /home/virtualbox/virtualmachines/machine1/machine1-sda.vmdk</pre>
<p>On successful completion, this command returns no output. If you want to validate that the disk is attached correctly, print the virtual machine information:</p>
<pre class="brush: bash; title: ; notranslate">virtualbox@host:~$ VBoxManage showvminfo machine1
...
SATA Controller (0, 0): /home/virtualbox/virtualmachines/machine1/machine1-sda.vmdk (UUID: afc0a...)
...</pre>
<p>That&#8217;s it!</p>
<p>Please report typos and/or improvements to this article in the comments!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.atriso.be/2012/08/virtualbox-raw-disk/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Backporting Debian/Ubuntu packages the easy way.</title>
		<link>http://www.atriso.be/2012/06/backporting-packages-easily/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=backporting-packages-easily</link>
		<comments>http://www.atriso.be/2012/06/backporting-packages-easily/#comments</comments>
		<pubDate>Mon, 04 Jun 2012 10:56:39 +0000</pubDate>
		<dc:creator>Ringo</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.atriso.be/?p=129</guid>
		<description><![CDATA[There is a lot of documentation on the use of Debian/Ubuntu packaging tools, but most of these pages just list the options of each of these tools. After fighting with these for some period, I jumped over to the #ubuntu-packaging IRC channel for help. After explaining my intent of backporting some packages unchanged, I was [...]]]></description>
				<content:encoded><![CDATA[<p>There is a lot of documentation on the use of Debian/Ubuntu packaging tools, but most of these pages just list the options of each of these tools. After fighting with these for some period, I jumped over to the #ubuntu-packaging IRC channel for help. After explaining my intent of backporting some packages unchanged, I was pointed to the <a title="backportpacakge man page" href="http://manpages.ubuntu.com/manpages/precise/man1/backportpackage.1.html">backportpackage</a> tool:</p>
<p><cite><strong>backportpackage</strong> fetches a package from one distribution release or from a specified .dsc path or URL and creates a no-change backport of that package to one or more Ubuntu releases release, optionally doing a test build of the package and/or uploading the resulting backport for testing.</cite></p>
<p>This tool comes with the <a title="ubuntu-dev-tools package availability" href="http://packages.ubuntu.com/search?keywords=ubuntu-dev-tools&amp;searchon=names&amp;suite=precise&amp;section=all">ubuntu-dev-tools</a> package.</p>
<p><span id="more-129"></span>I needed to backport the ocaml source package from precise (12.04) to all earlier releases up to lucid (10.04). For the backport to oneiric, here is the command:</p>
<pre class="brush: bash; title: ; notranslate">$ backportpackage -s precise -d oneiric -u amplidata-2.5 -r ocaml</pre>
<p><code>amplidata-2.5</code> is the identifier to the PPA as defined in my <a title="Uploading packages" href="https://help.launchpad.net/Packaging/PPA/Uploading">dput.cnf</a> file. I also configured the file <code><a title="devscripts man page" href="http://manpages.ubuntu.com/manpages/precise/man1/devscripts.1.html">~/.devscripts</a></code> with the keys <code>DEBEMAIL</code>, <code>DEBFULLNAME</code> and <code>DEBSIGN_KEYID</code>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.atriso.be/2012/06/backporting-packages-easily/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SSH, multiple identities, but no passwords!</title>
		<link>http://www.atriso.be/2009/05/ssh-multiple-identities-but-no-passwords/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ssh-multiple-identities-but-no-passwords</link>
		<comments>http://www.atriso.be/2009/05/ssh-multiple-identities-but-no-passwords/#comments</comments>
		<pubDate>Tue, 05 May 2009 21:10:38 +0000</pubDate>
		<dc:creator>Ringo</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[SSH]]></category>

		<guid isPermaLink="false">http://www.atriso.be/?p=93</guid>
		<description><![CDATA[Secure Shell is a great tool for securely connecting between several machines. In the past weeks, I am using it more and more, but I was getting tired of typing too much. I found a great article on setting up passwordless authentication using public/private keys and defining multiple SSH identities, but it still wasn&#8217;t enough. [...]]]></description>
				<content:encoded><![CDATA[<p>Secure Shell is a great tool for securely connecting between several machines. In the past weeks, I am using it more and more, but I was getting tired of typing too much. I found a <a title="SSH User Identities" href="http://www.symantec.com/connect/articles/ssh-user-identities">great article</a> on setting up passwordless authentication using public/private keys and defining multiple SSH identities, but it still wasn&#8217;t enough.</p>
<p><span id="more-93"></span>I manage multiple Unix users on <a href="http://www.dreamhost.com/">Dreamhost</a>, a plethora of Linux virtual machines at work, running <a title="Jenkins CI" href="http://jenkins-ci.org/">Jenkins</a> builders and two additional machines at home. With ssh-keygen, you can generate multiple different public/private keypairs (aka an identity). The section &#8220;Selecting Keys&#8221; of the above mentioned article describes how you can select a specific identity for connecting to a specific host. The example below shows how to connect to one of my DreamHost user accounts in a passwordless manner:</p>
<pre class="brush: bash; title: ; notranslate">$ ssh -i ~/.ssh/dh-user1 us&#x65;&#x72;&#x31;&#64;b&#111;&#x62;&#x61;.d&#114;&#x65;&#x61;mh&#111;&#x73;&#x74;&#x2e;co&#x6d;</pre>
<p>If you have a long list of accounts, it would definitely be easy to use shortcuts for every combination of user@host and link that up to a specific SSH identity. Well, this is possible with the use of an SSH config file. I found out about this file <a href="http://ubuntuforums.org/showthread.php?t=172848">here</a> and then read more about it in the <a href="http://www.openbsd.org/cgi-bin/man.cgi?query=ssh_config">man page</a>.</p>
<p>When you have user1 and user2 as accounts on your remote machine, in my case boba.dreamhost.com, and having different SSH identities for each user (dh-user1[.pub] and dh-user2[.pub]), how do you link everything together to be able to just type one of the following:</p>
<pre class="brush: bash; title: ; notranslate">$ ssh dh-user1
$ ssh dh-user2</pre>
<p>Actually, this is quite easy. Here is the ~/.ssh/config file in my local account (the account I&#8217;m making SSH connections <strong>from</strong>):</p>
<pre class="brush: plain; title: ; notranslate">Host dh-user1
User user1
HostName boba.dreamhost.com
IdentityFile ~/.ssh/dh-user1

Host dh-user2
User user2
HostName boba.dreamhost.com
IdentityFile ~/.ssh/dh-user2
</pre>
<p>Every section in this file starts with <strong>Host <em>ConnectionName</em></strong> followed by a number of connection parameters that are fully described in the man page. In my case, I specify the real host name, the username on the remote machine, and the identity file I want to link to that account.</p>
<p>Done!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.atriso.be/2009/05/ssh-multiple-identities-but-no-passwords/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Snapshots of EBS Volumes</title>
		<link>http://www.atriso.be/2008/09/snapshots-of-ebs-volumes/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=snapshots-of-ebs-volumes</link>
		<comments>http://www.atriso.be/2008/09/snapshots-of-ebs-volumes/#comments</comments>
		<pubDate>Fri, 26 Sep 2008 12:56:48 +0000</pubDate>
		<dc:creator>Ringo</dc:creator>
				<category><![CDATA[Cloud]]></category>
		<category><![CDATA[AWS]]></category>
		<category><![CDATA[EBS]]></category>
		<category><![CDATA[EC2]]></category>

		<guid isPermaLink="false">http://blog.atriso.be/?p=58</guid>
		<description><![CDATA[Continuing with the volume created in the post Sharing EBS Volumes Among Instances, in this post I show how to create a snapshot, create a new volume from that snapshot, and mount the new volume in an instance. Remember that the volume created in the previous post contained 1 file called &#8220;readme&#8221;. Creating the Snapshot [...]]]></description>
				<content:encoded><![CDATA[<p>Continuing with the volume created in the post <a title="Sharing EBS Volumes Among Instances" href="http://www.atriso.be/2008/09/sharing-ebs-volumes-among-instances/" target="_blank">Sharing EBS Volumes Among Instances</a>, in this post I show how to create a snapshot, create a new volume from that snapshot, and mount the new volume in an instance. Remember that the volume created in the previous post contained 1 file called &#8220;readme&#8221;.<br />
<span id="more-58"></span></p>
<h3>Creating the Snapshot</h3>
<p>First we look at the available volumes:</p>
<pre class="brush: bash; title: ; notranslate">$ ec2-describe-volumes
VOLUME	vol-4001e429	1		us-east-1c	available	2008-09-25T09:51:48+0000</pre>
<p>Then we make the snapshot:</p>
<pre class="brush: bash; title: ; notranslate">$ ec2-create-snapshot vol-4001e429
SNAPSHOT	snap-cb7493a2	vol-4001e429	pending	2008-09-26T11:48:30+0000</pre>
<p>It is &#8220;pending&#8221;. We check the status until it the snapshot creation has &#8220;completed&#8221;:</p>
<pre class="brush: bash; title: ; notranslate">$ ec2-describe-snapshots snap-cb7493a2
SNAPSHOT	snap-cb7493a2	vol-4001e429	completed	2008-09-26T11:48:30+0000	100%</pre>
<h3>Creating a Volume from the Snapshot</h3>
<p>Now that the snapshot is ready, we can create a new volume from it. Note that we create it in a different availability zone. The orginal volume resides in &#8220;us-east-1c&#8221;. The new volume will reside in &#8220;us-east-1a&#8221;.</p>
<pre class="brush: bash; title: ; notranslate">$ ec2-create-volume --snapshot snap-cb7493a2 -z us-east-1a
VOLUME	vol-9f00e5f6	1	snap-cb7493a2	us-east-1a	creating	2008-09-26T11:52:37+0000</pre>
<p>We wait until the volume is &#8220;available&#8221;:</p>
<pre class="brush: bash; title: ; notranslate">$ ec2-describe-volumes
VOLUME	vol-9f00e5f6	1	snap-cb7493a2	us-east-1a	available	2008-09-26T11:52:37+0000
VOLUME	vol-4001e429	1		us-east-1c	available	2008-09-25T09:51:48+0000</pre>
<p>Now we have two available volumes.</p>
<h3>Mounting the New Volume in an Instance</h3>
<p>Let&#8217;s launch an image so that we can verify that the newly created volume can be mounted and has the same contents as the original volume. Note that the instance is launched in the availability zone where the newly created volume resides.</p>
<pre class="brush: bash; title: ; notranslate">$ ec2-run-instances ami-0757b26e -k gettingstarted-keypair -z us-east-1a</pre>
<p>The AMI we use here is a public Ubuntu Desktop image.</p>
<pre class="brush: bash; title: ; notranslate">$ ec2-describe-instances
RESERVATION	r-ff4d9e96	190912652296	default
INSTANCE	i-0fcf6c66	ami-0757b26e	ec2-67-202-35-79.compute-1.amazonaws.com	domU-12-31-38-00-6C-F6.compute-1.internal	running	gettingstarted-keypair	0		m1.small	2008-09-26T11:55:16+0000	us-east-1a	aki-a71cf9ce	ari-a51cf9cc</pre>
<p>The instance is ready to be used. In another terminal we connect to the image and start the &#8220;user-setup&#8221; script. The GUI interaction to set up the user is not shown here.</p>
<pre class="brush: bash; title: ; notranslate">$ ssh -i id_rsa-gettingstarted-keypair &#x72;&#x6f;&#x6f;&#x74;&#x40;&#x65;&#x63;&#x32;&#45;&#54;&#55;&#45;202-35-&#x37;&#x39;&#x2e;&#x63;&#x6f;&#x6d;&#x70;&#x75;&#x74;&#101;&#45;&#49;&#46;amazona&#x77;&#x73;&#x2e;&#x63;&#x6f;&#x6d;
The authenticity of host 'ec2-67-202-35-79.compute-1.amazonaws.com (67.202.35.79)' can't be established.
RSA key fingerprint is ab:df:4e:78:b7:4d:59:3e:ae:6c:81:32:80:eb:bd:78.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'ec2-67-202-35-79.compute-1.amazonaws.com,67.202.35.79' (RSA) to the list of known hosts.
Linux domU-12-31-38-00-6C-F6 2.6.21.7-2.fc8xen #1 SMP Fri Feb 15 12:39:36 EST 2008 i686

The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.

Amazon EC2 Ubuntu 7.10 gutsy base install AMI built by
Eric Hammond
For more information: http://ec2gutsy-desktop.notlong.com

root@domU-12-31-38-00-6C-F6:~# user-setup
Shadow passwords are now on.
Using `/usr/share/libgksu/debian/gconf-defaults.libgksu-sudo' to provide `libgksu-gconf-defaults'.</pre>
<p>Time to attach the volume (in the orginal terminal):</p>
<pre class="brush: bash; title: ; notranslate">$ ec2-attach-volume vol-9f00e5f6 -i i-0fcf6c66 -d /dev/sdh
ATTACHMENT	vol-9f00e5f6	i-0fcf6c66	/dev/sdh	attaching	2008-09-26T12:01:15+0000
$ ec2-describe-volumes
VOLUME	vol-9f00e5f6	1	snap-cb7493a2	us-east-1a	in-use	2008-09-26T11:52:37+0000
ATTACHMENT	vol-9f00e5f6	i-0fcf6c66	/dev/sdh	attached	2008-09-26T12:01:15+0000
VOLUME	vol-4001e429	1		us-east-1c	available	2008-09-25T09:51:48+0000</pre>
<p>Let&#8217;s see whether it is available. Connect to the desktop as described in <a title="Preparing for Amazon AWS Usage" href="http://www.atriso.be/2008/09/preparing-for-amazon-aws-usage/" target="_blank">Preparing for Amazon AWS Usage</a>.</p>
<p><a href="http://www.atriso.be/wp-content/uploads/2008/09/device-available-in-ubuntu.png"><img class="aligncenter size-full wp-image-63" title="Device available in Ubuntu" src="http://www.atriso.be/wp-content/uploads/2008/09/device-available-in-ubuntu.png" alt="" width="500" height="385" /></a></p>
<p>In the terminal connected to the instance, we can mount the volume now:</p>
<pre class="brush: bash; title: ; notranslate">root@domU-12-31-38-00-6C-F6:~# mkdir /mnt/my-volume
root@domU-12-31-38-00-6C-F6:~# mount /dev/sdh /mnt/my-volume</pre>
<p>Now the volume should be mounted as &#8220;my-volume&#8221; and accessible. Let&#8217;s verify that by opening a file browser on that volume.</p>
<p><a href="http://www.atriso.be/wp-content/uploads/2008/09/volume-mounted-in-ubuntu.png"><img class="aligncenter size-full wp-image-64" title="Volume mounted in Ubuntu" src="http://www.atriso.be/wp-content/uploads/2008/09/volume-mounted-in-ubuntu.png" alt="" width="500" height="385" /></a></p>
<p>Indeed, the &#8220;readme&#8221; file that was on the original volume is also on the new volume created from the snapshot.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.atriso.be/2008/09/snapshots-of-ebs-volumes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sharing EBS Volumes Among Instances</title>
		<link>http://www.atriso.be/2008/09/sharing-ebs-volumes-among-instances/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=sharing-ebs-volumes-among-instances</link>
		<comments>http://www.atriso.be/2008/09/sharing-ebs-volumes-among-instances/#comments</comments>
		<pubDate>Thu, 25 Sep 2008 11:45:34 +0000</pubDate>
		<dc:creator>Ringo</dc:creator>
				<category><![CDATA[Cloud]]></category>
		<category><![CDATA[AWS]]></category>
		<category><![CDATA[EBS]]></category>
		<category><![CDATA[EC2]]></category>

		<guid isPermaLink="false">http://blog.atriso.be/?p=39</guid>
		<description><![CDATA[In this post I share an experiment to create an EBS volume, to attach it to an EC2 instance, to mount it in the instance, to put a file on it, to unmount it, and to detach it. Afterwards the volume will be mounted in another instance (while the first instance has been terminated, because [...]]]></description>
				<content:encoded><![CDATA[<p>In this post I share an experiment to create an EBS volume, to attach it to an EC2 instance, to mount it in the instance, to put a file on it, to unmount it, and to detach it. Afterwards the volume will be mounted in another instance (while the first instance has been terminated, because attaching volumes to different instances at the same time is impossibe).</p>
<p><span id="more-39"></span>I followed the instructions given in the <a href="http://developer.amazonwebservices.com/connect/entry!default.jspa?categoryID=112&amp;externalID=1667" target="_blank">Elastic Block Storage Feature Guide</a>.</p>
<h3>Starting an Instance</h3>
<p>Let&#8217;s see which AMIs are available:</p>
<pre class="brush: bash; title: ; notranslate">$ ec2-describe-images -o self
IMAGE	ami-c6c622af	dehonk-gettingstarted/image.manifest.xml	190912652296	available	private		i386	machine</pre>
<p>I launch ami-c6c622af with Elasticfox. Let&#8217;s check the status of the instance with the command line tools:</p>
<pre class="brush: bash; title: ; notranslate">$ ec2-describe-instances
RESERVATION	r-9f3deef6	190912652296	default
INSTANCE	i-520faf3b	ami-c6c622af			pending	gettingstarted-keypair	0		m1.small	2008-09-25T09:50:01+0000	us-east-1c</pre>
<p>Important to note for later is the availability zone in which the instance is running, because volumes can ony be attached to instances when they live in the same availability zone.</p>
<h3>Create the Volume</h3>
<p>Create a volume of 1 GB in the same availability zone in which the instance resides:</p>
<pre class="brush: bash; title: ; notranslate">$ ec2-create-volume --size 1 -z us-east-1c
VOLUME	vol-4001e429	1		us-east-1c	creating	2008-09-25T09:51:48+0000</pre>
<p>Check the status of the volume:</p>
<pre class="brush: bash; title: ; notranslate">$ ec2-describe-volumes vol-4001e429
VOLUME	vol-4001e429	1		us-east-1c	available	2008-09-25T09:51:48+0000</pre>
<p>The volume is available now. Time to use it!</p>
<h3>Attaching the Volume</h3>
<p>Attach the newly created volume as device /dev/sdh to the running instance:</p>
<pre class="brush: bash; title: ; notranslate">$ ec2-attach-volume vol-4001e429 -i i-520faf3b -d /dev/sdh
ATTACHMENT	vol-4001e429	i-520faf3b	/dev/sdh	attaching	2008-09-25T09:59:14+0000</pre>
<p>The command returns saying that the volume is attaching. Let&#8217;s check the status:</p>
<pre class="brush: bash; title: ; notranslate">$ ec2-describe-volumes VOLUME	vol-4001e429	1		us-east-1c	in-use	2008-09-25T09:51:48+0000 ATTACHMENT	vol-4001e429	i-520faf3b	/dev/sdh	attached	2008-09-25T09:59:14+0000</pre>
<p>While the volume was &#8220;available&#8221; and &#8220;attaching&#8221; before, now it is &#8220;in-use&#8221; and &#8220;attached&#8221;.</p>
<h3>Formatting the Volume</h3>
<p>Open another termnal. Connect to the instance via ssh:</p>
<pre class="brush: bash; title: ; notranslate">$ ssh -i id_rsa-gettingstarted-keypair &#x72;o&#x6f;&#116;&#64;&#x65;c&#x32;&#45;7&#x35;-&#x31;&#48;1&#x2d;2&#x35;&#x34;-&#x32;&#50;7&#x2e;c&#x6f;&#109;p&#x75;t&#x65;&#45;1&#x2e;a&#x6d;&#x61;z&#x6f;&#110;a&#x77;s&#x2e;&#99;o&#x6d;</pre>
<p>Looking at the contents of /dev reveals that the volume is available as device &#8220;sdh&#8221;:</p>
<pre class="brush: bash; title: ; notranslate"># ls /dev
MAKEDEV   port   ptyc1  ptye6  ptyqb  ptyt0  ptyv5  ptyxa  ptyzf    ttya2  ttyc7  ttyec  ttyr1  ttyt6  ttyvb  ttyy0
--- cut here for brevity ---
loop7     ptyb3  ptyd8  ptypd  ptys2  ptyu7  ptywc  ptyz1  &lt;strong&gt;sdh&lt;/strong&gt;      ttyb9  ttyde  ttyq3  ttys8  ttyud  ttyx2  ttyz7
--- cut here for brevity ---</pre>
<p>Since a new volume is not formatted, we do that first:</p>
<pre class="brush: bash; title: ; notranslate"># yes | mkfs -t ext3 /dev/sdh
mke2fs 1.38 (30-Jun-2005)
/dev/sdh is entire device, not just one partition!
Proceed anyway? (y,n) Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
131072 inodes, 262144 blocks
13107 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=268435456
8 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
	32768, 98304, 163840, 229376

Writing inode tables: done
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 20 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.</pre>
<h3>Mounting the Volume</h3>
<p>Finally, the volume is ready to be mounted in the instance:</p>
<pre class="brush: bash; title: ; notranslate"># mkdir /mnt/data-store
# mount /dev/sdh /mnt/data-store</pre>
<p>Let&#8217;s check whether everything is as expected:</p>
<pre class="brush: bash; title: ; notranslate"># ls /mnt
data-store  lost+found
# ls /mnt/data-store/
lost+found</pre>
<p>That looks okay.</p>
<h3>Put a file on the volume</h3>
<p>Using vi, I created a file named &#8220;readme&#8221; with this contents:</p>
<pre class="brush: bash; title: ; notranslate">This is an example file to show that a file persists on an EBS volume after unmounting and detaching.</pre>
<h3>Unmounting the Volume</h3>
<p>Before we stop the instance, we have to unmount the volume. From the <a href="http://developer.amazonwebservices.com/connect/entry!default.jspa?categoryID=112&amp;externalID=1667" target="_blank">Elastic Block Storage Feature Guide</a>: <em>A volume must be unmounted inside the instance before being detached. Failure to do so will result in damage to the file system or the data it contains.</em></p>
<pre class="brush: bash; title: ; notranslate"># umount /mnt/data-store</pre>
<p>Remember to cd out of the volume, otherwise you will get an error message &#8220;umount: /mnt/data-store: device is busy&#8221;</p>
<h3>Detach the Volume</h3>
<p>From the Feature Guide: <em>An Amazon EBS volume can be detached from an instance by either explicitly detaching the volume or terminating the instance.</em> Let&#8217;s do it by explicitly detaching it:</p>
<pre class="brush: bash; title: ; notranslate">$ ec2-detach-volume vol-4001e429 -i i-520faf3b -d /dev/sdh
ATTACHMENT	vol-4001e429	i-520faf3b	/dev/sdh	detaching	2008-09-25T09:59:14+0000</pre>
<p>Soon the status of the volume changes form &#8220;detaching&#8221; to &#8220;available&#8221;:</p>
<pre class="brush: bash; title: ; notranslate">$ ec2-describe-volumes
VOLUME	vol-4001e429	1		us-east-1c	available	2008-09-25T09:51:48+0000</pre>
<h3>Mounting the Volume in Another Instance</h3>
<p>Now do all the steps over again to start a new image and mount the volume. Because the volume resides in availability zone &#8220;us-east-1c&#8221; and instances and volumes have to live in the same availability zone, we have to launch the instance in &#8220;us-east-1c&#8221;.</p>
<pre class="brush: bash; title: ; notranslate">$ ec2-run-instances ami-c6c622af -k gettingstarted-keypair -z us-east-1c RESERVATION	r-eb22f182	190912652296	default INSTANCE	i-5a12b233	ami-c6c622af			pending	gettingstarted-keypair	0		m1.small	2008-09-25T11:23:01+0000	us-east-1c $ ec2-describe-instances RESERVATION	r-eb22f182	190912652296	default INSTANCE	i-5a12b233	ami-c6c622af	ec2-72-44-53-70.compute-1.amazonaws.com	domU-12-31-39-01-5C-76.compute-1.internal	running	gettingstarted-keypair	0		m1.small	2008-09-25T11:23:01+0000	us-east-1c $ ec2-describe-volumes VOLUME	vol-4001e429	1		us-east-1c	available	2008-09-25T09:51:48+0000 $ ec2-attach-volume vol-4001e429 -i i-5a12b233 -d /dev/sdh ATTACHMENT	vol-4001e429	i-5a12b233	/dev/sdh	attaching	2008-09-25T11:25:46+0000 $ ec2-describe-volumes VOLUME	vol-4001e429	1		us-east-1c	in-use	2008-09-25T09:51:48+0000 ATTACHMENT	vol-4001e429	i-5a12b233	/dev/sdh	attached	2008-09-25T11:25:46+0000</pre>
<p>Now start anoher terminal to connect to the instance:</p>
<pre class="brush: bash; title: ; notranslate">$ ssh -i id_rsa-gettingstarted-keypair &#x72;o&#x6f;t&#x40;&#101;c&#x32;-&#x37;2&#x2d;&#52;4&#x2d;5&#x33;&#45;7&#x30;.&#x63;o&#x6d;&#112;u&#x74;e&#x2d;&#49;&#x2e;&#x61;m&#x61;z&#x6f;&#110;a&#x77;s&#x2e;c&#x6f;&#109;
Last login: Tue Sep  9 14:48:20 2008 from 213.49.236.209

	 __|  __|_  )  Rev: 2
	 _|  (     /
	___|\___|___|

 Welcome to an EC2 Public Image
                       <img src='http://www.atriso.be/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> 

    Getting Started

    __ c __ /etc/ec2/release-notes.txt

[root@domU-12-31-39-01-5C-76 ~]# mkdir /mnt/data-store
[root@domU-12-31-39-01-5C-76 ~]# mount /dev/sdh /mnt/data-store
[root@domU-12-31-39-01-5C-76 ~]# cd /mnt/data-store
[root@domU-12-31-39-01-5C-76 data-store]# ls
lost+found  readme
[root@domU-12-31-39-01-5C-76 data-store]# cat readme
This is an example file to show that a file persists on an EBS volume after unmounting and detaching.
[root@domU-12-31-39-01-5C-76 ~]# umount /mnt/data-store
[root@domU-12-31-39-01-5C-76 ~]# exit</pre>
<p>The file we created earlier was on the volume and we could read it. This proves that we can share volumes among instances.</p>
<p>To clean up:</p>
<pre class="brush: bash; title: ; notranslate">$ ec2-detach-volume vol-4001e429 -i i-5a12b233
ATTACHMENT	vol-4001e429	i-5a12b233	/dev/sdh	detaching	2008-09-25T11:25:46+0000
$ ec2-describe-volumes
VOLUME	vol-4001e429	1		us-east-1c	available	2008-09-25T09:51:48+0000
$ ec2-terminate-instances i-5a12b233
INSTANCE	i-5a12b233	running	shutting-down
$ ec2-describe-instances
RESERVATION	r-eb22f182	190912652296	default
INSTANCE	i-5a12b233	ami-c6c622af	ec2-72-44-53-70.compute-1.amazonaws.com	domU-12-31-39-01-5C-76.compute-1.internal	shutting-down	gettingstarted-keypair	0		m1.small	2008-09-25T11:23:01+0000	us-east-1c
$ ec2-describe-instances
RESERVATION	r-eb22f182	190912652296	default
INSTANCE	i-5a12b233	ami-c6c622af			terminated	gettingstarted-keypair	0		m1.small	2008-09-25T11:23:01+0000</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.atriso.be/2008/09/sharing-ebs-volumes-among-instances/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Setting EC2 Environment Variables in ~/.bash_login</title>
		<link>http://www.atriso.be/2008/09/setting-ec2-environment-variables-in-bash_login/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=setting-ec2-environment-variables-in-bash_login</link>
		<comments>http://www.atriso.be/2008/09/setting-ec2-environment-variables-in-bash_login/#comments</comments>
		<pubDate>Thu, 25 Sep 2008 09:45:03 +0000</pubDate>
		<dc:creator>Ringo</dc:creator>
				<category><![CDATA[Cloud]]></category>
		<category><![CDATA[AWS]]></category>
		<category><![CDATA[EC2]]></category>

		<guid isPermaLink="false">http://blog.atriso.be/?p=35</guid>
		<description><![CDATA[Section &#8220;Setting up the Tools&#8221; of the Amazon EC2 Getting Started Guide explains how to set up environment variables, so that the EC2 tools find themselves (EC2_HOME), Java ($JAVA_HOME), the private access key file (EC2_PRVATE_KEY) and the certificate file (EC2_CERT). And they also suggest to change the PATH variable, so that you can run EC2 commands from [...]]]></description>
				<content:encoded><![CDATA[<p>Section <a href="http://docs.amazonwebservices.com/AWSEC2/2007-03-01/GettingStartedGuide/setting-up-your-tools.html" target="_blank">&#8220;Setting up the Tools&#8221;</a> of the <a href="http://docs.amazonwebservices.com/AWSEC2/2007-03-01/GettingStartedGuide/" target="_blank">Amazon EC2 Getting Started Guide </a>explains how to set up environment variables, so that the EC2 tools find themselves (EC2_HOME), Java ($JAVA_HOME), the private access key file (EC2_PRVATE_KEY) and the certificate file (EC2_CERT). And they also suggest to change the PATH variable, so that you can run EC2 commands from anywhere.</p>
<p><span id="more-35"></span>Of course, you do not want to set the environment variables every time you want to use the EC2 tools. I added the lines below to ~/.bash_login on my Mac, so that the environment variables are set everytime I open a terminal. I installed the tools in ~/AWS/ec2-api-tools-1.3-24159 and the private access key file and the certificate file reside in ~/.ec2.</p>
<pre class="brush: bash; title: ; notranslate">export EC2_PRIVATE_KEY=~/.ec2/pk-&lt;some id here&gt;.pem
export EC2_CERT=~/.ec2/cert-&lt;some id here&gt;.pem
export EC2_HOME=~/AWS/ec2-api-tools-1.3-24159
export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Home
export PATH=$PATH:$EC2_HOME/bin</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.atriso.be/2008/09/setting-ec2-environment-variables-in-bash_login/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Preparing for Amazon AWS Usage</title>
		<link>http://www.atriso.be/2008/09/preparing-for-amazon-aws-usage/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=preparing-for-amazon-aws-usage</link>
		<comments>http://www.atriso.be/2008/09/preparing-for-amazon-aws-usage/#comments</comments>
		<pubDate>Wed, 24 Sep 2008 09:57:39 +0000</pubDate>
		<dc:creator>Ringo</dc:creator>
				<category><![CDATA[Cloud]]></category>
		<category><![CDATA[AWS]]></category>

		<guid isPermaLink="false">http://blog.atriso.be/?p=5</guid>
		<description><![CDATA[In order to experiment with Amazon Web Services, I requested an AWS account and I installed a bunch of software to get started. Here is an overview of what I did to get up and running. Setting Up an AWS Account and the EC2 Tools I filled in the registration form to request a new [...]]]></description>
				<content:encoded><![CDATA[<p>In order to experiment with <a href="http://aws.amazon.com/" target="_blank">Amazon Web Services</a>, I requested an AWS account and I installed a bunch of software to get started. Here is an overview of what I did to get up and running.</p>
<h3>Setting Up an AWS Account and the EC2 Tools</h3>
<p>I filled in the <a href="https://aws-portal.amazon.com/gp/aws/developer/registration/index.html" target="_blank">registration form</a> to request a new AWS account. Then I followed the excellent <a href="http://docs.amazonwebservices.com/AWSEC2/2007-03-01/GettingStartedGuide/" target="_blank">Getting Started Guide</a>. It explains how to set up an account, how to install the EC2 tools, how to run an instance, and how to create your own image starting from an existing one. I immediately felt the power to EC2.</p>
<p><span id="more-5"></span>The <a href="http://status.aws.amazon.com/" target="_blank">AWS Service Health Dashboard</a> shows the status of AWS. It even shows the status history of about 1 month.</p>
<p>The <a href="http://aws-portal.amazon.com/gp/aws/developer/account/index.html?ie=UTF8&amp;action=activity-summary" target="_blank">account activity</a> (you need an AWS account to see this page) shows the costs involved with AWS usage.</p>
<p><a href="http://www.atriso.be/wp-content/uploads/2008/09/account-activity.png"><img class="aligncenter size-full wp-image-27" title="Account activity" src="http://www.atriso.be/wp-content/uploads/2008/09/account-activity.png" alt="" width="500" height="371" /></a></p>
<h3>Installing Useful FireFox Plug-Ins</h3>
<p>Although the EC2 tools provide everything you need to manage images, instances, and other EC2 resources, it is easier to have a nice management GUI.</p>
<p><a href="http://sourceforge.net/projects/elasticfox/" target="_blank">Elasticfox</a> is a FireFox plug-in for interacting with EC2, the Elasic Compute Cloud. When installed, it is available from the Tools menu. The plug-in opens in a web page and shows the avalaible machne images (AMIs) and your instances. Running an instance is as simle as selecting an AMI and pressing the &#8220;Launch Instance(s)&#8221; button. The list of public images is long. Elasticfox allows to filter the list.</p>
<p>The running instances show up in the &#8220;Your Instances&#8221; list. For each running instance, the public DNS name is shown, so that you can use that to connect to the instance through SSH, HTTP or other means. In the &#8220;Your Instances&#8221; list you can terminate instances when they are no longer necessary. Terminated instances are kept in the list until about one hour after termination.</p>
<p style="text-align: center;"><a href="http://www.atriso.be/wp-content/uploads/2008/09/elasticfox-showing-images-and-running-instance.png"><img class="alignnone size-full wp-image-15" title="ElasticFox showing images and running instance" src="http://www.atriso.be/wp-content/uploads/2008/09/elasticfox-showing-images-and-running-instance.png" alt="" width="500" height="309" /></a></p>
<p><a href="http://www.rjonna.com/ext/s3fox.php" target="_blank">S3Fox Organizer for Amazon</a> enables access to Amazon S3 (Simple Storage Service). It shows the contents of your buckets on S3 and you can download and upload files. Simply entering you account ID, the access key and the secret key, and you are ready to roll.</p>
<h3><a href="http://www.atriso.be/wp-content/uploads/2008/09/s3fox-showing-upload-to-s3-bucket.png"><img class="aligncenter size-full wp-image-17" title="S3Fox showing upload to S3 bucket" src="http://www.atriso.be/wp-content/uploads/2008/09/s3fox-showing-upload-to-s3-bucket.png" alt="" width="500" height="309" /></a></h3>
<h3>Installing Desktop Access to Instances</h3>
<p>When you want to use a desktop image, so that you can use a GUI to manage your instances, you need software to access the desktop of the instances.</p>
<p>First you need a desktop image. I chose an <a href="http://developer.amazonwebservices.com/connect/entry.jspa?externalID=1425&amp;categoryID=101" target="_blank">Ubuntu GutsyDesktop AMI</a>, which is also available as a public AMI and listed in Elasticfox. I use a Mac, so I <a href="http://www.nomachine.com/download.php" target="_blank">downloaded the NX Client for Mac OSX</a> (you can download NX Client for other operating systems from the same location). In no time, I was able to manage the instance through a GUI.</p>
<p>I selected &#8220;ami-0757b26e&#8221; from the list in Elasticfox and pressed the &#8220;Launch Instance(s)&#8221; button. In the dialog window that appeared, I entered my key pair and pressed the &#8220;Launch&#8221; button. When the instance was running, I opened a terminal and entered:</p>
<pre class="brush: bash; title: ; notranslate">$ ssh -i /Users/Koen/ec2-keys/id_gettingstarted-keypair root&#64;ec2-75-101-241-111.compute-1.amazo&#110;&#97;&#119;&#115;&#46;&#99;&#111;&#109;</pre>
<p>Using the provided information, user &#8220;root&#8221; logs in automatically. Then I entered:</p>
<pre class="brush: bash; title: ; notranslate">$ user-setup</pre>
<p>and followed the instructions to enter a user name (I chose &#8220;koen&#8221;) and a password.</p>
<p>Then I started NX Client and configured it as follows:</p>
<p style="text-align: center;"><a href="http://www.atriso.be/wp-content/uploads/2008/09/nx-client-login.png"><img class="size-medium wp-image-20 aligncenter" title="NX Client login" src="http://www.atriso.be/wp-content/uploads/2008/09/nx-client-login-300x211.png" alt="" width="300" height="211" /></a></p>
<p style="text-align: center;"><a href="http://www.atriso.be/wp-content/uploads/2008/09/nx-client-host-configuration.png"><img class="size-medium wp-image-19 aligncenter" title="NX Client host configuration" src="http://www.atriso.be/wp-content/uploads/2008/09/nx-client-host-configuration-280x300.png" alt="" width="280" height="300" /></a></p>
<p>After pressing &#8220;Login&#8221; and waiting for the connection to be setup, this was the result (I already opened the home folder before making the screen shot): the Ubuntu desktop in X11.</p>
<p><a style="text-decoration: none;" href="http://www.atriso.be/wp-content/uploads/2008/09/ubuntu-desktop-in-x11.png"><span style="color: #000000;"><br />
</span><img class="aligncenter size-full wp-image-22" style="text-decoration: underline;" title="Unbuntu destop in X11" src="http://www.atriso.be/wp-content/uploads/2008/09/ubuntu-desktop-in-x11.png" alt="" width="500" height="385" /></a></p>
<p>Cool.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.atriso.be/2008/09/preparing-for-amazon-aws-usage/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 2.862 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2013-05-20 13:06:31 -->

<!-- Compression = gzip -->