<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Tech-Blog: Tag ec2</title>
    <link>/articles/tag/ec2</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>Mike Pierson's technology blog</description>
    <item>
      <title>On Bootstrapping Active Directory for EC2's Windows Images</title>
      <description>&lt;p&gt;Amazon's EC2 service now includes a number of &lt;a href='http://aws.amazon.com/windows/'&gt;Windows Server 2003 images&lt;/a&gt;, starting at $0.125 per hour.  These Microsoft sanctioned images are a great alternative to the &lt;a href='http://www.howtoforge.com/amazon_elastic_compute_cloud_qemu'&gt;QEMU shenanigans&lt;/a&gt; from the past.&lt;/p&gt;

&lt;p&gt;One of the advantages of Amazon's EC2 service is the ability to provision virtual machines via scripts, and without human interaction.  Here's a description of my approach to bringing an instance of Active Directory online via script.&lt;/p&gt;

&lt;p&gt;Prerequisites:&lt;/p&gt;
&lt;ul&gt;
 &lt;li&gt;Amazon EC2 account
 &lt;li&gt;command line RDP client (e.g. rdesktop)
 &lt;li&gt;dcpromo answer file (I found Daniel Petri's &lt;a href='http://www.petri.co.il/unattended_installation_of_active_directory.htm'&gt;article&lt;/a&gt; helpful)
&lt;/ul&gt;

&lt;p&gt;Your RDP client will need to support two features: file sharing, and remote script execution.  I've found the Mac RDP clients tough to use via script, but Ubuntu's &lt;i&gt;rdesktop&lt;/i&gt; works just fine in a VirtualBox VM.&lt;/p&gt;

&lt;h3&gt;Starting the Windows Server VM&lt;/h3&gt;
&lt;p&gt;Choose the &lt;a href='http://developer.amazonwebservices.com/connect/entry.jspa?externalID=1792&amp;categoryID=209'&gt;Basic Microsoft Windows Server 2003&lt;/a&gt; image or the &lt;a href='http://developer.amazonwebservices.com/connect/entry.jspa?externalID=1793&amp;categoryID=209'&gt;Basic Microsoft Windows Server 2003 with Authentication Services&lt;/a&gt; image; a small standard instance type should be sufficient.&lt;/p&gt;
&lt;p&gt;(The Firefox &lt;a href='http://sourceforge.net/projects/elasticfox/'&gt;elasticfox&lt;/a&gt; EC2 plugin makes it easy to manage windows instances.)&lt;/p&gt;

&lt;p&gt;Once your instance is online, you'll need the public DNS name and administrator password for the instance.&lt;/p&gt;

&lt;h3&gt;Installing Active Directory&lt;/h3&gt;

&lt;p&gt;Normally, AD is installed and configured by running &lt;i&gt;dcpromo&lt;/i&gt; and working through the  relevant dialog boxes.  Unattended installs are supported via the &lt;i&gt;/answer&lt;/i&gt; argument:&lt;/p&gt;
&lt;p&gt;
 &lt;pre&gt;
   C:&gt; dcpromo /answer:%path_to_answer_file%
 &lt;/pre&gt;
&lt;/p&gt;

&lt;p&gt;Running this command on an EC2 instance poses two challenges: how to run a windows command remotely from a script, and how to copy our &lt;i&gt;dcpromo&lt;/i&gt; answer file from our local host to EC2.   Fortunately RDP solves both problems.  Using rdesktop one can define a script to run on session startup, and a local folder to share with the remote host.&lt;/p&gt;
&lt;p&gt;Install Active Directory remotely using &lt;i&gt;rdesktop&lt;/i&gt; as follows:&lt;/p&gt;
 
&lt;p&gt;
 &lt;pre&gt;
   mpierson:$ rdesktop -r disk:share=/home/mpierson/winshare/ \
     -u Administrator -p &amp;lt;admin_password&amp;gt; \
     -s "dcpromo /answer:\\\\tsclient\\share\\dcpromo.install" \
     &amp;lt;windows_hostname&amp;gt;
 &lt;/pre&gt;
&lt;/p&gt;
&lt;p&gt;where &lt;i&gt;/home/mpierson/winshare/dcpromo.install&lt;/i&gt; is the local path of the &lt;i&gt;dcpromo&lt;/i&gt; answer file for your AD configuration.   (The RDP file share defined by the &lt;i&gt;-r&lt;/i&gt; argument will appear in the Windows host network share list with a host name of &lt;i&gt;tsclient&lt;/i&gt;.)&lt;/p&gt; 

&lt;p&gt;FWIW, here is an &lt;a href='http://qdvt1jwcv8mbupt2.tech-blog.s3.amazonaws.com/dcpromo.install'&gt;example&lt;/a&gt; answer file for &lt;i&gt;dcpromo&lt;/i&gt;.&lt;/p&gt;

&lt;h3&gt;Access Your AD Domain&lt;/h3&gt;

&lt;p&gt;Use &lt;i&gt;rdesktop&lt;/i&gt; to access your new AD domain as follows:&lt;/p&gt;
&lt;p&gt;
 &lt;pre&gt;
   mpierson:$ rdesktop 
     -u Administrator -p &amp;lt;admin_password&amp;gt; \
     -d &amp;lt;win_domain_name&amp;gt; \
     &amp;lt;windows_hostname&amp;gt;
 &lt;/pre&gt;
&lt;/p&gt;
&lt;p&gt;where &lt;i&gt;win_domain_name&lt;/i&gt; is the DomainNetBiosName defined in your &lt;i&gt;dcpromo&lt;/i&gt; answer file.&lt;/p&gt;


</description>
      <pubDate>Wed, 29 Apr 2009 09:09:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:c8b4eed4-c5e4-4d6a-a2f9-19898c874a0e</guid>
      <author>Mike</author>
      <link>/articles/2009/04/29/on-bootstrapping-active-directory-on-ec2s-windows-server-2003-image</link>
      <category>technology</category>
      <category>ec2</category>
      <category>windows</category>
      <category>activedirectory</category>
      <trackback:ping>/articles/trackback/464</trackback:ping>
    </item>
    <item>
      <title>On Bootstrapping Oracle's 10g XE EC2 Image</title>
      <description>&lt;p&gt;Oracle has made a &lt;a href='http://www.oracle.com/technology/tech/cloud/index.html'&gt;number of their products&lt;/a&gt; available for use on Amazon's &lt;a href='http://aws.amazon.com/ec2/'&gt;EC2&lt;/a&gt; service. Unfortunately, each instance of their 10g XE RDBMS image must be &lt;a href='http://www.oracle.com/technology/tech/cloud/demos/oracle_on_ec2_viewlet_swf.htm'&gt;configured manually&lt;/a&gt; via ssh before use.&lt;/p&gt;

&lt;p&gt;Turns out that the &lt;a href='http://developer.amazonwebservices.com/connect/entry.jspa?externalID=1720&amp;categoryID=205'&gt;10g XE&lt;/a&gt; image hijacks the bash profile script to force manual configuration.  If one was motivated to enable unattended configuration of the image, the bash profile script could be un-hijacked with scp:&lt;/p&gt;
&lt;p&gt;
 &lt;pre&gt;
  mpierson:$ scp -i EC2_KEY my-bash-profile.sh root@&amp;lt;EC2-HOST-NAME&amp;gt;:/root/.bash_profile
 &lt;/pre&gt;
&lt;/p&gt;

&lt;p&gt;BTW, the hijack script overwritten by &lt;i&gt;scp&lt;/i&gt; above is also a good starting point for an script that would bring the database online in an unattended scenario.  Here's what it does:&lt;/p&gt;
&lt;ol&gt;
 &lt;li&gt;force acceptance of Oracle EC2 license
 &lt;li&gt;force change to &lt;i&gt;oracle&lt;/i&gt; system user
 &lt;li&gt;set Oracle environment, including host name
 &lt;li&gt;force change to SYSTEM and SYS oracle db accounts
&lt;/ol&gt;


</description>
      <pubDate>Tue, 28 Apr 2009 12:37:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:03134ac4-cefe-4372-80e3-7f7739b95538</guid>
      <author>Mike</author>
      <link>/articles/2009/04/28/on-bootstrapping-oracles-10g-xe-ec2-image</link>
      <category>technology</category>
      <category>ec2</category>
      <category>oracle</category>
      <trackback:ping>/articles/trackback/463</trackback:ping>
    </item>
    <item>
      <title>Amazon EC2 Diary I</title>
      <description>&lt;p&gt;I've been an Amazon &lt;a href='http://aws.amazon.com/ec2/'&gt;EC2&lt;/a&gt; evangelist for the past couple of years.  The EC2 'cloud computing' service is an early entry in the on-demand hosting market, featuring practically unlimited computing resources (CPUs, storage and bandwidth) provisioned in real time via public APIs.&lt;/p&gt;

&lt;p&gt;With a tip of the hat to Tim's &lt;a href='http://www.tbray.org/ongoing/When/200x/2008/12/18/Android-Diary'&gt;Android diary&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;I suspect that my experiences are going to be shared by quite a few people in the not-too-distant future, so why not record them?&lt;/blockquote&gt;

&lt;p&gt;My experience with EC2 involves deployment of JES environments, typically for development and testing of &lt;a href='http://en.wikipedia.org/wiki/Identity_access_management'&gt;IAM&lt;/a&gt; applications.  In future posts I'll share my approach and some concrete examples of how I have leveraged EC2 to save time and money.&lt;/p&gt;

&lt;p&gt;For now, a short summary of the EC2 features that have provided value.&lt;/p&gt;

&lt;h3&gt;Per-Hour Billing&lt;/h3&gt;
&lt;p&gt;Most of us do not work 24 hrs per day seven days per week, so it makes not to pay for dedicated computing resources when developing applications.  The EC2 rates are reasonable relative to commercial hosting services, and I suspect an order of magnitude more economical than buying servers and deploying traditional virtual hosts.&lt;/p&gt;

&lt;h3&gt;Multi-OS Support&lt;/h3&gt;
&lt;p&gt;The EC2 service started with Linux OS support only, but has since added Solaris and Windows Server 2003.  I use all three.&lt;/p&gt;

&lt;h3&gt;Scriptable API&lt;/h3&gt;
&lt;p&gt;There are no online forms, or phone calls, or visits to Best Buy.  Provisioning of EC2 resources can be fully automated.  Use bash, Java, Perl, Ruby..., whatever.&lt;/p&gt;  

&lt;h3&gt;Community &amp; Tools&lt;/h3&gt;
&lt;p&gt;There are open source API libraries in your favourite language, commercial management utilities, a Firefox plugin available.  And of course there are many pre-built EC2 images available to the public.&lt;/p&gt;

</description>
      <pubDate>Wed, 07 Jan 2009 21:30:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:291e6873-4bb3-4db2-812a-182944ba84e0</guid>
      <author>Mike</author>
      <link>/articles/2009/01/07/amazon-ec2-diary-i</link>
      <category>technology</category>
      <category>amazon</category>
      <category>ec2</category>
      <trackback:ping>/articles/trackback/435</trackback:ping>
    </item>
  </channel>
</rss>

