<?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>Phil Chen</title>
	<atom:link href="http://www.philchen.com/feed" rel="self" type="application/rss+xml" />
	<link>http://www.philchen.com</link>
	<description>Phil Chen</description>
	<lastBuildDate>Mon, 30 Apr 2012 22:56:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>How to create an Amazon Elastic Compute Cloud EC2 Machine Image (AMI) CentOS 6 S3 Backed or EBS Backed</title>
		<link>http://www.philchen.com/2012/04/30/how-to-create-an-amazon-elastic-compute-cloud-ec2-machine-image-ami-centos-6-s3-backed-or-ebs-backed</link>
		<comments>http://www.philchen.com/2012/04/30/how-to-create-an-amazon-elastic-compute-cloud-ec2-machine-image-ami-centos-6-s3-backed-or-ebs-backed#comments</comments>
		<pubDate>Mon, 30 Apr 2012 22:51:43 +0000</pubDate>
		<dc:creator>Phil Chen</dc:creator>
				<category><![CDATA[Cloud Computing]]></category>
		<category><![CDATA[DevOps]]></category>

		<guid isPermaLink="false">http://www.philchen.com/?p=1002</guid>
		<description><![CDATA[This how to article will go over creating a Amazon Elastic Compute Cloud (EC2) Machine Image (AMI) S3 backed as well as EBS backed. In this particular example we are creating a Centos 6 64bit AMI from beginning to end. I wrote a blog about this topic in 2010 and decided to freshen it up [...]]]></description>
			<content:encoded><![CDATA[<p>This how to article will go over creating a Amazon Elastic Compute Cloud (EC2) Machine Image (AMI) S3 backed as well as EBS backed. In this particular example we are creating a Centos 6 64bit AMI from beginning to end. I wrote a <a href="http://www.philchen.com/2009/02/14/how-to-create-an-amazon-elastic-compute-cloud-ec2-machine-image-ami">blog</a> about this topic in 2010 and decided to freshen it up a bit with a CentOS 6 build.<br />
<span id="more-1002"></span><br />
First you will want to hop on a CentOS 6 box you have available so that all the yum commands will work below.</p>
<p>This first step is to setup your basic environment to start building.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">yum <span style="color: #660033;">-y</span> <span style="color: #c20cb9; font-weight: bold;">install</span> e2fsprogs ruby java-1.6.0-openjdk <span style="color: #c20cb9; font-weight: bold;">unzip</span> MAKEDEV
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> <span style="color: #000000; font-weight: bold;">/</span>root<span style="color: #000000; font-weight: bold;">/</span>.ec2
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">cp</span> amikey.pem <span style="color: #000000; font-weight: bold;">/</span>root<span style="color: #000000; font-weight: bold;">/</span>.ec2
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">cp</span> amicert.pem <span style="color: #000000; font-weight: bold;">/</span>root<span style="color: #000000; font-weight: bold;">/</span>.ec2
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>EC2TOOLS <span style="color: #000000; font-weight: bold;">/</span>data <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>EC2YUM
&nbsp;
curl <span style="color: #660033;">-o</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>ec2-api-tools.zip http:<span style="color: #000000; font-weight: bold;">//</span>s3.amazonaws.com<span style="color: #000000; font-weight: bold;">/</span>ec2-downloads<span style="color: #000000; font-weight: bold;">/</span>ec2-api-tools.zip
&nbsp;
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>tmp
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">unzip</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>ec2-api-tools.zip
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #660033;">-r</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>ec2-api-tools-<span style="color: #000000; font-weight: bold;">*/*</span> <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>EC2TOOLS
&nbsp;
curl <span style="color: #660033;">-o</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>ec2-ami-tools.zip http:<span style="color: #000000; font-weight: bold;">//</span>s3.amazonaws.com<span style="color: #000000; font-weight: bold;">/</span>ec2-downloads<span style="color: #000000; font-weight: bold;">/</span>ec2-ami-tools.zip
&nbsp;
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>tmp
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">unzip</span> ec2-ami-tools.zip
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #660033;">-r</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>ec2-ami-tools-<span style="color: #000000; font-weight: bold;">*/*</span> <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>EC2TOOLS</pre></div></div>

<p>Save your X509 certificates in the following directories:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>root<span style="color: #000000; font-weight: bold;">/</span>.ec2<span style="color: #000000; font-weight: bold;">/</span>amikey.pem
<span style="color: #000000; font-weight: bold;">/</span>root<span style="color: #000000; font-weight: bold;">/</span>.ec2<span style="color: #000000; font-weight: bold;">/</span>amicert.pem</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">&lt;&lt;</span>EOT <span style="color: #000000; font-weight: bold;">&gt;/</span>root<span style="color: #000000; font-weight: bold;">/</span>.bashrc
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PATH</span>=\<span style="color: #007800;">$PATH</span>:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>sbin:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin:<span style="color: #000000; font-weight: bold;">/</span>bin:<span style="color: #000000; font-weight: bold;">/</span>sbin:<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>EC2TOOLS<span style="color: #000000; font-weight: bold;">/</span>bin
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">EC2_HOME</span>=<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>EC2TOOLS
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">EC2_PRIVATE_KEY</span>=~<span style="color: #000000; font-weight: bold;">/</span>.ec2<span style="color: #000000; font-weight: bold;">/</span>amikey.pem
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">EC2_CERT</span>=~<span style="color: #000000; font-weight: bold;">/</span>.ec2<span style="color: #000000; font-weight: bold;">/</span>amicert.pem
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">JAVA_HOME</span>=<span style="color: #000000; font-weight: bold;">/</span>usr
EOT
&nbsp;
<span style="color: #7a0874; font-weight: bold;">source</span> ~<span style="color: #000000; font-weight: bold;">/</span>.bashrc</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">RELEASE</span>=<span style="color: #000000;">6</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">ARCH</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">uname</span> -i<span style="color: #000000; font-weight: bold;">`</span></pre></div></div>

<p>This step is to create your disk image and filesystem and file structure.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">dd</span> <span style="color: #007800;">if</span>=<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>zero <span style="color: #007800;">of</span>=<span style="color: #000000; font-weight: bold;">/</span>data<span style="color: #000000; font-weight: bold;">/</span>CentOS<span style="color: #007800;">$RELEASE</span>-<span style="color: #007800;">$ARCH</span>-base.img <span style="color: #007800;">bs</span>=1M <span style="color: #007800;">count</span>=<span style="color: #000000;">10240</span>
&nbsp;
mkfs.ext4 <span style="color: #660033;">-F</span> <span style="color: #660033;">-j</span> <span style="color: #000000; font-weight: bold;">/</span>data<span style="color: #000000; font-weight: bold;">/</span>CentOS<span style="color: #007800;">$RELEASE</span>-<span style="color: #007800;">$ARCH</span>-base.img
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>ec2-image
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">mount</span> <span style="color: #660033;">-o</span> loop <span style="color: #000000; font-weight: bold;">/</span>data<span style="color: #000000; font-weight: bold;">/</span>CentOS<span style="color: #007800;">$RELEASE</span>-<span style="color: #007800;">$ARCH</span>-base.img <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>ec2-image<span style="color: #000000; font-weight: bold;">/</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>ec2-image
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> proc etc dev var <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>cache <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lock <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>loc<span style="color: #000000; font-weight: bold;">/</span>rpm sys</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">&lt;&lt;</span>EOT <span style="color: #000000; font-weight: bold;">&gt;/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>ec2-image<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>fstab
<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>xvde1    <span style="color: #000000; font-weight: bold;">/</span>        ext4        defaults,noatime,nodiratime    <span style="color: #000000;">1</span>    <span style="color: #000000;">1</span>
EOT</pre></div></div>

<p>This step is to create your Yum conf that you will use to install the base OS</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>EC2YUM
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">&lt;&lt;</span>EOT <span style="color: #000000; font-weight: bold;">&gt;/</span>opt<span style="color: #000000; font-weight: bold;">/</span>EC2YUM<span style="color: #000000; font-weight: bold;">/</span>yum-ami.conf
<span style="color: #7a0874; font-weight: bold;">&#91;</span>base<span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #007800;">name</span>=CentOS-<span style="color: #007800;">$RELEASE</span> - Base
<span style="color: #007800;">mirrorlist</span>=http:<span style="color: #000000; font-weight: bold;">//</span>mirrorlist.centos.org<span style="color: #000000; font-weight: bold;">/</span>?<span style="color: #007800;">release</span>=<span style="color: #007800;">$RELEASE</span><span style="color: #000000; font-weight: bold;">&amp;</span><span style="color: #007800;">arch</span>=<span style="color: #007800;">$ARCH</span><span style="color: #000000; font-weight: bold;">&amp;</span><span style="color: #007800;">repo</span>=os
<span style="color: #666666; font-style: italic;">#baseurl=http://mirror.centos.org/centos/$RELEASE/os/$ARCH/</span>
<span style="color: #007800;">gpgcheck</span>=<span style="color: #000000;">1</span>
<span style="color: #007800;">gpgkey</span>=http:<span style="color: #000000; font-weight: bold;">//</span>mirror.centos.org<span style="color: #000000; font-weight: bold;">/</span>centos<span style="color: #000000; font-weight: bold;">/</span>RPM-GPG-KEY-CentOS-<span style="color: #007800;">$RELEASE</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">&#91;</span>updates<span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #007800;">name</span>=CentOS-<span style="color: #007800;">$RELEASE</span> - Updates
<span style="color: #007800;">mirrorlist</span>=http:<span style="color: #000000; font-weight: bold;">//</span>mirrorlist.centos.org<span style="color: #000000; font-weight: bold;">/</span>?<span style="color: #007800;">release</span>=<span style="color: #007800;">$RELEASE</span><span style="color: #000000; font-weight: bold;">&amp;</span><span style="color: #007800;">arch</span>=<span style="color: #007800;">$ARCH</span><span style="color: #000000; font-weight: bold;">&amp;</span><span style="color: #007800;">repo</span>=updates
<span style="color: #666666; font-style: italic;">#baseurl=http://mirror.centos.org/centos/$RELEASE/updates/$ARCH/</span>
<span style="color: #007800;">gpgcheck</span>=<span style="color: #000000;">1</span>
<span style="color: #007800;">gpgkey</span>=http:<span style="color: #000000; font-weight: bold;">//</span>mirror.centos.org<span style="color: #000000; font-weight: bold;">/</span>centos<span style="color: #000000; font-weight: bold;">/</span>RPM-GPG-KEY-CentOS-<span style="color: #007800;">$RELEASE</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">&#91;</span>extras<span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #007800;">name</span>=CentOS-<span style="color: #007800;">$RELEASE</span> - Extras
<span style="color: #007800;">mirrorlist</span>=http:<span style="color: #000000; font-weight: bold;">//</span>mirrorlist.centos.org<span style="color: #000000; font-weight: bold;">/</span>?<span style="color: #007800;">release</span>=<span style="color: #007800;">$RELEASE</span><span style="color: #000000; font-weight: bold;">&amp;</span><span style="color: #007800;">arch</span>=<span style="color: #007800;">$ARCH</span><span style="color: #000000; font-weight: bold;">&amp;</span><span style="color: #007800;">repo</span>=extras
<span style="color: #666666; font-style: italic;">#baseurl=http://mirror.centos.org/centos/$RELEASE/extras/$ARCH/</span>
<span style="color: #007800;">gpgcheck</span>=<span style="color: #000000;">1</span>
<span style="color: #007800;">gpgkey</span>=http:<span style="color: #000000; font-weight: bold;">//</span>mirror.centos.org<span style="color: #000000; font-weight: bold;">/</span>centos<span style="color: #000000; font-weight: bold;">/</span>RPM-GPG-KEY-<span style="color: #007800;">$RELEASE</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">&#91;</span>centosplus<span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #007800;">name</span>=CentOS-<span style="color: #007800;">$RELEASE</span> - Plus
<span style="color: #007800;">mirrorlist</span>=http:<span style="color: #000000; font-weight: bold;">//</span>mirrorlist.centos.org<span style="color: #000000; font-weight: bold;">/</span>?<span style="color: #007800;">release</span>=<span style="color: #007800;">$RELEASE</span><span style="color: #000000; font-weight: bold;">&amp;</span><span style="color: #007800;">arch</span>=<span style="color: #007800;">$ARCH</span><span style="color: #000000; font-weight: bold;">&amp;</span><span style="color: #007800;">repo</span>=centosplus
<span style="color: #666666; font-style: italic;">#baseurl=http://mirror.centos.org/centos/$RELEASE/centosplus/$ARCH/</span>
<span style="color: #007800;">gpgcheck</span>=<span style="color: #000000;">1</span>
<span style="color: #007800;">enabled</span>=<span style="color: #000000;">0</span>
<span style="color: #007800;">gpgkey</span>=http:<span style="color: #000000; font-weight: bold;">//</span>mirror.centos.org<span style="color: #000000; font-weight: bold;">/</span>centos<span style="color: #000000; font-weight: bold;">/</span>RPM-GPG-KEY-<span style="color: #007800;">$RELEASE</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">&#91;</span>contrib<span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #007800;">name</span>=CentOS-<span style="color: #007800;">$RELEASE</span> - Contrib
<span style="color: #007800;">mirrorlist</span>=http:<span style="color: #000000; font-weight: bold;">//</span>mirrorlist.centos.org<span style="color: #000000; font-weight: bold;">/</span>?<span style="color: #007800;">release</span>=<span style="color: #007800;">$RELEASE</span><span style="color: #000000; font-weight: bold;">&amp;</span><span style="color: #007800;">arch</span>=<span style="color: #007800;">$ARCH</span><span style="color: #000000; font-weight: bold;">&amp;</span><span style="color: #007800;">repo</span>=contrib
<span style="color: #666666; font-style: italic;">#baseurl=http://mirror.centos.org/centos/$RELEASE/contrib/$ARCH/</span>
<span style="color: #007800;">gpgcheck</span>=<span style="color: #000000;">1</span>
<span style="color: #007800;">enabled</span>=<span style="color: #000000;">0</span>
<span style="color: #007800;">gpgkey</span>=http:<span style="color: #000000; font-weight: bold;">//</span>mirror.centos.org<span style="color: #000000; font-weight: bold;">/</span>centos<span style="color: #000000; font-weight: bold;">/</span>RPM-GPG-KEY-<span style="color: #007800;">$RELEASE</span>
EOT</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">yum <span style="color: #660033;">-c</span> <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>EC2YUM<span style="color: #000000; font-weight: bold;">/</span>yum-ami.conf <span style="color: #660033;">--installroot</span>=<span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>ec2-image <span style="color: #660033;">-y</span> groupinstall Base</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">yum <span style="color: #660033;">-c</span> <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>EC2YUM<span style="color: #000000; font-weight: bold;">/</span>yum-ami.conf <span style="color: #660033;">--installroot</span>=<span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>ec2-image <span style="color: #660033;">-y</span> <span style="color: #c20cb9; font-weight: bold;">install</span> openssh-server yum-plugin-fastestmirror.noarch e2fsprogs dhclient</pre></div></div>

<p>This step is to allow root login without password, since you will be using your key</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">&lt;&lt;</span>EOT <span style="color: #000000; font-weight: bold;">&gt;&gt;/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>ec2-image<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>ssh<span style="color: #000000; font-weight: bold;">/</span>sshd_config
UseDNS no
PermitRootLogin without-password
EOT</pre></div></div>

<p>Create devices so we can use chroot for the image</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">MAKEDEV <span style="color: #660033;">-d</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>ec2-image<span style="color: #000000; font-weight: bold;">/</span>dev <span style="color: #660033;">-x</span> console
&nbsp;
MAKEDEV <span style="color: #660033;">-d</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>ec2-image<span style="color: #000000; font-weight: bold;">/</span>dev <span style="color: #660033;">-x</span> null
&nbsp;
MAKEDEV <span style="color: #660033;">-d</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>ec2-image<span style="color: #000000; font-weight: bold;">/</span>dev <span style="color: #660033;">-x</span> zero
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">mount</span> <span style="color: #660033;">-o</span> <span style="color: #7a0874; font-weight: bold;">bind</span> <span style="color: #000000; font-weight: bold;">/</span>dev <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>ec2-image<span style="color: #000000; font-weight: bold;">/</span>dev
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">mount</span> <span style="color: #660033;">-o</span> <span style="color: #7a0874; font-weight: bold;">bind</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>pts <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>ec2-image<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>pts
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">mount</span> <span style="color: #660033;">-o</span> <span style="color: #7a0874; font-weight: bold;">bind</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>shm <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>ec2-image<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>shm
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">mount</span> <span style="color: #660033;">-o</span> <span style="color: #7a0874; font-weight: bold;">bind</span> <span style="color: #000000; font-weight: bold;">/</span>proc <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>ec2-image<span style="color: #000000; font-weight: bold;">/</span>proc
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">mount</span> <span style="color: #660033;">-o</span> <span style="color: #7a0874; font-weight: bold;">bind</span> <span style="color: #000000; font-weight: bold;">/</span>sys <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>ec2-image<span style="color: #000000; font-weight: bold;">/</span>sys</pre></div></div>

<p>Create network settings</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">&lt;&lt;</span>EOT <span style="color: #000000; font-weight: bold;">&gt;/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>ec2-image<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>sysconfig<span style="color: #000000; font-weight: bold;">/</span>network
<span style="color: #007800;">NETWORKING</span>=<span style="color: #c20cb9; font-weight: bold;">yes</span>
<span style="color: #007800;">HOSTNAME</span>=localhost.localdomain
EOT</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">&lt;&lt;</span>EOT <span style="color: #000000; font-weight: bold;">&gt;/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>ec2-image<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>sysconfig<span style="color: #000000; font-weight: bold;">/</span>network-scripts<span style="color: #000000; font-weight: bold;">/</span>ifcfg-eth0
<span style="color: #007800;">ONBOOT</span>=<span style="color: #c20cb9; font-weight: bold;">yes</span>
<span style="color: #007800;">DEVICE</span>=eth0
<span style="color: #007800;">BOOTPROTO</span>=dhcp
<span style="color: #007800;">NM_CONTROLLED</span>=<span style="color: #c20cb9; font-weight: bold;">yes</span>
EOT</pre></div></div>

<p>Create grub.conf and boot settings so the Amazon Kernel Image can boot into the new Kernel</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">&lt;&lt;</span>EOL <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>ec2-image<span style="color: #000000; font-weight: bold;">/</span>boot<span style="color: #000000; font-weight: bold;">/</span>grub<span style="color: #000000; font-weight: bold;">/</span>grub.conf
<span style="color: #007800;">default</span>=<span style="color: #000000;">0</span>
<span style="color: #007800;">timeout</span>=<span style="color: #000000;">0</span>
title CentOS<span style="color: #007800;">$RELEASE</span>
root <span style="color: #7a0874; font-weight: bold;">&#40;</span>hd0<span style="color: #7a0874; font-weight: bold;">&#41;</span>
kernel <span style="color: #000000; font-weight: bold;">/</span>boot<span style="color: #000000; font-weight: bold;">/</span>vmlinuz ro <span style="color: #007800;">root</span>=<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>xvde1 rd_NO_PLYMOUTH <span style="color: #007800;">selinux</span>=<span style="color: #000000;">0</span> <span style="color: #007800;">console</span>=hvc0 <span style="color: #007800;">loglvl</span>=all sync_console console_to_ring <span style="color: #007800;">earlyprintk</span>=xen nomodeset 
initrd <span style="color: #000000; font-weight: bold;">/</span>boot<span style="color: #000000; font-weight: bold;">/</span>initramfs
EOL</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>boot<span style="color: #000000; font-weight: bold;">/</span>grub<span style="color: #000000; font-weight: bold;">/</span>grub.conf <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>ec2-image<span style="color: #000000; font-weight: bold;">/</span>boot<span style="color: #000000; font-weight: bold;">/</span>grub<span style="color: #000000; font-weight: bold;">/</span>menu.lst
&nbsp;
<span style="color: #007800;">kern</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>ec2-image<span style="color: #000000; font-weight: bold;">/</span>boot<span style="color: #000000; font-weight: bold;">/</span>vmlin<span style="color: #000000; font-weight: bold;">*|</span><span style="color: #c20cb9; font-weight: bold;">awk</span> -F<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #ff0000;">'{print $NF}'</span><span style="color: #000000; font-weight: bold;">`</span>
&nbsp;
<span style="color: #007800;">kernver</span>=<span style="color: #800000;">${kern#vmlinuz-}</span>
&nbsp;
<span style="color: #007800;">ird</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>ec2-image<span style="color: #000000; font-weight: bold;">/</span>boot<span style="color: #000000; font-weight: bold;">/</span>initramfs<span style="color: #000000; font-weight: bold;">*</span>.img<span style="color: #000000; font-weight: bold;">|</span><span style="color: #c20cb9; font-weight: bold;">awk</span> -F<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #ff0000;">'{print $NF}'</span><span style="color: #000000; font-weight: bold;">`</span>
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-ie</span> <span style="color: #ff0000;">&quot;s/vmlinuz/<span style="color: #007800;">$kern</span>/&quot;</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>ec2-image<span style="color: #000000; font-weight: bold;">/</span>boot<span style="color: #000000; font-weight: bold;">/</span>grub<span style="color: #000000; font-weight: bold;">/</span>grub.conf
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-ie</span> <span style="color: #ff0000;">&quot;s/initramfs/<span style="color: #007800;">$ird</span>/&quot;</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>ec2-image<span style="color: #000000; font-weight: bold;">/</span>boot<span style="color: #000000; font-weight: bold;">/</span>grub<span style="color: #000000; font-weight: bold;">/</span>grub.conf</pre></div></div>

<p>Create a script that grabs the public key credentials for your root login.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">vi</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>ec2-image<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>getssh
&nbsp;
<span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #666666; font-style: italic;"># chkconfig: 2345 95 20</span>
<span style="color: #666666; font-style: italic;"># description: getssh</span>
<span style="color: #666666; font-style: italic;"># processname: getssh</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PATH</span>=:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>sbin:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin:<span style="color: #000000; font-weight: bold;">/</span>bin:<span style="color: #000000; font-weight: bold;">/</span>sbin
<span style="color: #666666; font-style: italic;"># Source function library.</span>
. <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>rc.d<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>functions
&nbsp;
<span style="color: #666666; font-style: italic;"># Source networking configuration.</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-r</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>sysconfig<span style="color: #000000; font-weight: bold;">/</span>network <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;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>sysconfig<span style="color: #000000; font-weight: bold;">/</span>network
&nbsp;
<span style="color: #666666; font-style: italic;"># Check that networking is up.</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${NETWORKING}</span>&quot;</span> = <span style="color: #ff0000;">&quot;no&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;">exit</span> <span style="color: #000000;">1</span>
&nbsp;
start<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: #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: #660033;">-d</span> <span style="color: #000000; font-weight: bold;">/</span>root<span style="color: #000000; font-weight: bold;">/</span>.ssh <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;">mkdir</span> <span style="color: #660033;">-p</span> <span style="color: #000000; font-weight: bold;">/</span>root<span style="color: #000000; font-weight: bold;">/</span>.ssh
          <span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">700</span> <span style="color: #000000; font-weight: bold;">/</span>root<span style="color: #000000; font-weight: bold;">/</span>.ssh
  <span style="color: #000000; font-weight: bold;">fi</span>
  <span style="color: #666666; font-style: italic;"># Fetch public key using HTTP</span>
<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>curl <span style="color: #660033;">-f</span> http:<span style="color: #000000; font-weight: bold;">//</span>169.254.169.254<span style="color: #000000; font-weight: bold;">/</span>latest<span style="color: #000000; font-weight: bold;">/</span>meta-data<span style="color: #000000; font-weight: bold;">/</span>public-keys<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">0</span><span style="color: #000000; font-weight: bold;">/</span>openssh-key <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>my-key
  <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$?</span> <span style="color: #660033;">-eq</span> <span style="color: #000000;">0</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;">cat</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>my-key <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>root<span style="color: #000000; font-weight: bold;">/</span>.ssh<span style="color: #000000; font-weight: bold;">/</span>authorized_keys
          <span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">600</span> <span style="color: #000000; font-weight: bold;">/</span>root<span style="color: #000000; font-weight: bold;">/</span>.ssh<span style="color: #000000; font-weight: bold;">/</span>authorized_keys
          <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>my-key
  <span style="color: #000000; font-weight: bold;">fi</span>
  <span style="color: #666666; font-style: italic;"># or fetch public key using the file in the ephemeral store:</span>
  <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-e</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>openssh_id.pub <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;">cat</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>openssh_id.pub <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>root<span style="color: #000000; font-weight: bold;">/</span>.ssh<span style="color: #000000; font-weight: bold;">/</span>authorized_keys
          <span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">600</span> <span style="color: #000000; font-weight: bold;">/</span>root<span style="color: #000000; font-weight: bold;">/</span>.ssh<span style="color: #000000; font-weight: bold;">/</span>authorized_keys
  <span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
stop<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: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Nothing to do here&quot;</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
restart<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>
  stop
  start
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># See how we were called.</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>
  start<span style="color: #7a0874; font-weight: bold;">&#41;</span>
    start
    <span style="color: #000000; font-weight: bold;">;;</span>
  stop<span style="color: #7a0874; font-weight: bold;">&#41;</span>
    stop
    <span style="color: #000000; font-weight: bold;">;;</span>
  restart<span style="color: #7a0874; font-weight: bold;">&#41;</span>
    restart
    <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;Usage: $0 {start|stop}&quot;</span>
    <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span>
<span style="color: #000000; font-weight: bold;">esac</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #007800;">$?</span>
<span style="color: #666666; font-style: italic;">###END OF SCRIPT</span></pre></div></div>

<p>Make your script init ready</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">&nbsp;
<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">chmod</span> +x <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>ec2-image<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>getssh
&nbsp;
<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">chroot</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>ec2-image <span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>chkconfig <span style="color: #660033;">--level</span> <span style="color: #000000;">34</span> getssh on</pre></div></div>

<p>Clean up after yourself</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">yum <span style="color: #660033;">-c</span> <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>EC2YUM<span style="color: #000000; font-weight: bold;">/</span>yum-ami.conf <span style="color: #660033;">--installroot</span>=<span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>ec2-image <span style="color: #660033;">-y</span> clean packages
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-rf</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>ec2-image<span style="color: #000000; font-weight: bold;">/</span>root<span style="color: #000000; font-weight: bold;">/</span>.bash_history
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-rf</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>ec2-image<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>cache<span style="color: #000000; font-weight: bold;">/</span>yum
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-rf</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>ec2-image<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>yum</pre></div></div>

<p>Check for what Amazon AKI&#8217;s are available you will need this info when starting your ec2 instance</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>EC2TOOLS<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>ec2-describe-images <span style="color: #660033;">-H</span> <span style="color: #660033;">--region</span> us-east-<span style="color: #000000;">1</span> <span style="color: #660033;">-x</span> all<span style="color: #000000; font-weight: bold;">|</span><span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #ff0000;">&quot;pv-grub-hd0&quot;</span></pre></div></div>

<p>Bundle your new image</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>EC2TOOLS<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>ec2-bundle-image <span style="color: #660033;">--image</span> <span style="color: #000000; font-weight: bold;">/</span>data<span style="color: #000000; font-weight: bold;">/</span>CentOS<span style="color: #007800;">$RELEASE</span>-<span style="color: #007800;">$ARCH</span>-base.img <span style="color: #660033;">--prefix</span> ami-CentOS<span style="color: #007800;">$RELEASE</span>-<span style="color: #007800;">$ARCH</span>-base <span style="color: #660033;">--cert</span> ~<span style="color: #000000; font-weight: bold;">/</span>.ec2<span style="color: #000000; font-weight: bold;">/</span>amicert.pem <span style="color: #660033;">--privatekey</span> ~<span style="color: #000000; font-weight: bold;">/</span>.ec2<span style="color: #000000; font-weight: bold;">/</span>amikey.pem <span style="color: #660033;">--user</span> awsaccountnumber <span style="color: #660033;">--destination</span> <span style="color: #000000; font-weight: bold;">/</span>data <span style="color: #660033;">--arch</span> <span style="color: #007800;">$ARCH</span></pre></div></div>

<p>Upload your new image</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>EC2TOOLS<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>ec2-upload-bundle <span style="color: #660033;">--manifest</span> <span style="color: #000000; font-weight: bold;">/</span>data<span style="color: #000000; font-weight: bold;">/</span>ami-CentOS<span style="color: #007800;">$RELEASE</span>-<span style="color: #007800;">$ARCH</span>-base.manifest.xml <span style="color: #660033;">--bucket</span> yourbucket <span style="color: #660033;">--access-key</span> accesskeyhere <span style="color: #660033;">--secret-key</span> secretkeyhere</pre></div></div>

<p>Register your image</p>
<p>I recommend you do this via the Amazon Web Services Management console, under IMAGES->AMIs &#8220;Register New AMI&#8221; you will just need to enter bucketname/manifest.xml file for your new AMI.</p>
<p><strong>Steps to create a EBS Backed AMI from your S3 Backed Instance. *Only if you want an EBS Backed AMI do these steps<br />
</strong><br />
<strong>Step 1</strong></p>
<p>Start your newly created EC2 instance</p>
<p><strong>Step 2</strong></p>
<p>Go into the Amazon Web Services Management console and create a Volume at whatever size you choose</p>
<p><strong>Step 3</strong></p>
<p>Attach your Volume to your new running EC2 Instance</p>
<p><strong>Step 4</strong></p>
<p>Login to your new instance</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ssh</span> <span style="color: #660033;">-i</span> yourkey root<span style="color: #000000; font-weight: bold;">@</span>yournewinstance</pre></div></div>

<p><strong>Step 5</strong></p>
<p>Create your filesystem type in this case EXT4 then make a directory and mount it to the newly formated filesystem. After that we rsync the root of your ec2 instance, then unmount.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">mkfs.ext4 <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>xvdj
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>ebs <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">mount</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>xvdj <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>target
rsync <span style="color: #660033;">-avHx</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>ebs
rsync <span style="color: #660033;">-avHx</span> <span style="color: #000000; font-weight: bold;">/</span>dev <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>ebs
<span style="color: #c20cb9; font-weight: bold;">sync</span>;<span style="color: #c20cb9; font-weight: bold;">sync</span>;<span style="color: #c20cb9; font-weight: bold;">sync</span>;<span style="color: #c20cb9; font-weight: bold;">sync</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">umount</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>ebs</pre></div></div>

<p><strong>Step 6</strong></p>
<p>Go into the Amazon Web Services Management Console section Volumes and detach the Volume</p>
<p><strong>Step 7</strong></p>
<p>Go into the Amazon Web Services Management Console section Volumes and create a Snapshot of your Volume</p>
<p><strong>Step 8</strong></p>
<p>Go into the Amazon Web Services Management Console section Snapshots and select your new Snapshot and choose &#8220;create image&#8221; Fill in the name and description and the AWS AKI you chose in my case for us-east-1 I chose aki-08ed0761 for x86_64 bit hd0</p>
<p><strong>Step 9</strong></p>
<p>Start your new EBS backed AMI</p>
]]></content:encoded>
			<wfw:commentRss>http://www.philchen.com/2012/04/30/how-to-create-an-amazon-elastic-compute-cloud-ec2-machine-image-ami-centos-6-s3-backed-or-ebs-backed/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>2011 No Regrets, An Awesome Year!</title>
		<link>http://www.philchen.com/2012/01/21/2011-no-regrets-an-awesome-year</link>
		<comments>http://www.philchen.com/2012/01/21/2011-no-regrets-an-awesome-year#comments</comments>
		<pubDate>Sun, 22 Jan 2012 05:12:29 +0000</pubDate>
		<dc:creator>Phil Chen</dc:creator>
				<category><![CDATA[Life]]></category>

		<guid isPermaLink="false">http://www.philchen.com/?p=875</guid>
		<description><![CDATA[At the beginning of 2011 I had one goal for the year, and that was to live it to the fullest, with no regrets. With the year behind me I am happy to say it has been a great success! All the important elements in my life, family, friends, health, self improvement, career, and community [...]]]></description>
			<content:encoded><![CDATA[<p>At the beginning of 2011 I had one goal for the year, and that was to live it to the fullest, with no regrets. With the year behind me I am happy to say it has been a great success! All the important elements in my life, family, friends, health, self improvement, career, and community moved forward in 2011 in very positive ways.<br />
<span id="more-875"></span><br />
<strong>Family</strong></p>
<p>On May 29th I popped the question on my long time partner in crime Julia Holland and asked her to Marry me, at Pacifica Del Mar and with a small pause due to shock (very cute) she said Yes! This is the biggest thing to happen in my life, and I am looking forward to the future. Julia and I have had a great time experiencing what its like to be engaged. Below are two pictures one of Julia showing off her engagement ring and the other at our engagement party with both our families:</p>
<hr />
<a href="http://www.philchen.com/wp-content/uploads/2012/01/5777713204_9fb0baa41d.jpg"><img src="http://www.philchen.com/wp-content/uploads/2012/01/5777713204_9fb0baa41d-300x224.jpg" alt="" title="Proposal" width="300" height="224" class="alignleft size-medium wp-image-878" /></a><a href="http://www.philchen.com/wp-content/uploads/2012/01/6095829952_a1ea2fe55b_z.jpg"><img src="http://www.philchen.com/wp-content/uploads/2012/01/6095829952_a1ea2fe55b_z-300x225.jpg" alt="" title="Engagement Party" width="300" height="225" class="alignleft size-medium wp-image-898" /></a></p>
<hr />
<p>Also on Oct 1 I was honored to be the best man at my brother Eric and his new wife Janine&#8217;s wedding in San Francisco. I am very happy to see him enter a new journey in his life of happiness and excitement. I guess my brother and I are finally growing up a bit, and its nice to see the two of us lucky enough to find people to share our lives with. Below are some pictures from the Wedding:</p>
<hr />
<a href="http://www.philchen.com/wp-content/uploads/2012/01/6346815670_6bfde876f3.jpg"><img src="http://www.philchen.com/wp-content/uploads/2012/01/6346815670_6bfde876f3-199x300.jpg" alt="" title="Eric and Janine Wedding" width="199" height="300" class="alignleft size-medium wp-image-881" /></a><a href="http://www.philchen.com/wp-content/uploads/2012/01/6229858972_f4e8aef373_z.jpg"><img src="http://www.philchen.com/wp-content/uploads/2012/01/6229858972_f4e8aef373_z-300x225.jpg" alt="" title="Julia and I at Brothers Wedding" width="300" height="225" class="alignleft size-medium wp-image-916" /></a></p>
<hr />
<p><strong>Friends</strong></p>
<p>2011 also has been a year of reconnecting with old life long friends and making new friends. Having a chance to hang out with people you have known since 2nd grade is always an amazing thing. My buddies Jeff and Xan don&#8217;t ever seem to change! Also I got to see my good friend Christie, bringing back old days working in Hermosa Beach.</p>
<p>As for new friends I have managed to meet some great new people after joining <a href="http://laboxing.com/carlsbad/" target="_blank">Carlsbad LA Boxing</a> gym which I will talk about later in this post. As I get older I find trying new things is the perfect way to meet new people and make new friends.</p>
<hr />
<a href="http://www.philchen.com/wp-content/uploads/2012/01/277738_10150386636968902_623803901_10278386_350617_o.jpg"><img src="http://www.philchen.com/wp-content/uploads/2012/01/277738_10150386636968902_623803901_10278386_350617_o-300x225.jpg" alt="" title="Jeff Xan and I" width="300" height="225" class="alignleft size-medium wp-image-886" /></a><a href="http://www.philchen.com/wp-content/uploads/2012/01/6091417835_4d56dddbdf_z.jpg"><img src="http://www.philchen.com/wp-content/uploads/2012/01/6091417835_4d56dddbdf_z-224x300.jpg" alt="" title="Christie and Che" width="224" height="300" class="alignleft size-medium wp-image-922" /></a></p>
<hr />
<p><strong>Health</strong></p>
<p>I would have to say 2011 has been the healthiest year I can remember for me. Both in watching what I eat and exercising a lot! The biggest change has been adding both Muay Thai Boxing and Yoga to my already crazy running training.</p>
<p>One of my goals I achieved was to earn the Triple Crown status, basically running 3 San Diego Half Marathons, Carlsbad Half, La Jolla Half, and the AFC Half in one year. In 2011 I had 464 Training Miles of running the most in a single year I believe I have ever run, quite the accomplishment for me, and getting the Triple Crown was pretty awesome.</p>
<p>The biggest change for me was joining <a href="http://laboxing.com/carlsbad/" target="_blank">Carlsbad LA Boxing</a>, already in fairly good shape from all the running or so I thought. My first Cardio class almost brought me to the brink of puking. But 1 Year later I am happy to say I have graduated from just taking the Cardio classes to taking the Advanced Muay Thai classes as well and sparring a slew of fighters, and making some great friends. I went from weighing 155-160 lbs to now weighing 141-145 lbs and increasing my muscle strength and running speed by a huge amount, while having a blast. Special thanks to the <a href="http://laboxing.com/carlsbad/" target="_blank">Carlsbad LA Boxing Staff and new friends</a> Samantha Schmitt, Adam Griffis, Alan Roach, Tony Burnett, and Owners Jeff Nason, Richard Montano. Here are some <a href="http://www.youtube.com/playlist?list=PL15E73DEC5BBB4DE4&#038;feature=plcp" target="_blank">videos</a> of me sparring, and slowly getting better.</p>
<hr />
<a href="http://www.philchen.com/wp-content/uploads/2012/01/6075663538_c3a46ec0c8_z.jpg"><img src="http://www.philchen.com/wp-content/uploads/2012/01/6075663538_c3a46ec0c8_z-300x225.jpg" alt="" title="Triple Crown" width="300" height="225" class="alignleft size-medium wp-image-928" /></a><a href="http://www.philchen.com/wp-content/uploads/2012/01/6617889645_72b7525dbd_z.jpg"><img src="http://www.philchen.com/wp-content/uploads/2012/01/6617889645_72b7525dbd_z-225x300.jpg" alt="" title="Carlsbad LA Boxing" width="225" height="300" class="alignleft size-medium wp-image-930" /></a><a href="http://www.philchen.com/wp-content/uploads/2012/01/254712_259540937408615_100000581328030_968021_1258687_n.jpeg"><img src="http://www.philchen.com/wp-content/uploads/2012/01/254712_259540937408615_100000581328030_968021_1258687_n-300x205.jpg" alt="" title="Sam First Amateur Muay Thai Fight" width="300" height="205" class="alignleft size-medium wp-image-931" /></a><a href="http://www.philchen.com/wp-content/uploads/2012/01/298602_1736173983169_1803204923_1110709_1264443_n.jpeg"><img src="http://www.philchen.com/wp-content/uploads/2012/01/298602_1736173983169_1803204923_1110709_1264443_n-284x300.jpg" alt="" title="Adam" width="284" height="300" class="alignleft size-medium wp-image-934" /></a></p>
<hr />
<p><strong>Career</strong></p>
<p>Work is always something that is often regarded as a have to, versus a want to do, but I am lucky enough to do something I love to do, which basically makes me a happy camper.</p>
<p>As a Systems Engineering Architect and Entrepreneur 2011 has brought great things such architecting the cloud computing systems infrastructure for a new Private Video Sharing Service <a href="http://www.givit.com" target="_blank">GIVIT</a> to re-inventing <a href="http://www.systemswatch.com" target="_blank">Systems Watch</a> into a source for cloud computing realtime monitoring and a cross vendor cloud health gauge. Also with Julia leading the development effort we are very close to launching <a href="http://www.mygraphs.com" target="_blank">mygraphs</a> a data visualization and graphing resource for anyone to use. As I have experienced in the past loving what you do definitely ends up showing in the product or service you develop.</p>
<hr />
<a href="http://www.philchen.com/wp-content/uploads/2012/01/220131_10150275984393902_623803901_9305255_7279561_o.jpg"><img src="http://www.philchen.com/wp-content/uploads/2012/01/220131_10150275984393902_623803901_9305255_7279561_o-300x225.jpg" alt="" title="Pre Meeting" width="300" height="225" class="alignleft size-medium wp-image-971" /></a><a href="http://www.philchen.com/wp-content/uploads/2012/01/218293_10150275970373902_623803901_9305114_3563321_o.jpg"><img src="http://www.philchen.com/wp-content/uploads/2012/01/218293_10150275970373902_623803901_9305114_3563321_o-300x225.jpg" alt="" title="Data Center" width="300" height="225" class="alignleft size-medium wp-image-968" /></a><a href="http://www.philchen.com/wp-content/uploads/2012/01/5412579822_344dd155b8_z.jpg"><img src="http://www.philchen.com/wp-content/uploads/2012/01/5412579822_344dd155b8_z-300x168.jpg" alt="" title="Me" width="300" height="168" class="alignleft size-medium wp-image-972" /></a><a href="http://www.philchen.com/wp-content/uploads/2012/01/300158_10150506261408902_623803901_11246946_432507572_n.jpeg"><img src="http://www.philchen.com/wp-content/uploads/2012/01/300158_10150506261408902_623803901_11246946_432507572_n-300x222.jpg" alt="" title="Work" width="300" height="222" class="alignleft size-medium wp-image-970" /></a></p>
<hr />
<p><strong>Community</strong></p>
<p>Every year I help raise money for various organizations to help research and fight disease, support animals, protect state and national parks, and more. But 2011 definitely was a year I am proud of for raising money for the <a href="http://www.nationalmssociety.org/index.aspx" target="_blank">National Multiple Sclerosis Society</a>. With the generous donations from good hearted people I was able to raise $1605.00 for the Walk MS event in Carlsbad, and make the 100 top donors list joining the 100 club. Here is a <a href="http://vimeo.com/35444775" target="_blank">video</a> of the event. Giving back to the community I think is very important and I hope I can have the means to continue doing so for years to come.</p>
<p>Also in 2011 Julia and I became <a href="http://www.sdsualumni.org/" target="_blank">SDSU Lifetime Alumni</a>, having both graduated <a href="http://www.sdsu.edu" target="_blank">San Diego State University</a> we felt joining the Alumni Association and giving back to the school that helped shape us as individuals was important.</p>
<p><strong>New Things</strong></p>
<p>Possibly the largest purchase of the year was buying a new 2011 SMART Car. So first off yes its safe with 8 air bags a Tritium Roll Cage that can withstand a 65 mile per hour crash protecting you from being crushed, and yes its fast enough for the HWY I have taken it to 90 mph and it has a performance paddle shifter mode. Best of all you can park it anywhere, the turning radius is ridiculous, it gets 44 mpg and is fun as hell to drive. For those that know me and my 65 Mustang it still my baby and I still drive it a lot <img src='http://www.philchen.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<hr />
<a href="http://www.philchen.com/wp-content/uploads/2012/01/219848_10150307502638902_623803901_9586943_3566790_o.jpg"><img src="http://www.philchen.com/wp-content/uploads/2012/01/219848_10150307502638902_623803901_9586943_3566790_o-300x224.jpg" alt="" title="2011 SMART Car" width="300" height="224" class="alignleft size-medium wp-image-956" /></a><a href="http://www.philchen.com/wp-content/uploads/2012/01/220636_10150307648118902_623803901_9587961_6779928_o.jpg"><img src="http://www.philchen.com/wp-content/uploads/2012/01/220636_10150307648118902_623803901_9587961_6779928_o-300x224.jpg" alt="" title="2011 SMART Car Interior" width="300" height="224" class="alignleft size-medium wp-image-957" /></a> </p>
<hr />
<p><strong>In Conclusion</strong></p>
<p>I am happy the way 2011 went but I am even more excited for 2012. I hope to have an even longer blog next year! To conclude my 2011 end of year blog here is where you can see 365 pictures of 2011, a picture everyday. <a href="http://www.flickr.com/photos/nethacker/sets/72157625788887382/" target="_blank">365 Daily Photos of 2011</a></p>
<hr />
<a href="http://www.philchen.com/wp-content/uploads/2012/01/379112_10150713170593902_623803901_12105232_1886250673_n.jpeg"><img src="http://www.philchen.com/wp-content/uploads/2012/01/379112_10150713170593902_623803901_12105232_1886250673_n-300x224.jpg" alt="" title="379112_10150713170593902_623803901_12105232_1886250673_n" width="300" height="224" class="aligncenter size-medium wp-image-969" /></a></p>
<hr />
]]></content:encoded>
			<wfw:commentRss>http://www.philchen.com/2012/01/21/2011-no-regrets-an-awesome-year/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Raising Money For Those Living With Multiple Sclerosis</title>
		<link>http://www.philchen.com/2011/06/30/raising-money-for-people-with-multiple-sclerosis</link>
		<comments>http://www.philchen.com/2011/06/30/raising-money-for-people-with-multiple-sclerosis#comments</comments>
		<pubDate>Fri, 01 Jul 2011 04:28:26 +0000</pubDate>
		<dc:creator>Phil Chen</dc:creator>
				<category><![CDATA[Fundraising]]></category>

		<guid isPermaLink="false">http://www.philchen.com/?p=853</guid>
		<description><![CDATA[Each year I participate in Walk MS in support of the National Multiple Sclerosis Society Pacific South Coast Chapter. Walk MS is our rallying point, a time and a place for us to stand together and to be together &#8212; to help raise critical funds that support cutting edge research, drive change through advocacy, facilitate [...]]]></description>
			<content:encoded><![CDATA[<p>Each year I participate in <a href="http://www.mswalk.com">Walk MS</a> in support of the <a href="http://www.nationalmssociety.org/chapters/cas/index.aspx">National Multiple Sclerosis Society Pacific South Coast Chapter</a>. Walk MS is our rallying point, a time and a place for us to stand together and to be together &#8212; to help raise critical funds that support cutting edge research, drive change through advocacy, facilitate professional education and provide programs and services to help people with MS move their lives forward.<br />
<span id="more-853"></span><br />
I have been fortunate enough through lots of generous donors to make the Top 100 Fundraisers list two years in a row. Life is a very precious thing and not to be wasted, spending time with organizations like the National Multiple Sclerosis Society reminds me everyday how lucky I am.</p>
<p>Looking forward to 2012&#8230;</p>
<p>&nbsp;</p>
<div class="iframe-wrapper">
  <iframe src="http://mg00.mygraphs.com/philchen/mswalk.html" frameborder="0" style="height:400px;width:650px;">Please upgrade your browser</iframe>
</div><br />
Graphs Powered by: <a href="http://www.mygraphs.com">mygraphs.com</a></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.philchen.com/2011/06/30/raising-money-for-people-with-multiple-sclerosis/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Project Mustang Madness&#8230;</title>
		<link>http://www.philchen.com/2011/06/30/project-mustang-madness</link>
		<comments>http://www.philchen.com/2011/06/30/project-mustang-madness#comments</comments>
		<pubDate>Fri, 01 Jul 2011 02:40:47 +0000</pubDate>
		<dc:creator>Phil Chen</dc:creator>
				<category><![CDATA[Mustang]]></category>

		<guid isPermaLink="false">http://www.philchen.com/?p=835</guid>
		<description><![CDATA[My first car when I was 14, before I could drive was a 1964 1/2 Mustang Coupe my dad and I fixed up on the weekends. My second car when I was 17 was a 1966 Mustang Coupe which I drove all through College. My current car is a 1965 Mustang Coupe with a 302 [...]]]></description>
			<content:encoded><![CDATA[<p>My first car when I was 14, before I could drive was a 1964 1/2 Mustang Coupe my dad and I fixed up on the weekends. My second car when I was 17 was a 1966 Mustang Coupe which I drove all through College. My current car is a 1965 Mustang Coupe with a 302 V8, 4 Barrel 650 cfm Holley, and Flow Master two chamber mufflers,  its both my everyday car and my project car.<br />
<span id="more-835"></span><br />
I have a thing for working on Classic Mustangs and haven&#8217;t been able to shake the bug. I do find these days its harder to find time to work on my Mustang but when I get a chance its nice to get my hands dirty. I spend so much time working on a computer I find wrenching on a Hot Rod sets my head straight and adds balance to my life.</p>
<p>-</p>
<p><a href="http://www.philchen.com/wp-content/uploads/2011/06/228494_5997973901_623803901_279136_3788_n.jpg"><img src="http://www.philchen.com/wp-content/uploads/2011/06/228494_5997973901_623803901_279136_3788_n.jpg" alt="" title="My Mustang" width="600" height="450" class="aligncenter size-full wp-image-836" /></a></p>
<p>-</p>
<p><a href="http://www.philchen.com/wp-content/uploads/2011/06/228564_5997978901_623803901_279137_4045_n.jpg"><img src="http://www.philchen.com/wp-content/uploads/2011/06/228564_5997978901_623803901_279137_4045_n.jpg" alt="" title="Mustang Engine Compartment" width="600" height="450" class="aligncenter size-full wp-image-840" /></a></p>
<p>-</p>
<p><a href="http://www.philchen.com/wp-content/uploads/2011/06/230984_5997928901_623803901_279133_2532_n.jpg"><img src="http://www.philchen.com/wp-content/uploads/2011/06/230984_5997928901_623803901_279133_2532_n.jpg" alt="" title="Stang" width="604" height="452" class="aligncenter size-full wp-image-841" /></a></p>
<p>-</p>
<p><a href="http://www.philchen.com/wp-content/uploads/2011/06/22032_311120158901_623803901_4698588_5509366_n.jpg"><img src="http://www.philchen.com/wp-content/uploads/2011/06/22032_311120158901_623803901_4698588_5509366_n.jpg" alt="" title="Stang" width="604" height="453" class="aligncenter size-full wp-image-842" /></a></p>
<p>-</p>
]]></content:encoded>
			<wfw:commentRss>http://www.philchen.com/2011/06/30/project-mustang-madness/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Project Phil</title>
		<link>http://www.philchen.com/2011/06/28/project-phil</link>
		<comments>http://www.philchen.com/2011/06/28/project-phil#comments</comments>
		<pubDate>Tue, 28 Jun 2011 22:39:21 +0000</pubDate>
		<dc:creator>Phil Chen</dc:creator>
				<category><![CDATA[Project Phil]]></category>

		<guid isPermaLink="false">http://www.philchen.com/?p=793</guid>
		<description><![CDATA[Statistics Updated Daily “We can rebuild him. We have the technology. We can make him better than he was. Better…stronger…faster.” - The Six Million Dollar Man Several years ago about the time I hit 31 I decided, time was moving by at an extremely fast pace and I had been neglecting my health both mentally [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Statistics Updated Daily</strong></p>
<p>“We can rebuild him. We have the technology. We can make him better than he was. Better…stronger…faster.”<br />
- The Six Million Dollar Man<br />
<span id="more-793"></span><br />
Several years ago about the time I hit 31 I decided, time was moving by at an extremely fast pace and I had been neglecting my health both mentally and physically. Call it a Mid-Life Crisis epiphany, yes I realize now a days Mid-Life is more age 45 but just the same, it was a positive realization.</p>
<p><strong>Below is the ongoing data showing my fitness and life hacking journey&#8230;</strong></p>
<p>&nbsp;</p>
<p><strong>Total running miles by Month each Year.</strong><br />
<div class="iframe-wrapper">
  <iframe src="http://mg00.mygraphs.com/philchen/total-running-miles.html" frameborder="0" style="height:400px;width:650px;">Please upgrade your browser</iframe>
</div>
<p>&nbsp;</p>
<p><strong>Total hours training Muay Thai by Month</strong><br />
<div class="iframe-wrapper">
  <iframe src="http://mg00.mygraphs.com/philchen/boxing2.html" frameborder="0" style="height:400px;width:650px;">Please upgrade your browser</iframe>
</div>
<p>&nbsp;</p>
<p><strong>Total hours doing Yoga by Month</strong><br />
<div class="iframe-wrapper">
  <iframe src="http://mg00.mygraphs.com/philchen/yoga2.html" frameborder="0" style="height:400px;width:650px;">Please upgrade your browser</iframe>
</div>
<p>&nbsp;</p>
<p><strong>Mile splits for the Carlsbad Half Marathon each Year.</strong><br />
<div class="iframe-wrapper">
  <iframe src="http://mg00.mygraphs.com/philchen/carlsbad-half.html" frameborder="0" style="height:400px;width:650px;">Please upgrade your browser</iframe>
</div>
<p>&nbsp;</p>
<p><strong>Mile splits for the La Jolla Half Marathon each Year.</strong><br />
<div class="iframe-wrapper">
  <iframe src="http://mg00.mygraphs.com/philchen/lajolla-half.html" frameborder="0" style="height:400px;width:650px;">Please upgrade your browser</iframe>
</div>
<p>&nbsp;</p>
<p><strong>Mile splits for the AFC Half Marathon each Year.</strong><br />
<div class="iframe-wrapper">
  <iframe src="http://mg00.mygraphs.com/philchen/afc-half.html" frameborder="0" style="height:400px;width:650px;">Please upgrade your browser</iframe>
</div>
<p>&nbsp;</p>
<p><strong>Mile splits for the Carlsbad 5000 each Year.</strong><br />
<div class="iframe-wrapper">
  <iframe src="http://mg00.mygraphs.com/philchen/carlsbad-5000.html" frameborder="0" style="height:400px;width:650px;">Please upgrade your browser</iframe>
</div>
<p>&nbsp;</p>
<p><strong>Books read each Year by Month.</strong><br />
<div class="iframe-wrapper">
  <iframe src="http://mg00.mygraphs.com/philchen/books.html" frameborder="0" style="height:400px;width:650px;">Please upgrade your browser</iframe>
</div>
<p>&nbsp;</p>
<p>Graphs Powered by: <a href="http://www.mygraphs.com">mygraphs.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.philchen.com/2011/06/28/project-phil/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>50+ Million Objects Totaling 220+ Terabytes in Amazon Web Services S3 Cloud</title>
		<link>http://www.philchen.com/2011/06/27/50-million-objects-totaling-220-terabytes-in-amazon-s3-cloud</link>
		<comments>http://www.philchen.com/2011/06/27/50-million-objects-totaling-220-terabytes-in-amazon-s3-cloud#comments</comments>
		<pubDate>Mon, 27 Jun 2011 23:25:39 +0000</pubDate>
		<dc:creator>Phil Chen</dc:creator>
				<category><![CDATA[Cloud Computing]]></category>

		<guid isPermaLink="false">http://www.philchen.com/?p=746</guid>
		<description><![CDATA[As Director of Systems Engineering for VMIX, one of the best parts of my job is to share data for different technologies we use and have success with. One of the most interesting statistics we have is how many objects/files we store in Amazon Web Services S3. We at VMIX take pride in our hybrid [...]]]></description>
			<content:encoded><![CDATA[<p>As Director of Systems Engineering for <a href="http://www.vmix.com">VMIX</a>, one of the best parts of my job is to share data for different technologies we use and have success with.<br />
<span id="more-746"></span><br />
One of the most interesting statistics we have is how many objects/files we store in <a href="http://aws.amazon.com">Amazon Web Services S3</a>. We at VMIX take pride in our hybrid global cloud architecture which helps us scale to meet any demand. Below are graphs showing some of our growth in both number of files as well as total data month over month.</p>
<p>&nbsp;</p>
<p><strong>Total Terabytes of Storage in S3 by Month</strong><br />
<div class="iframe-wrapper">
  <iframe src="http://mg00.mygraphs.com/philchen/awscloudstorageterabytes.html" frameborder="0" style="height:400px;width:650px;">Please upgrade your browser</iframe>
</div>
<p>&nbsp;</p>
<p><strong>Total Number of Objects in S3 by Month in Millions</strong><br />
<div class="iframe-wrapper">
  <iframe src="http://mg00.mygraphs.com/philchen/awscloudstoragefiles.html" frameborder="0" style="height:400px;width:650px;">Please upgrade your browser</iframe>
</div>
<p>&nbsp;</p>
<p>In conclusion investing in creating a hybrid global cloud architecture was worth the engineering time invested. Given the amount of storage we handle monthly using cloud resources was a natural progression to meet the demand.</p>
<p>By architecting EC2 processing clusters and leveraging S3 storage we have been able to focus our energy on our products and services versus provisioning infrastructure hardware to meet scale. We now programmatically approach provisioning infrastructure in a more automated fashion allowing our services to perform more efficiently and elastically.</p>
<p>&nbsp;</p>
<p>Graphs Powered by: <a href="http://www.mygraphs.com">mygraphs.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.philchen.com/2011/06/27/50-million-objects-totaling-220-terabytes-in-amazon-s3-cloud/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Port Forward using netfilter/iptables</title>
		<link>http://www.philchen.com/2011/06/21/how-to-port-forward-using-netfilteriptables</link>
		<comments>http://www.philchen.com/2011/06/21/how-to-port-forward-using-netfilteriptables#comments</comments>
		<pubDate>Wed, 22 Jun 2011 05:31:51 +0000</pubDate>
		<dc:creator>Phil Chen</dc:creator>
				<category><![CDATA[DevOps]]></category>

		<guid isPermaLink="false">http://www.philchen.com/?p=730</guid>
		<description><![CDATA[This is a quick example of how to write a quick bash script to use iptables to configure netfilter for port forwarding purposes. This sometimes comes in handy if you need to forward a non standard service/port through a standard port, also a slew of other use cases. Below is an example bash script port [...]]]></description>
			<content:encoded><![CDATA[<p>This is a quick example of how to write a quick bash script to use iptables to configure netfilter for port forwarding purposes. This sometimes comes in handy if  you need to forward a non standard service/port through a standard port, also a slew of other use cases.<br />
<span id="more-730"></span><br />
Below is an example bash script port forwarding on eth0 for IP 10.40.30.123 destination tcp port 80 to tcp port 123 as well as tcp port 443 to tcp port 123</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>iptables <span style="color: #660033;">-F</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>iptables <span style="color: #660033;">-t</span> nat <span style="color: #660033;">-A</span> PREROUTING <span style="color: #660033;">-p</span> tcp <span style="color: #660033;">-i</span> eth0 <span style="color: #660033;">-d</span> 10.40.30.123 <span style="color: #660033;">--dport</span> <span style="color: #000000;">80</span> <span style="color: #660033;">-j</span> DNAT <span style="color: #660033;">--to</span> 10.40.30.123:<span style="color: #000000;">123</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>iptables <span style="color: #660033;">-t</span> nat <span style="color: #660033;">-A</span> PREROUTING <span style="color: #660033;">-p</span> tcp <span style="color: #660033;">-i</span> eth0 <span style="color: #660033;">-d</span> 10.40.30.123 <span style="color: #660033;">--dport</span> <span style="color: #000000;">443</span> <span style="color: #660033;">-j</span> DNAT <span style="color: #660033;">--to</span> 10.40.30.123:<span style="color: #000000;">123</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>iptables <span style="color: #660033;">-A</span> FORWARD <span style="color: #660033;">-p</span> tcp <span style="color: #660033;">-i</span> eth0 <span style="color: #660033;">-d</span> 10.40.30.123 <span style="color: #660033;">--dport</span> <span style="color: #000000;">123</span> <span style="color: #660033;">-j</span> ACCEPT</pre></div></div>

<p>*Make sure the iptables service is started, then run the script</p>
<p>*Beware /sbin/iptables -F will flush your existing rules if you have any so make sure you run<br />
/sbin/iptables -L -v -n &#8211;line-numbers and see. If you have any rules add them to the script.</p>
<p>*If you are using a different src and dst IP you will want to enable ip forwarding:<br />
echo 1 > /proc/sys/net/ipv4/ip_forward</p>
]]></content:encoded>
			<wfw:commentRss>http://www.philchen.com/2011/06/21/how-to-port-forward-using-netfilteriptables/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title></title>
		<link>http://www.philchen.com/2011/06/21/701</link>
		<comments>http://www.philchen.com/2011/06/21/701#comments</comments>
		<pubDate>Wed, 22 Jun 2011 04:10:06 +0000</pubDate>
		<dc:creator>Phil Chen</dc:creator>
				<category><![CDATA[Notes]]></category>

		<guid isPermaLink="false">http://www.philchen.com/?p=701</guid>
		<description><![CDATA[So recently May 29, 2011 to be exact I got engaged to the perfect girl, Julia. I couldn&#8217;t be happier and feel pretty damn lucky to have found the right person. Life is good is all I gotz to say!]]></description>
			<content:encoded><![CDATA[<p>So recently May 29, 2011 to be exact I got engaged to the perfect girl, Julia. I couldn&#8217;t be happier and feel pretty damn lucky to have found the right person. Life is good is all I gotz to say!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.philchen.com/2011/06/21/701/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VMIX Leverages Amazon Web Services to Localize Video Processing in Europe and Asia</title>
		<link>http://www.philchen.com/2011/01/11/vmix-completes-rollout-of-local-video-storage-and-processing-in-europe-and-asia-using-amazon-web-services</link>
		<comments>http://www.philchen.com/2011/01/11/vmix-completes-rollout-of-local-video-storage-and-processing-in-europe-and-asia-using-amazon-web-services#comments</comments>
		<pubDate>Wed, 12 Jan 2011 03:54:57 +0000</pubDate>
		<dc:creator>Phil Chen</dc:creator>
				<category><![CDATA[Cloud Computing]]></category>

		<guid isPermaLink="false">http://www.philchen.com/?p=679</guid>
		<description><![CDATA[VMIX Completes Rollout of Local Video Storage and Processing in Europe and Asia Using Amazon Web Services SAN DIEGO&#8211;(BUSINESS WIRE)&#8211;VMIX (www.vmix.com), a leading carrier-class online video platform provider, today announced that it has completed rolling out localized video storage and processing for clients in Europe and Asia using Amazon Web Services. The deployment of services [...]]]></description>
			<content:encoded><![CDATA[<p><strong>VMIX Completes Rollout of Local Video Storage and Processing in Europe and Asia Using Amazon Web Services</strong></p>
<p>SAN DIEGO&#8211;(<a href="http://www.businesswire.com">BUSINESS WIRE</a>)&#8211;VMIX (www.vmix.com), a leading carrier-class online video platform provider, today announced that it has completed rolling out localized video storage and processing for clients in Europe and Asia using Amazon Web Services.<br />
<span id="more-679"></span><br />
The deployment of services supporting VMIX’s Platform-as-a-Service (PaaS) online-video solutions is designed to provide clients in North America, the European Union, and Asia with the highest quality and performance video processing and storage.</p>
<p>“We’re pleased that VMIX has chosen to leverage Amazon Web Services to build out a rapidly scalable online video platform that meets the needs of our joint customers across the globe,” said Terry Wise, Director of Business Development, Amazon Web Services LLC. “AWS enables organizations of all sizes to instantly acquire compute power, storage and other on-demand services in the cloud, enabling businesses to move quickly and innovate faster while paying only for the resources consumed.”</p>
<p>VMIX has been using Amazon Web Services for its US-based storage since early 2008. Since then, VMIX has scaled to utilize over 100 Terabytes of storage and manage more than 22 million objects in Amazon Simple Storage Service (Amazon S3).</p>
<p>“The scalability that AWS provides made us confident that we could extend global services in the cloud, and that AWS would be there to assist us,” said Phil Chen, Director of Systems Engineering at VMIX. “As we planned this new deployment, the AWS team offered technical guidance, along with design and operational best practices, every step of the way.”</p>
<p>Chen noted that in just 60 days, VMIX was able to scale out and build a globally distributed architecture utilizing Amazon Elastic Compute Cloud (Amazon EC2), Amazon Elastic Load Balancing and Amazon Relational Database Services. “Now that the origin of video delivery is available in Europe and Asia, our global clients can benefit from faster upload and encode services,” said Chen. He affirmed that the extension to Amazon Web Services has multiplied the capacity and performance of the VMIX platform, with projections of a 4x increase in processing speed. He added that the company anticipates a significant savings in capital expenditures, along with reduced engineering and maintenance expenses.</p>
<p>“Our aim is to provide the best, most personalized online video services wherever our clients are located,” said Chen. “AWS makes it easy for us to do that—allowing us to roll out new services quickly and reliably, so that we can focus more on the business of video and less on infrastructure build out.”</p>
<p>About VMIX<br />
VMIX Media Inc., (www.vmix.com) is a leading provider of carrier-class online video and media management solutions. The company’s cloud-based Platform as a Service is designed with high-volume video producers in mind, powering top online publishers’ websites and mobile applications for media, entertainment and enterprise markets. Managing over 20 million videos and processing one million plus new videos a month, VMIX integrates seamlessly into its clients’ products and services.</p>
<p>###</p>
<p>For more information, contact:</p>
<p>Paula Brici<br />
Media/Analyst Relations for VMIX<br />
paula@vmix.com<br />
+1 949-677-6527</p>
]]></content:encoded>
			<wfw:commentRss>http://www.philchen.com/2011/01/11/vmix-completes-rollout-of-local-video-storage-and-processing-in-europe-and-asia-using-amazon-web-services/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title></title>
		<link>http://www.philchen.com/2010/07/22/670</link>
		<comments>http://www.philchen.com/2010/07/22/670#comments</comments>
		<pubDate>Fri, 23 Jul 2010 03:36:06 +0000</pubDate>
		<dc:creator>Phil Chen</dc:creator>
				<category><![CDATA[Notes]]></category>

		<guid isPermaLink="false">http://www.philchen.com/?p=670</guid>
		<description><![CDATA[I have been training for America&#8217;s Finest City Half Marathon and running about 15-17 miles a week with some hiking in between. I sure hope I am ready, the last and only other half marathon I ran was the Carlsbad Half Marathon. As usual first goal is to finish, second is to clock in at [...]]]></description>
			<content:encoded><![CDATA[<p>I have been training for <a href="http://www.afchalf.com" target="_blank">America&#8217;s Finest City Half Marathon</a> and running about 15-17 miles a week with some hiking in between. I sure hope I am ready, the last and only other half marathon I ran was the <a href="http://www.carlsbadmarathon.com" target="_blank">Carlsbad Half Marathon</a>. As usual first goal is to finish, second is to clock in at a decent time!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.philchen.com/2010/07/22/670/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

