Top Banner
© 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified, or distributed in whole or in part without the express consent of Amazon.com, Inc. November 12, 2014 | Las Vegas SDD302 A Tale of One Thousand Instances - Migrating from EC2-Classic to EC2-VPC Donald Sumbry, Twilio Jonas Borjesson, Twilio
42

(SDD302) A Tale of One Thousand Instances - Migrating from Amazon EC2-Classic to VPC | AWS re:Invent 2014

Jul 01, 2015

Download

Technology

In this session, you learn why Twilio chose to migrate from Amazon EC2-Classic to VPC and how they leveraged features available only in VPC, specifically:
- AWS CloudHSM: Build out a secure key encryption or role-based access control for internal use; also used to securely store and encrypt data for external customers.- Elastic Network Interface (ENI): Allows multiple Elastic IPs per instance and the ability to move network interface between instances.- Hardware Virtual Machine (HVM) instances w/SRV-IO: New hardware virtualized instances that allow line-level performance of network interfaces for up to 10g Ethernet speeds. Secure data-in-transit by default, which ensures all machines communicate via a software-defined network and work in the same manner as VLAN tagging for compliance reasons. Sponsored by Twilio.
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: (SDD302) A Tale of One Thousand Instances - Migrating from Amazon EC2-Classic to VPC | AWS re:Invent 2014

© 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified, or distributed in whole or in part without the express consent of Amazon.com, Inc.

November 12, 2014 | Las Vegas

SDD302

A Tale of One Thousand Instances - Migrating from

EC2-Classic to EC2-VPC

Donald Sumbry, Twilio

Jonas Borjesson, Twilio

Page 2: (SDD302) A Tale of One Thousand Instances - Migrating from Amazon EC2-Classic to VPC | AWS re:Invent 2014

Hi, I’m Jonas

@borjessonjonasTech Lead of the SIP Connectivity team at Twilio

Page 3: (SDD302) A Tale of One Thousand Instances - Migrating from Amazon EC2-Classic to VPC | AWS re:Invent 2014

Hi, I’m Sumbry

@sumbryDirector of Cloud Services at Twilio

Page 4: (SDD302) A Tale of One Thousand Instances - Migrating from Amazon EC2-Classic to VPC | AWS re:Invent 2014

Background

Page 5: (SDD302) A Tale of One Thousand Instances - Migrating from Amazon EC2-Classic to VPC | AWS re:Invent 2014

We provide a communications API that enables

phones, VoIP, and messaging to be embedded into

web, desktop, and mobile software.

twilio

Page 6: (SDD302) A Tale of One Thousand Instances - Migrating from Amazon EC2-Classic to VPC | AWS re:Invent 2014

twilio

Page 7: (SDD302) A Tale of One Thousand Instances - Migrating from Amazon EC2-Classic to VPC | AWS re:Invent 2014

How does it work?

A user calls your

number

Twilio receives the call Your app responds

Page 8: (SDD302) A Tale of One Thousand Instances - Migrating from Amazon EC2-Classic to VPC | AWS re:Invent 2014

twilio6 years ago, things were simple

• Few machines on EC2-Classic

• Single service - PSTN to HTTP

• US-based customers

• Single AWS region

Page 9: (SDD302) A Tale of One Thousand Instances - Migrating from Amazon EC2-Classic to VPC | AWS re:Invent 2014

ProcessingNode

SIP

RTP

ProcessingNode

ProcessingNode

Load

Balancer

Load

Balancer

Database

Page 10: (SDD302) A Tale of One Thousand Instances - Migrating from Amazon EC2-Classic to VPC | AWS re:Invent 2014

twilioNow, not so simple anymore

• Thousands of instances

• Many services

• Global customers

• Resources in every AWS region

Page 11: (SDD302) A Tale of One Thousand Instances - Migrating from Amazon EC2-Classic to VPC | AWS re:Invent 2014

SIP

RTP

Virginia

IrelandBrazil

Page 12: (SDD302) A Tale of One Thousand Instances - Migrating from Amazon EC2-Classic to VPC | AWS re:Invent 2014

SIP

RTP

Signalling

Page 13: (SDD302) A Tale of One Thousand Instances - Migrating from Amazon EC2-Classic to VPC | AWS re:Invent 2014

Issues

All regions completely separated

– Traffic has to go through known endpoints

• Un-necessary hops

• Complicates deployments

• More difficult to debug

• Easier to create routing bugs

Page 14: (SDD302) A Tale of One Thousand Instances - Migrating from Amazon EC2-Classic to VPC | AWS re:Invent 2014

Forcing us to…

• Open up firewalls

• Secure traffic between regions using our own “VPN”

• Traffic has to go through known endpoints

• Known endpoints assigned EIPs

Page 15: (SDD302) A Tale of One Thousand Instances - Migrating from Amazon EC2-Classic to VPC | AWS re:Invent 2014

Which means…

• Un-necessary hops

• Complicates deployments

• More difficult to debug

• Easier to introduce bugs

• Cannot deploy nodes behind EIPs without affecting

traffic

Page 16: (SDD302) A Tale of One Thousand Instances - Migrating from Amazon EC2-Classic to VPC | AWS re:Invent 2014

That translates to…

• Fewer deploys

• Riskier deploys

• Harder to nail down bugs

• Takes longer to get fixes out

• Less happy customers!

Page 17: (SDD302) A Tale of One Thousand Instances - Migrating from Amazon EC2-Classic to VPC | AWS re:Invent 2014

Why VPC?

Page 18: (SDD302) A Tale of One Thousand Instances - Migrating from Amazon EC2-Classic to VPC | AWS re:Invent 2014

“EC2 2.0” (aka EC2-VPC)

• Global routing tables

• Enhanced Networking with SR-IOV

• Elastic network interfaces

• Software defined network

• Hardware security manager

Twilio considers VPC an evolutionary step or upgrade of the Amazon EC2

platform.

Page 19: (SDD302) A Tale of One Thousand Instances - Migrating from Amazon EC2-Classic to VPC | AWS re:Invent 2014

Global routing tables• Per subnet or per VPC routing tables

• Route traffic to instances

• Tunnel traffic between regions

Routing traffic to instances enables the easy creation of things like load

balancers, tunnels, or even VPCs inside of VPCs.

Page 20: (SDD302) A Tale of One Thousand Instances - Migrating from Amazon EC2-Classic to VPC | AWS re:Invent 2014

HVM and SR-IOV• HVM images with Enhanced Networking

• PCI Express speeds to network adapter

• Low-latency access to network adapter

• Up to 10gb network speeds

Enhanced Networking with SR-IOV means fast performance even under

virtualized hardware.

Page 21: (SDD302) A Tale of One Thousand Instances - Migrating from Amazon EC2-Classic to VPC | AWS re:Invent 2014

Elastic network interfaces• Multiple EIPs and multiple private IPs

• Multiple ENIs per instance

• Security groups follow an ENI

• ENI has a MAC address

ENIs are more like network cards that you can move around and attach to

different instances.

Page 22: (SDD302) A Tale of One Thousand Instances - Migrating from Amazon EC2-Classic to VPC | AWS re:Invent 2014

Software defined network• Control over my instances’ routes

• Number my own network

• Network ACLs

• Data-in-transit protected by more than just a

security group

• Provision networks like virtual machines

Use of a software defined network solves the data-in-transit issue that many

certifications require.

Page 23: (SDD302) A Tale of One Thousand Instances - Migrating from Amazon EC2-Classic to VPC | AWS re:Invent 2014

Hardware security manager• Easily integrates with IAM policies

• Centralized management of keys and certificates

• Easily and quickly encrypt customer data

Use of the HSM solves the data-at-rest issue that many certifications require.

Page 24: (SDD302) A Tale of One Thousand Instances - Migrating from Amazon EC2-Classic to VPC | AWS re:Invent 2014

Twilio Cloud Requirements

Page 25: (SDD302) A Tale of One Thousand Instances - Migrating from Amazon EC2-Classic to VPC | AWS re:Invent 2014

Twilio Cloud Requirements• Services can be deployed anywhere

• Services can communicate anywhere

• Services can be discovered anywhere

Solving the issue of global service discovery is easy once the underlying cloud

infrastructure is in place.

Page 26: (SDD302) A Tale of One Thousand Instances - Migrating from Amazon EC2-Classic to VPC | AWS re:Invent 2014

US1US2

BR1 AU1

JP1

SG1

IE1

DE1

Page 27: (SDD302) A Tale of One Thousand Instances - Migrating from Amazon EC2-Classic to VPC | AWS re:Invent 2014

EC2-VPC Building Blocks• Global routing tables

• HVM and SR-IOV

• Elastic Network Interfaces

• Software Defined Network

• Hardware Security Manager

Page 28: (SDD302) A Tale of One Thousand Instances - Migrating from Amazon EC2-Classic to VPC | AWS re:Invent 2014

Region-to-region connectivity

Performing routing among multiple VPCs in different regions is a bit more

complicated and necessitates the use of a routing protocol.

router router

us-east-1 / 10.1.0.0 us-west-2 / 10.2.0.0

vpc-abcdef vpc-zyxwv

IPSEC tunnelhosthosthosthost

Page 29: (SDD302) A Tale of One Thousand Instances - Migrating from Amazon EC2-Classic to VPC | AWS re:Invent 2014

US1US2

BR1 AU1

JP1

SG1

IE1

DE1

Page 30: (SDD302) A Tale of One Thousand Instances - Migrating from Amazon EC2-Classic to VPC | AWS re:Invent 2014

VPC-enabled infrastructure

Page 31: (SDD302) A Tale of One Thousand Instances - Migrating from Amazon EC2-Classic to VPC | AWS re:Invent 2014

SIP

RTP

Virginia

IrelandBrazil

Page 32: (SDD302) A Tale of One Thousand Instances - Migrating from Amazon EC2-Classic to VPC | AWS re:Invent 2014

Which may look insignificant, but...

• A single global network

– Global service discovery

• Much easier call flow

– Easier to debug

– Less risk to deploy

– More frequent deploys

– Call setup latency down 25%

• Less infrastructure and complexity

Page 33: (SDD302) A Tale of One Thousand Instances - Migrating from Amazon EC2-Classic to VPC | AWS re:Invent 2014

Also…

• Blocking firewall rules

– Important for stopping attacks

• ENI

– Aid us in deploying new edge services

– Improved network performance

– Better audio quality

Page 34: (SDD302) A Tale of One Thousand Instances - Migrating from Amazon EC2-Classic to VPC | AWS re:Invent 2014

Happier customers!

Page 35: (SDD302) A Tale of One Thousand Instances - Migrating from Amazon EC2-Classic to VPC | AWS re:Invent 2014

Migrating from EC2-Classic to

EC2-VPC

Page 36: (SDD302) A Tale of One Thousand Instances - Migrating from Amazon EC2-Classic to VPC | AWS re:Invent 2014

Migration Requirements• Equivalent to moving a datacenter

– Zero downtime

– Bridge traffic between services in a region

– Easily discover services in EC2-Classic or

EC2-VPC

Page 37: (SDD302) A Tale of One Thousand Instances - Migrating from Amazon EC2-Classic to VPC | AWS re:Invent 2014

Peering vs bridging

Peering is two VPCs talking in different regions.

Bridging is EC2-Classic and EC2-VPC in the same account talking in the same region.

vpc-bbb

vpc-aaa

vpc-aaa

classicus-east-1

us-west-2us-east-1

Page 38: (SDD302) A Tale of One Thousand Instances - Migrating from Amazon EC2-Classic to VPC | AWS re:Invent 2014

Migrating from EC2-Classic to EC2-VPC

• Use IP Tunnel Manager for bridging traffic

• Use software routers for peering traffic

• Use Service Discovery for discovering new

services as they move

Make sure any services you want to move from EC2-Classic to EC2-VPC

share the same AWS account and are in the same region!

Page 39: (SDD302) A Tale of One Thousand Instances - Migrating from Amazon EC2-Classic to VPC | AWS re:Invent 2014

Conclusion

Page 40: (SDD302) A Tale of One Thousand Instances - Migrating from Amazon EC2-Classic to VPC | AWS re:Invent 2014

• Services can be deployed globally

• Services can communicate globally

• Services can be discovered globally

• New VoIP infrastructure deployed in:

– all regions around the world

– taking live traffic for new products

– existing carrier traffic is being migrated

Where we are today

Page 41: (SDD302) A Tale of One Thousand Instances - Migrating from Amazon EC2-Classic to VPC | AWS re:Invent 2014

How could this have been easier?

• Feature to bridge EC2-Classic and EC2-VPC

• Feature to connect VPCs in different regions

Are you listening, AWS? Maybe. :-)

Page 42: (SDD302) A Tale of One Thousand Instances - Migrating from Amazon EC2-Classic to VPC | AWS re:Invent 2014

http://bit.ly/awsevals