solve the cross-cloud conundrum with jclouds at gluecon 2013

77
with jclouds Solve the Cross- Cloud Conundrum Everett Toews Developer Advocate @everett_toews You need: JDK 1.6+ Maven 3+ Rackspace and/or HP cloud accounts Gluecon May 22, 2013 at 10:30 pm

Upload: everett-toews

Post on 08-May-2015

662 views

Category:

Business


3 download

TRANSCRIPT

Page 1: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

with jclouds

Solve the Cross-Cloud Conundrum

Everett Toews

Developer Advocate

@everett_toews

You need:

JDK 1.6+

Maven 3+

Rackspace and/or

HP cloud accounts

GlueconMay 22, 2013 at 10:30 pm

Page 2: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

2RACKSPACE® HOSTING | WWW.RACKSPACE.COM

Intro

Developer

Page 3: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

3RACKSPACE® HOSTING | WWW.RACKSPACE.COM

Committer on jclouds

Page 4: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

4RACKSPACE® HOSTING | WWW.RACKSPACE.COM

Intro

Advocate

Page 5: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

5RACKSPACE® HOSTING | WWW.RACKSPACE.COM

Intro

Page 6: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

6RACKSPACE® HOSTING | WWW.RACKSPACE.COM

Intro

Operations

Page 7: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

7RACKSPACE® HOSTING | WWW.RACKSPACE.COM

Co-author of The OpenStack Operation Guide

docs.openstack.org/ops

Page 8: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

8RACKSPACE® HOSTING | WWW.RACKSPACE.COM

Intro

In startup we are not allow dev team for talk to ops team except by API.

@DevOps_Borat

Page 9: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

9RACKSPACE® HOSTING | WWW.RACKSPACE.COM

Intro

rackspacecloudtrial.com

hpcloud.com/sign_up

Page 10: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

10RACKSPACE® HOSTING | WWW.RACKSPACE.COM

Agenda

Page 11: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

11RACKSPACE® HOSTING | WWW.RACKSPACE.COM

The Workshop

•Introduction•jclouds Overview•Cloud Accounts•Installation•Compute Example•Next Steps•Wrap Up

Page 12: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

12RACKSPACE® HOSTING | WWW.RACKSPACE.COM

Introduction

Page 13: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

13RACKSPACE® HOSTING | WWW.RACKSPACE.COM

Rackspace

Page 14: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

14RACKSPACE® HOSTING | WWW.RACKSPACE.COM

The Cloud

Infrastructure

with an API

Page 15: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

15RACKSPACE® HOSTING | WWW.RACKSPACE.COM

SDK Deployment

YourSystem

SDK

CloudAP I

VMVM

VM

UserSystem

Page 16: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

16RACKSPACE® HOSTING | WWW.RACKSPACE.COM

SDK Deployment

API

Cloud

YourSystem

SDK

UserSystem

VMVM

VMVM

Page 17: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

17RACKSPACE® HOSTING | WWW.RACKSPACE.COM

Introduction to jclouds

Page 18: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

18RACKSPACE® HOSTING | WWW.RACKSPACE.COM

jclouds

• Cross-cloud toolkit

• Open Source (Apache v2)

• Community

• Portable APIs

• Ecosystem APIs

• Provider APIs

• Java

Page 19: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

19RACKSPACE® HOSTING | WWW.RACKSPACE.COM

jclouds’ Supported Clouds

•Compute• Rackspace Cloud Servers

• HP Cloud Compute• AWS EC2• ElasticHosts• GoGrid• All Clouds

•Storage• Rackspace Cloud Files

• HP Cloud Storage• AWS S3• Azure• CloudOne• All Clouds

Page 20: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

20RACKSPACE® HOSTING | WWW.RACKSPACE.COM

jclouds Community

Page 21: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

21RACKSPACE® HOSTING | WWW.RACKSPACE.COM

jclouds Compute Layers (APIs)•ComputeService• OpenStack• Rackspace• HP, AWS, etc.

•NovaApi (*Api)• OpenStack• Rackspace• HP

Portable

Ecosystem

Page 22: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

22RACKSPACE® HOSTING | WWW.RACKSPACE.COM

jclouds Compute Venn (APIs)

Portable

Ecosystem

Page 23: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

23RACKSPACE® HOSTING | WWW.RACKSPACE.COM

jclouds Storage Layers (APIs)•BlobStore• OpenStack• Rackspace• HP, AWS, etc.

•SwiftApi• OpenStack• Rackspace• HP

•CloudFilesClient• Rackspace

Portable

Ecosystem

Provider

Page 24: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

24RACKSPACE® HOSTING | WWW.RACKSPACE.COM

jclouds Storage Venn (APIs)

Portable

Ecosystem

Provider

Page 25: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

25RACKSPACE® HOSTING | WWW.RACKSPACE.COM

jclouds Community

After 3 beer I can able use any of cloud API.

@DevOps_Borat

Page 26: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

26RACKSPACE® HOSTING | WWW.RACKSPACE.COM

What Can jclouds Do For You Today?

Page 27: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

27RACKSPACE® HOSTING | WWW.RACKSPACE.COM

SDKs

Plumbing

Page 28: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

28RACKSPACE® HOSTING | WWW.RACKSPACE.COM

SDKs

(Re)Authentication

Page 29: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

29RACKSPACE® HOSTING | WWW.RACKSPACE.COM

SDKs

Pagination

Page 30: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

30RACKSPACE® HOSTING | WWW.RACKSPACE.COM

SDKs

State Polling

Page 31: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

31RACKSPACE® HOSTING | WWW.RACKSPACE.COM

SDKs

Rate Limiting

Page 32: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

32RACKSPACE® HOSTING | WWW.RACKSPACE.COM

SDKs

Retry

Page 33: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

33RACKSPACE® HOSTING | WWW.RACKSPACE.COM

SDKs

Smoothing

Rough Edges

Page 34: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

34RACKSPACE® HOSTING | WWW.RACKSPACE.COM

SDKs

Open Source

Page 35: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

35RACKSPACE® HOSTING | WWW.RACKSPACE.COM

SDKs

In devops nobody is get fire for buy open source.

@DevOps_Borat

Page 36: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

36RACKSPACE® HOSTING | WWW.RACKSPACE.COM

SDKs

Community

Page 37: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

37RACKSPACE® HOSTING | WWW.RACKSPACE.COM

SDKs

Packaged

Page 38: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

38RACKSPACE® HOSTING | WWW.RACKSPACE.COM

SDKs

All-in-one

Page 39: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

39RACKSPACE® HOSTING | WWW.RACKSPACE.COM

SDKs

Extensions

Page 40: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

40RACKSPACE® HOSTING | WWW.RACKSPACE.COM

SDKs

No lock-in

Page 41: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

41RACKSPACE® HOSTING | WWW.RACKSPACE.COM

SDKs

OpenStack

Page 42: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

42RACKSPACE® HOSTING | WWW.RACKSPACE.COM

SDKs

Battle Tested Code

Page 43: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

43RACKSPACE® HOSTING | WWW.RACKSPACE.COM

SDKs

Sample Code

Page 44: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

44RACKSPACE® HOSTING | WWW.RACKSPACE.COM

SDKs

Documentation

Page 45: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

45RACKSPACE® HOSTING | WWW.RACKSPACE.COM

SDKs

Support

Page 46: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

46RACKSPACE® HOSTING | WWW.RACKSPACE.COM

SDKs

Survey is show junior devops are still believe in Tooth Fairy, Santa Claus and documentation. @DevOps_Borat

Page 47: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

47RACKSPACE® HOSTING | WWW.RACKSPACE.COM

Code

Page 48: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

48RACKSPACE® HOSTING | WWW.RACKSPACE.COM

Code

j.mp/jcldsglue2013

Page 49: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

49RACKSPACE® HOSTING | WWW.RACKSPACE.COM

Code

Zack Shoylev

Page 50: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

50RACKSPACE® HOSTING | WWW.RACKSPACE.COM

Cloud Accounts

Page 51: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

51RACKSPACE® HOSTING | WWW.RACKSPACE.COM

Rackspace

•BYOB?

•rackspacecloudtrial.com•mycloud.rackspace.com•Note: Username, Password

Page 52: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

52RACKSPACE® HOSTING | WWW.RACKSPACE.COM

HP

•hpcloud.com/sign_up•console.hpcloud.com/compute•Activate AZ1 and AZ2•Top right > View API Keys•Note: Tenant Name, Username, Password

Page 53: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

53RACKSPACE® HOSTING | WWW.RACKSPACE.COM

Terminology

Page 54: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

54RACKSPACE® HOSTING | WWW.RACKSPACE.COM

Terminology

jclouds Rackspace/OpenStack

Compute Cloud Servers/Nova

Node Server

Location Region

Hardware Flavor

NodeMetadata Server details

User Metadata Metadata

BlobStore Cloud Files/Swift

Blob File/Object

Page 55: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

55RACKSPACE® HOSTING | WWW.RACKSPACE.COM

Installation

Page 56: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

56RACKSPACE® HOSTING | WWW.RACKSPACE.COM

Maven

•mkdir jclouds-workshop•cd jclouds-workshop•Create pom.xml• gist.github.com/everett-toews/3861545

•mvn dependency:copy-dependencies "-DoutputDirectory=./lib"

Page 57: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

57RACKSPACE® HOSTING | WWW.RACKSPACE.COM

Ivy

•mkdir jclouds-workshop•cd jclouds-workshop•gist.github.com/everett-toews/5242573

Page 58: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

58RACKSPACE® HOSTING | WWW.RACKSPACE.COM

Compute Example

Page 60: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

60RACKSPACE® HOSTING | WWW.RACKSPACE.COM

Imports and Class•Create JCloudsWorkshop.java•gist.github.com/everett-toews/3861596• javac -cp ".:lib/*" JCloudsWorkshop.java

•Windows: Use ‘;’ for path separator•Note: Guice, Guava

Page 61: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

61RACKSPACE® HOSTING | WWW.RACKSPACE.COM

main() and skeleton•gist.github.com/everett-toews/3862453• javac -cp ".:lib/*" JCloudsWorkshop.java

Page 62: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

62RACKSPACE® HOSTING | WWW.RACKSPACE.COM

init()•gist.github.com/everett-toews/3862575• javac -cp ".:lib/*" JCloudsWorkshop.java•Note: Authentication

Page 63: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

63RACKSPACE® HOSTING | WWW.RACKSPACE.COM

createNodes()•gist.github.com/everett-toews/3862480• javac -cp ".:lib/*" JCloudsWorkshop.java

Page 64: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

64RACKSPACE® HOSTING | WWW.RACKSPACE.COM

configureAndStartWebservers()•gist.github.com/everett-toews/3862485• javac -cp ".:lib/*" JCloudsWorkshop.java•Note: Patterns

Page 65: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

65RACKSPACE® HOSTING | WWW.RACKSPACE.COM

JCloudsWorkshop.java

Number of cloud instance launch by ops team is direct proportional with LOC write by dev team.

@DevOps_Borat

Page 66: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

66RACKSPACE® HOSTING | WWW.RACKSPACE.COM

awaitSsh()•gist.github.com/everett-toews/3862516• javac -cp ".:lib/*" JCloudsWorkshop.java

Page 67: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

67RACKSPACE® HOSTING | WWW.RACKSPACE.COM

detectExtensions()•gist.github.com/everett-toews/3867123• javac -cp ".:lib/*" JCloudsWorkshop.java

Page 68: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

68RACKSPACE® HOSTING | WWW.RACKSPACE.COM

printResults()•gist.github.com/everett-toews/3862499• javac -cp ".:lib/*" JCloudsWorkshop.java

Page 69: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

69RACKSPACE® HOSTING | WWW.RACKSPACE.COM

deleteNodes() and close()•gist.github.com/everett-toews/3862504• javac -cp ".:lib/*" JCloudsWorkshop.java

Page 70: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

70RACKSPACE® HOSTING | WWW.RACKSPACE.COM

Run!• java -cp ".:lib/*" JCloudsWorkshop

Page 71: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

71RACKSPACE® HOSTING | WWW.RACKSPACE.COM

JCloudsWorkshop.java

Hello World in cloud is involve 1 load balancer, 3 web server and 2 database server.

@DevOps_Borat

Page 72: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

72RACKSPACE® HOSTING | WWW.RACKSPACE.COM

Potpourri

•Moved to Apache Software Foundation•groupId change

• 1.6.0: <groupId>org.jclouds.X</groupId>• 1.6.1: <groupId>org.apache.jclouds.X</groupId>

•Package change• 1.6.0: import org.jclouds• 1.7 (2.0?): import org.apache.jclouds

Page 73: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

73RACKSPACE® HOSTING | WWW.RACKSPACE.COM

Potpourri

•Command Line Interface•Jenkins Plugin•jclouds-chef

Page 74: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

74RACKSPACE® HOSTING | WWW.RACKSPACE.COM

Who Uses jclouds?

•CloudBees•Cloudify•EnterpriseDB•Pallet•Whirr•...•You?

Page 75: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

75RACKSPACE® HOSTING | WWW.RACKSPACE.COM

Next Steps

Page 77: Solve the Cross-Cloud Conundrum with jclouds at Gluecon 2013

Thank You

Everett Toews

Developer Advocate

@everett_toews

And don’t forget to terminate your VMs

developer.rackspace.com

j.mp/jcldsglue2013