EC2

Differences between revisions 1 and 17 (spanning 16 versions)
Revision 1 as of 2009-09-17 15:42:12
Size: 11175
Editor: c-76-112-233-201
Comment: Start this!
Revision 17 as of 2009-10-02 20:20:50
Size: 2095
Editor: c-76-112-233-201
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
<<Include(Testing/EC2/Header)>>
Line 7: Line 9:
Amazon has a per use billing system for their cloud, this offers some challenges since there's no simple way for us to just pay for EC2 usage and dole it out to testers. Here are some ways we could deal with this: You will be provided an account to use by Jorge via email, if you have any questions please contact JorgeCastro .
Line 9: Line 11:
 * User pays, Canonical Reimburses
   * The user just uses EC2, tests our images, and then asks Canonical for a reimbursement, like an expense.
   * Pros:
     * No credit card or account management needed on our end, if we want to cancel a tester we just tell them we won't pay for any more time and not reimburse.
     * User has motivation to ensure they don't leave instances running all night if they have to pay up front.
   * Cons:
     * Admin overhead for HR
     * User has to pay out of pocket upfront, could make people wary of signing up/helping.
== Getting Started ==
Line 18: Line 13:
 * One Canonical account shared by all testers (This idea is the worse one I think)
   * We make one ec2 account with a common login/password connected to the Canonical credit card.
   * Pros:
     * Easy to set up, no overhead for users.
   * Cons:
     * Anyone can just shutdown and create each other's instances.
     * No way to track who is doing what, so if one user spawns 50 instances and leaves them running we have no idea who is responsible.
     * Obvious security problem with the account credentials and CC.

 * Seperate Canonical-created accounts for each tester billed to Canonical.
   * Pros:
     * Low user barrier to entry.
     * Some semblance of user access control.
       
   * Cons:
     * Won't scale if we have to manage all these accounts.
     * User can change the password if they want so we can't really shut someone off if they are determined.

 * Ideas pursued but not possible:
   * Amazon gift cards sent to testers, can't use them for EC2. :(
   * Amazon DevPay, would work if we were "reselling" services to customers, no method to prevent testers from getting charged.
   * Asked amazon via a webform for help (Pending)
   * Phone support not available without signing up for Silver/Gold tech support.

 * Random things about EC2 that you should know:
   * Charges credit card at the end of the month, however you can monitor billing (about a 24 hour delay)
   * When experimenting with accounts and what charges what the lag between doing stuff and it showing up on the account activity is enough to make trying new methods a long process.

== Preparation ==

 * Go to this [[https://aws-portal.amazon.com/gp/aws/user/subscription/index.html?offeringCode=586AF539|Amazon URL]].
 * Click on the link mailed to you by Jorge.
Line 60: Line 25:
The images you need to use are available here: http://uec-images.ubuntu.com/releases/karmic/beta/
Line 65: Line 31:
Testers for the EC2 testing project should be members of the Launchpad team [[Ubuntu AMI Testers|https://edge.launchpad.net/~ubuntu-ami-testers]]. Testers for the EC2 testing project should be members of the Launchpad team [[https://launchpad.net/~ubuntu-ami-testers|Ubuntu AMI Testers]].
Line 67: Line 33:
Bugs will be reported in the [[Ubuntu AMI Testing project|https://edge.launchpad.net/ubuntu-ami-testing]]. The Server team will be responsible afterwards of reassigning the bugs to the correct project or Ubuntu package. Bugs will be reported in the [[https://launchpad.net/ubuntu-ami-testing|Ubuntu AMI Testing project|]]. The Server team will be responsible afterwards of reassigning the bugs to the correct project or Ubuntu package. Discussion should happen on the [[https://lists.ubuntu.com/mailman/listinfo/Ubuntu-ec2|ec2 mailing list]].
Line 71: Line 37:
QA team wants to build a tool for this: https://wiki.canonical.com/CoP/QA/ToolRequirements
However, the wiki will be used to record results because the tool isn't made yet.

== Smoke Tests ==

Smoke should be run before any other, to check for the sanity of the image.

##ec2-001
=== Register ===
'''Case ID: ''' ec2-001
 1. Register an instance of the image to test
 1. Expected results: the image exists and it can be registered.
{{{
$ ec2-describe-instances
}}}

##ec2-002
=== Root login ===
''' Case ID: ''' ec2-002
 1. Try to ssh the new instance as root
{{{
ssh -i /path/to/ec2-keypair.pem root@<external-host-name>
}}}
 1.#2 Expected results. The login is refused and you get the error message:
{{{
Please login as the ubuntu user rather than root user.
}}}

##ec2-003
=== Ubuntu login ===
''' Case ID: ''' ec2-003
 1. Try to ssh the new instance as the ubuntu user
{{{
ssh -i /path/to/ec2-keypair.pem ubuntu@<external-host-name>
}}}
 1.#2 Expected results:
  1. The login is accepted and you log into the new instance
  1. Password less sudo access is available for the ubuntu user:

{{{
$ sudo -l
User ubuntu may run the following commands on this host:
    (ALL) NOPASSWD:ALL
}}}


== Availability Regions ==

EC2 instances run in different data centres in two regions:

 * us-east-1 - East coast of the United States (probably near Washington, DC)
 * eu-west-1 - Western Europe (probably near Dublin, Ireland)

##ec2-004
=== Changing the default region ===
'''Case ID: ''' ec2-004
 1. Get a list of the available zones:
{{{
ec2-describe-availability-zones
}}}
 1.#2 Register an instance of the image to test, changing the zone using the {{{-z}}} parameter.
 1. Expected results:
  1. The image exists and it is registered in the selected zone.
  1. APT is setup to use the EC2 archive mirrors corresponding to the instance availability zone (eg. us zones use the us mirror) in /etc/apt/sources.list

== Rebundle ==

EC2 allows to rebundle a running EC2 instance into a new AMI, and use this new AMI to create new instances based on it.
 
##ec2-005
=== Small rebundle ===
'''Case ID: ''' ec2-005

 1. In your running instance, create a small text file in the $HOME folder called test.rebundle
 1. Rebundle the image following the instructions at [[http://alestic.com/2009/06/ec2-ami-bundle]]
 1. Create an instance using the newly created image and ssh to it.
 1. Expected results:
  1. The instance can be created and the test.rebundle is available in the $HOME folder.

##ec2-006
=== Big rebundle ===
'''Case ID: ''' ec2-006

[TBC] What kind of applications should be installed in this kind of test?

== User Data ==

##ec2-007
=== Basic User Data ===
'''Case ID: ''' ec2-007

[TBC] Create a user data script with a minimal test case for user data.

##ec2-008
=== Bind9 ===
'''Case ID: ''' SWI-008

[TBC] Create a user data script that installs and runs bind9

 1. Confirm that bind is running:
  * {{{
pgrep named}}} should return the pid of named.
 1. Confirm that bind is listening for IPv4 and IPv6:
  * {{{
sudo netstat -atuvpn | egrep '(127.0.0.1|::):53 .*' | egrep -v ESTABLISHED}}} should list named is listening on port 53 for tcp, tcp6, udp and udp6.
 1. If the system can access the outside world, dns queries against the server at localhost should work
  * {{{
host www.ubuntu.com localhost}}}
  * {{{
host -T www.ubuntu.com localhost}}}
  * {{{
host -6 www.ubuntu.com localhost}}}
  * {{{
host -T -6 www.ubuntu.com localhost}}}

##ec2-009
=== LAMP ===
'''Case ID: ''' ec2-009

[TBC] Create a user data script that installs and runs a LAMP stack

 1. '''Test Apache:'''
  * Execute {{{
w3m http://127.0.0.1/}}} in a terminal and verify that it's not a 404 error page.
 1. '''Test MySQL'''
  * Execute {{{
mysql -u root -p}}} in a terminal. You should then be presented with a mysql prompt {{{mysql> }}} where you can enter mysql commands. Some commands you can use to verify the installation are {{{show databases;}}}, {{{connect mysql;}}}, {{{show tables;}}}, and {{{select * from user;}}}:
    {{{
show databases; connect mysql; show tables; select * from user;
}}}

##ec2-010
=== Mail server ===
'''Case ID: ''' ec2-010

[TBC] Create a user data script that installs and runs Postfix mail server


 1. Confirm that postfix is running:
  * {{{
telnet 127.0.0.1 25}}} should connect to postfix. Type "quit" to disconnect.
 1. Confirm that dovecot pop3 and imap servers are running:
  * {{{
sudo netstat -ltnp | grep dovecot}}} should list 4 dovecot instances (port 110, 143, 993 and 995).
 1. Send a test email:
  * {{{
echo foo | mail -s 'test' ${USER} }}}
  * Start {{{
mutt}}} - the test email should be in the inbox.

##ec2-011
=== Openssh server ===
'''Case ID: ''' ec2-011

[TBC] Create a user data script that installs and runs Openssh

 1. Confirm that sshd is running:
  * {{{
pgrep sshd}}} should return the pid of sshd.
  * If you can, try to connect to the server from a remote client.

##ec2-012
=== PostgreSQL Database Server ===
'''Case ID: ''' ec2-012

[TBC] Create a user data script that installs and runs PostgreSQL Database Server

 1. Check that the database is running:
 {{{
sudo -u postgres psql -l}}} should return a list of databases.
 1. Create a database user:
   {{{
sudo -u postgres createuser -DRS ${USER} }}} should create a user.
 1. Create a database:
   {{{
sudo -u postgres createdb -O ${USER} ${USER}_db}}} should create a database.
 1. Connect to the database:
   {{{
psql ${USER}_db}}} should start a psql shell connected to the database.

##ec2-013
=== Print server ===
'''Case ID: ''' ec2-013

[TBC] Create a user data script that installs and runs CUPS print server

 1. '''Test cups:'''
   * {{{
sudo /etc/init.d/cups status}}} should state the cupsd is running.

##ec2-014
=== Samba server ===
'''Case ID: ''' ec2-014

[TBC] Create a user data script that installs and runs Samba server

 1. Confirm that samba is running:
  * {{{pgrep smbd}}}, {{{pgrep nmbd}}}, {{{pgrep winbindd}}} should return the pid of the different processes:
  {{{
pgrep smbd; pgrep nmbd; pgrep winbindd
}}}

##ec2-015
=== Tomcat server ===
'''Case ID: ''' ec2-015

[TBC] Create a user data script that installs and runs Tomcat

 1. Confirm that Tomcat is running:
  * {{{
sudo netstat -ltnp | grep jsvc}}} should show a jsvc instance listening on port 8080.
 1. Confirm that Tomcat is working properly:
  * {{{
w3m http://127.0.0.1:8080}}} should bring up a "It works !" page
  * {{{
 w3m http://localhost:8080/examples/servlets/servlet/HelloWorldExample}}} should bring up a "Hello World!" page.
  * {{{
 w3m http://localhost:8080/examples/jsp/jsp2/el/basic-arithmetic.jsp}}} should bring a page containing basic arithmetics.
NB: w3m basics: moving cursor and hit <Enter> to follow links, <B> to come back to the previous page, <q> to quit
  

##endcases
The wiki will be used to [[Testing/EC2/Results|record results]]

Ubuntu EC2 Test Plan

EC2 is the Amazon Elastic Compute Cloud, providing scalable virtual private servers using Xen. Canonical provides Ubuntu AMIs (Amazon Machine Images). The aim of these test plan is to provide a comprehensive testing guide of the Ubuntu official images.

Payment

You will be provided an account to use by Jorge via email, if you have any questions please contact JorgeCastro .

Getting Started

  • Click on the link mailed to you by Jorge.
  • Click "Sign Up for Amazon EC2"
  • Read the AWS customer agreement, check the box, and click "Continue"
  • Select a payment method and fill out the information(we won't charge you), click "Continue"
  • Confirm your information and click "Complete Sign Up"
  • Confirmation page will say "Thank you for signing up for Amazon Elastic Compute Cloud." Click "Continue"
  • Click "Place Your Order"
  • On this page copy and save the Activation Key, you're done!
  • Make a cup of coffee (It takes a minute for your account to get into the system)
  • Go to the AWS Management Console and click "Sign into the AWS Management Console"

  • From here you can create and use the Ubuntu images, have alot of fun!

The images you need to use are available here: http://uec-images.ubuntu.com/releases/karmic/beta/

If you had never run an Ubuntu EC2 image, you should look to our starters' guide

Reporting bugs

Testers for the EC2 testing project should be members of the Launchpad team Ubuntu AMI Testers.

Bugs will be reported in the Ubuntu AMI Testing project. The Server team will be responsible afterwards of reassigning the bugs to the correct project or Ubuntu package. Discussion should happen on the ec2 mailing list.

Test Results

The wiki will be used to record results

Testing/EC2 (last edited 2009-10-02 20:20:50 by c-76-112-233-201)