Amazon EC2 Notes

Amazon Elastic Compute Cloud (EC2)

Instance Types

Vary by
  • CPU
  • Memory
  • Storage (size and type)
  • Network Performance (low,moderate,high)
organized
  • T - burstable performance
  • M - general purpose
  • C - compute optimized
  • R - memory
  • X - memory
  • I - storage
  • D - dense storage (48TB)
  • G - GPU (graphics)
enhanced networking - Single Root I/O Virtualization
  • more packets per second
  • lower latency
  • less jitter
  • c3,c4,d2,i2,m4,r3
  • need correct drivers
  • only on VPC instances

Amazon Machine Images (AMI)

initial software that will be on an instance
  • OS
  • state of patches
  • application or system software
Based on x86 OSs  Linux Windows Sources of AMIs
  • published by AWs
  • AWS marketplace
  • Existing Instances
  • uploaded virtual servers
Addressing an instance
  • dns name (based on ip - public or private)
  • Public ip
  • EIP - Elastic IP
Initial Access
  • initial access is setup by public key - key pairs
  • Windows  - AWS generates a random password and the client needs the private key to decrypt it
Virtual Firewall protection
  • Security groups
    • based on port protocol and source/destination
    • default deny
    • stateful
      • outgoing request is remembered so response is allowed without explicit inbound rule

Lifecycle

  • launching
    • bootstrapping
      • providing code to be run at launch
      • specified in UserData
    • VM Import/export
      • can import vm as an instance
      • instances launched within AWS from AMIs cannot be exported
    • Instance metadata
      • data about the instance
      • http://169.254.169.254/latest/meta-data/
Managing Instances
  • Tagging
    • name-value pairs
  • Monitoring Instances
  • Cloudwatch - monitoring and alerting
Modifying an Instance
  • instance type
  • security group
Termination Protections
  • can be enabled
  • termination fails until disabled
Options
  • Ondemand
    • most flexible
    • price per hour
  • Reserved
    • capacity reservations for predictable workloads
    • 75% savings
    • pricing
      • all upfront
      • partial upfront
      • no upfront
  • Spot
    • not time critical
    • tolerant of interruptions
    • specify price
    • runs until
      • termination
      • price goes above bid price
      • not enough  capacity to meet demand
Tenancy Options
  • shared instance
    • default
    • single host - hosts many AWS clients
  • dedicated instance
    • hardware dedicated to single customer
  • dedicated host
    • physical server fully dedicated to single customer
    • licensing considerations
Placement Groups
  • Logical grouping of instances in an availability zone
  • participate in low latency, 10 Gbps networks
  • instance must support enhanced networking and 10 Gbps network performance
Instance Stores
  • ephemeral storage
  • temporary block level storage
  • data lots when
    • disk fails
    • instance stops
    • instance terminates

Amazon Elastic Block  Storage (EBS)

  • automatically replicated within its availability zone
  • attached only to a single instance
  • types
    • Magnetic
      • 1GB - 1TB
      • data infrequently accessed
      • sequential reads
      • low cost required
      • billed on space provisioned
    • General Purpose SSD
      • 1GB - 16TB
      • 3 IOPS per GB provisioned with max at 10,000 IOPS
      • SSD under 1 TB can burst to 3000 IOPS
        • stores credits when under 1500 IOPS.
        • uses credits and can  burst to 3000 IOPS until credit runs  out
      • dev and test environments
      • billed on  space provisioned
    • Provisioned IOPS SSD
      • I/O intensive workloads
      • highest performance, and predictable
      • 4GB - 16TB
      • must choose how many IOPS
        • minimum = 30 X # GB
        • maximum = 20,000 IOPS
      • stripe multiple  volumes for larger size and performance
      • 10% of the provision IOPS performance 99.9% of the time in  a given year
      • price based on sized of provisioned space and provisioned IOPS
      • Critical business application
      • large DB workload
EBS Optimized
  • additional hourly rate applied
  • optimization or best performance
Protected data
  • Backup/Recovery (snapshots)
    • point in time
    • incremental
    • stored in S3 pay only for storage (cannot access through client S3)
    • created immediately
    • Creating a Volume  from a snapshot
      • to use a snapshot you have to create a volume from it
      • when creating, place in Availability zone where the volume is going to be used
      • creates it immediately
    • Recovering volumes
      • detach and reattach to another instance
    • Encryption Options
      • uses AWS Key Management Services
      • a new master key will be created
      • snapshots of encrypted volumes are encrypted
      • volumes created from encrypted snapshots are encrypted