Your SlideShare is downloading. ×

Intro to Cloud Computing and Amazon EC2


Published on

Find out what cloud computing is, why it's important, and how it can be used to build a highly scalable, cost-effective, agile infrastructure. …

Find out what cloud computing is, why it's important, and how it can be used to build a highly scalable, cost-effective, agile infrastructure.

Presented by Michael T. Conigliaro at the Frontier Developers Meetup in Boulder Colorado on 2010-09-09.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

No Downloads
Total Views
On Slideshare
From Embeds
Number of Embeds
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

No notes for slide


  • 1. Intro to Cloud Computing and Amazon EC2
    Michael T. Conigliaro
  • 2. The Old Days…
    Need many physical servers for redundancy & future growth
    One operating system per physical server
  • 3. What’s The Problem?
    • Hardware is expensive!
    • 4. And don’t forget the electric bill!
    • 5. Long lead time to procure new hardware (days? weeks?)
    • 6. Encourages overestimation of hardware needs
    • 7. Static infrastructure leads to underutilization
    • 8. According to some studies, the average server is only ~20% utilized!
    • 9. Application consolidation?
    • 10. Be careful not to “put all your eggs in one basket”
    • 11. Complicates upgrades
  • Static infrastructure is wasteful
  • 12. Enter Virtualization
    Many virtual “instances” per physical server
    More efficient utilization of hardware
    Rapid provisioning (measured in minutes or seconds!)
    Live migration of virtual instances between physical servers!
    Management API
  • 13. Problems with Virtualization
    Still need to purchase physical hardware
    Less wasteful, but infrastructure is still mostly static
    “Agile” instances require shared storage (SAN) which can be very expensive
    Note: These may not be problems for large enterprises or SMBs, but they certainly are for startups!
  • 14. Enter Cloud Computing
    Cloud computing is virtualization on someone else’s hardware
    Utility model - Pay only for what you’re using (per hour, GB, etc.)
    A management API for your entire infrastructure!
    Specific API features depend on your cloud provider
  • 15. Dynamic infrastructure creates less waste
  • 16. Why Amazon EC2?
    Very popular
    Very mature management tools and APIs
    Integration with other Amazon services
    S3 (simple online storage)
    CloudFront (content delivery network)
    Other nice features
    Elastic Block Storage
    Elastic Load Balancers
  • 17. Amazon EC2 Pricing (1/2)
    Not necessarily cheaper!
    Save money by reducing time to provision new servers
    APIs are an absolute must-have!
    Save money by reducing waste
    Make infrastructure follow your utilization curve
    Provision entire environments on demand, then terminate when not in use (e.g. testing)
  • 18. Amazon EC2 Pricing (2/2)
    On-demand Linux instances for US-East. Price/Month assumes running 24/7.
  • 19. Getting Started with Amazon EC2
    Create an account at
    Make note of your “access key id” and “secret access key”
    Used for REST-based requests (e.g. many UI-based tools)
    Create and download an X.509 certificate and private key
    Used for SOAP-based requests (e.g. the command line tools)
    Create an SSH key pair, and download the private key
    Used to connect to your instances via SSH
  • 20. Amazon EC2 Management Tools
    AWS Management Console
    Elasticfox extension for Firefox
    Amazon API tools (command line)
    “apt-get install ec2-api-tools”
    Language specific libraries
    Java, Ruby, Python, Etc.
    Too many to list!
  • 21. Amazon EC2 Dashboard
  • 22. Demo: EC2 Instance Lifecycle
    Launch instance
    • ec2-run-instances ami-2d4aa444 --instance-type m1.small --key ec2-keypair
    Describe instance
    ec2-describe-instances <instance_id>
    Connect to instance
    ssh -i /Users/mikec/projects/socialmedia/infrastructure/ec2-keypair.pem ubuntu@<address>
    Terminate instance
    ec2-terminate-instances <instance_id>
  • 23. Demo: Start “Staging” Environment on Demand
    Issue EC2 commands to start staging instances
    Wait a few minutes for instances to come up
    Interact with staging environment
    Issue EC2 commands to stop staging instances
  • 24. Amazon EC2 Concepts (1/5)
    New instances consist of two main things:
    Amazon Machine Image (AMI) usually provided by Amazon or the community:
    Operating system (Linux distro, version, etc.)
    Datacenter location (East/West coast, Europe, Asia, etc.)
    Instance “type”:
    Processor architecture (x86 or x86_64)
    Number of virtual CPUs (1 - 8)
    Amount of memory (600MB - 70GB)
    Amount of local disk storage (up to 1690GB)
    I/O performance (“low,” “moderate,” or “high”)
  • 25. Amazon EC2 Concepts (2/5)
    Data is ephemeral by default!
    Rebooting is harmless, but termination of an instance results in loss of all data on the disk!
    Solution: Elastic Block Store (EBS) volumes
    Create a new EBS volume
    Attach EBS volume to an instance
    When instance terminates, EBS volume is left behind
    Many AMIs now have EBS boot volumes!
    Allows instances to be “stopped”
    Highly recommended for critical and “long-running” instances
  • 26. Amazon EC2 Concepts (3/5)
    IP addresses are temporary and assigned randomly via DHCP!
    Solution 1: Elastic IPs
    Create a new elastic IP
    Assign it to an instance
    Instance can now be accessed reliably via the elastic IP address
    Solution 2: Dynamic DNS (e.g.
    Each instance updates its own public DNS records via an API
  • 27. Amazon EC2 Concepts (4/5)
    No way of knowing where your instances are physically located!
    Example: Launch two new instances at the same time. Will they end up running…
    On the same physical server?
    On different servers in the same rack?
    On different servers in different racks?
    Why does this matter? Latency-sensitive applications may not do well on EC2.
  • 28. Amazon EC2 Concepts (5/5)
    On-demand instance requests are not guaranteed to be fulfilled immediately, or even at all!
    EC2 quotas
    Insufficient EC2 capacity
    Solution: “Reserved instances”
    Pay for instances up front rather than by the hour
    Requires one-to-three year contract with Amazon
    1-year: save ~34%
    3-year: save ~49%
  • 29. Some Best Practices
    Use “security groups” to secure instances from each other
    Prevent unintentional termination of critical instances
    ec2-modify-instance-attribute --disable-api-termination true <instance id>
    Avoid “image sprawl”
    Start with one minimal “golden master image”
    Use a configuration management system to add “roles” as necessary (e.g. Web server, Database server, NFS server, etc.)
  • 30. What’s Next?
    Use a configuration management system
    Chef, Puppet, Cfengine, etc.
    “Infrastructure as Code”
    Automate your “bootstrap” process
    Plan for failure!
    Every EC2 instance is as likely to fail as any other
    Since failure cannot be prevented, have a good recovery plan
    Command and Control
    Capistrano, Fabric, etc.
  • 31. Example Chef Recipe
    package "apache" do
    package_name "apache2”
    action :install
    service "apache" do
    service_name "apache2"
    action [:enable, :start]
    template "apache2.conf" do
    source "apache2.conf.erb"
    path "/etc/apache2/apache2.conf"
    notifies :restart, resources(:service => ”apache")
  • 32. Summary
    Cloud Computing is virtualization on someone else’s hardware
    Cloud computing allows your infrastructure to be dynamic, and thus, less wasteful
    Cloud APIs promote automation and allow you to be more productive
    Configuration management systems allow you to treat your infrastructure as code
  • 33. More Information
    EC2 Getting Started Guide
    EC2 Developer Guide
    Chef wiki