Cooking on Gas: How to use Chef to get a better cloud deal Stephen - - PowerPoint PPT Presentation

cooking on gas how to use chef to get a better cloud deal
SMART_READER_LITE
LIVE PREVIEW

Cooking on Gas: How to use Chef to get a better cloud deal Stephen - - PowerPoint PPT Presentation

Cooking on Gas: How to use Chef to get a better cloud deal Stephen Nelson-Smith, CTO, Strategic Blue Wednesday, 6 March 13 ASK ME HARD QUESTIONS SEKRIT CODE: 6927 Wednesday, 6 March 13 Buying airline tickets the day you travel: NOT SMART


slide-1
SLIDE 1

Cooking on Gas: How to use Chef to get a better cloud deal

Stephen Nelson-Smith, CTO, Strategic Blue

Wednesday, 6 March 13

slide-2
SLIDE 2

ASK ME HARD QUESTIONS SEKRIT CODE: 6927

Wednesday, 6 March 13

slide-3
SLIDE 3

Buying airline tickets the day you travel: NOT SMART

Wednesday, 6 March 13

slide-4
SLIDE 4

Buying 3 years’ flights from one airline in advance: NOT SMART

Wednesday, 6 March 13

slide-5
SLIDE 5

Cloud pricing is anything but flexible

Wednesday, 6 March 13

slide-6
SLIDE 6

Integrating now… Coming soon…

Wednesday, 6 March 13

slide-7
SLIDE 7

Cloud Service

Payment

Supported Clouds Customers

Wednesday, 6 March 13

slide-8
SLIDE 8

Providers Users Pay now In US Dollars Long commitment Pay when I’m paid In Rupees Minimal commitment I N T E R M E D I A T E

Wednesday, 6 March 13

slide-9
SLIDE 9

How is that even possible?

Wednesday, 6 March 13

slide-10
SLIDE 10

By playing Tetris!

Wednesday, 6 March 13

slide-11
SLIDE 11

NOW NOW + 12 months Servers

Wednesday, 6 March 13

slide-12
SLIDE 12

NOW NOW + 12 months

Wednesday, 6 March 13

slide-13
SLIDE 13

NOW NOW + 12 months

Wednesday, 6 March 13

slide-14
SLIDE 14

NOW NOW + 12 months

Wednesday, 6 March 13

slide-15
SLIDE 15

NOW NOW + 12 months

Wednesday, 6 March 13

slide-16
SLIDE 16

NOW NOW + 12 months

Wednesday, 6 March 13

slide-17
SLIDE 17

NOW NOW + 12 months

Wednesday, 6 March 13

slide-18
SLIDE 18

Where there’s a hole, there’s money to be saved

Wednesday, 6 March 13

slide-19
SLIDE 19

This is how all commodity markets work

Wednesday, 6 March 13

slide-20
SLIDE 20

They help manage risk

Wednesday, 6 March 13

slide-21
SLIDE 21

how do you think power stations are funded?

Wednesday, 6 March 13

slide-22
SLIDE 22

Cloud computing has become a tradable commodity

Wednesday, 6 March 13

slide-23
SLIDE 23

What are the characteristics of a tradable commodity?

Wednesday, 6 March 13

slide-24
SLIDE 24

Surely cloud computing isn’t fungible?

Wednesday, 6 March 13

slide-25
SLIDE 25

What about coal?

Wednesday, 6 March 13

slide-26
SLIDE 26

OK OK OK - I’m not a CFO - get to the point

Wednesday, 6 March 13

slide-27
SLIDE 27

do you care which AZ you're in?

Wednesday, 6 March 13

slide-28
SLIDE 28

If the price were right, would you move zone?

Wednesday, 6 March 13

slide-29
SLIDE 29

Do you care which provider you use?

Wednesday, 6 March 13

slide-30
SLIDE 30

Would you move if the price were right?

Wednesday, 6 March 13

slide-31
SLIDE 31

if the answer to those questions is yes, you've demonstrated that cloud computing is a tradable commodity

Wednesday, 6 March 13

slide-32
SLIDE 32

if the answer to that is no, it's because you either feel moving is too hard

Wednesday, 6 March 13

slide-33
SLIDE 33

Just way too complicated?

Wednesday, 6 March 13

slide-34
SLIDE 34

Not really...

Wednesday, 6 March 13

slide-35
SLIDE 35

Too hard: we can fix that... hold your horses Current provider just too awesome?

Wednesday, 6 March 13

slide-36
SLIDE 36

Too awesome: ORLY? Mazda RX-7 Anyone? Nissan Skyline? At 2% of the price?

Wednesday, 6 March 13

slide-37
SLIDE 37

if you said yes when I asked: is there a point at which you'd be prepared to move AZ or Provider that applies also to time, and compute structure etc etc these are all "cloud options" So as a developer / technical architect... How can you ensure you have:

Wednesday, 6 March 13

slide-38
SLIDE 38

Think hard about using the add-on services

Wednesday, 6 March 13

slide-39
SLIDE 39

Build your infrastructure as code

Wednesday, 6 March 13

slide-40
SLIDE 40

LIVE DEMO!!!!!!!

Wednesday, 6 March 13

slide-41
SLIDE 41

LIVE DEMO!!!!!!! We currently have an application running in eu-west-1c

Wednesday, 6 March 13

slide-42
SLIDE 42

LIVE DEMO!!!!!!! http://qcon.cloudoptions.com/

Wednesday, 6 March 13

slide-43
SLIDE 43

LIVE DEMO!!!!!!! We’ve been told if we move it to eu-west-1a we’ll get a 50% discount

Wednesday, 6 March 13

slide-44
SLIDE 44

LIVE DEMO!!!!!!! knife ec2 server create \

  • -image ami-64636a10 \
  • -flavor m1.large \
  • -ssh-user ubuntu \
  • -identity-file ~/.ssh/qconeg.pem \
  • -availability-zone eu-west-1a \
  • -run-list 'recipe[qcon_demo]'

Wednesday, 6 March 13

slide-45
SLIDE 45

LIVE DEMO!!!!!!! <shiny_beads>DNS hack</shiny_beads>

Wednesday, 6 March 13

slide-46
SLIDE 46

LIVE DEMO!!!!!!! http://qcon.cloudoptions.com/

Wednesday, 6 March 13

slide-47
SLIDE 47

Wednesday, 6 March 13

slide-48
SLIDE 48

OK.... HOW!?

Wednesday, 6 March 13

slide-49
SLIDE 49

Trivial example Your infrastructure is a collection of resources:

  • Users
  • Packges
  • Configuration files
  • Mount points
  • Services
  • Registry keys
  • Calls to 3rd party APIs
  • Stuff!

Wednesday, 6 March 13

slide-50
SLIDE 50

knife ec2 server create -r qcon Acting in concert

Wednesday, 6 March 13

slide-51
SLIDE 51

wow - what just happened? To provide a service

Wednesday, 6 March 13

slide-52
SLIDE 52

wow - what just happened? Which evolves...

Wednesday, 6 March 13

slide-53
SLIDE 53

Configuration Management

http://www.flickr.com/photos/philliecasablanca/3354734116/

Wednesday, 6 March 13

slide-54
SLIDE 54

http://fm.cnbc.com/applications/cnbc.com/resources/img/editorial/2012/04/13/47040569-united-airline-tickets-200.240x160.jpg http://farm1.staticflickr.com/59/222795669_9be4eedda2_z.jpg http://farm5.staticflickr.com/4137/4882232023_45a387956e_z.jpg http://farm1.staticflickr.com/50/145836058_bc22808949_z.jpg http://farm9.staticflickr.com/8505/8482823234_f198cfa8e7_c.jpg http://www.flickr.com/photos/milletre/3054894492/ http://farm9.staticflickr.com/8313/8000068204_bd95bd7429_c.jpg http://farm4.staticflickr.com/3402/3422389888_fced0c78ac_z.jpg?zz=1 http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/images/rimarket-seller-accountinfo.png http://farm9.staticflickr.com/8106/8524974501_fa4e4b024d_m.jpg http://farm3.staticflickr.com/2519/3994862329_594937f5ab_m.jpg http://farm2.staticflickr.com/1134/771205331_b8a4abcc24_m.jpg http://farm4.staticflickr.com/3227/2646383085_0492f7594f_m.jpg http://farm4.staticflickr.com/3358/3591199563_5aeec53828_m.jpg http://farm4.staticflickr.com/3300/3218322177_39ab3e21ea_m.jpg http://farm8.staticflickr.com/7160/6839804377_f9ec7c5075_m.jpg http://www.energydigital.com/news_archive/carbon_trading_hero_0.jpeg http://25.media.tumblr.com/tumblr_m8z1nhW9SL1r0hqdro1_1280.png http://4.bp.blogspot.com/-oB1UZTPz7N4/UEZKlp62zPI/AAAAAAAABMw/AGlToD5FOes/s1600/cat.jpg http://www.flickr.com/photos/eclecticlibrarian/6910885384/ http://www.orange-insight.com/blog/wp-content/uploads/2012/12/find_x_here_it_is.jpg http://cdn.hdwallpaperspics.com/uploads/2012/11/img.jpg

Wednesday, 6 March 13

slide-55
SLIDE 55

http://fm.cnbc.com/applications/cnbc.com/resources/img/editorial/2012/04/13/47040569-united-airline-tickets-200.240x160.jpg http://farm1.staticflickr.com/59/222795669_9be4eedda2_z.jpg http://farm5.staticflickr.com/4137/4882232023_45a387956e_z.jpg http://farm1.staticflickr.com/50/145836058_bc22808949_z.jpg http://farm9.staticflickr.com/8505/8482823234_f198cfa8e7_c.jpg http://www.flickr.com/photos/milletre/3054894492/ http://farm9.staticflickr.com/8313/8000068204_bd95bd7429_c.jpg http://farm4.staticflickr.com/3402/3422389888_fced0c78ac_z.jpg?zz=1 http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/images/rimarket-seller-accountinfo.png http://farm9.staticflickr.com/8106/8524974501_fa4e4b024d_m.jpg http://farm3.staticflickr.com/2519/3994862329_594937f5ab_m.jpg http://farm2.staticflickr.com/1134/771205331_b8a4abcc24_m.jpg http://farm4.staticflickr.com/3227/2646383085_0492f7594f_m.jpg http://farm4.staticflickr.com/3358/3591199563_5aeec53828_m.jpg http://farm4.staticflickr.com/3300/3218322177_39ab3e21ea_m.jpg http://farm8.staticflickr.com/7160/6839804377_f9ec7c5075_m.jpg http://www.energydigital.com/news_archive/carbon_trading_hero_0.jpeg http://25.media.tumblr.com/tumblr_m8z1nhW9SL1r0hqdro1_1280.png http://4.bp.blogspot.com/-oB1UZTPz7N4/UEZKlp62zPI/AAAAAAAABMw/AGlToD5FOes/s1600/cat.jpg http://www.flickr.com/photos/eclecticlibrarian/6910885384/ http://www.orange-insight.com/blog/wp-content/uploads/2012/12/find_x_here_it_is.jpg http://cdn.hdwallpaperspics.com/uploads/2012/11/img.jpg

Write programs to... Generate config on the machine Reduce management complexity Version control your infrastructure

Wednesday, 6 March 13

slide-56
SLIDE 56

Declarative interface to resources

Wednesday, 6 March 13

slide-57
SLIDE 57

Reconstruct the business from source code repo, backup and bare metal

Wednesday, 6 March 13

slide-58
SLIDE 58

package "ntp" do action :install end template "/etc/ntpd.conf" do source "ntpd.conf.erb"

  • wner "root"

group "root" mode 0644 action :create variables(:time_server => “time.example.com”) notifies :restart, “service[ntpd]” end service "ntpd" do action [:enable,:start] end

Wednesday, 6 March 13

slide-59
SLIDE 59

package "net-snmp" do action :install end service "snmpd" do action [:enable,:start] end template "/etc/snmpd.conf" do source "snmpd.conf.erb"

  • wner "root"

group "root" mode 0644 action :create variables(:community_string => “not_public”) notifies :restart, “service[snmpd]” end

Wednesday, 6 March 13

slide-60
SLIDE 60

"memory": { "swap": { "cached": "0kB", "total": "4128760kB", "free": "4128760kB" }, "total": "2055676kB", "free": "1646524kB", "buffers": "35032kB", "cached": "210276kB", "active": "125336kB", "inactive": "142884kB", "dirty": "8kB", "writeback": "0kB", "anon_pages": "22976kB", "mapped": "8416kB", "slab": "121512kB", "slab_reclaimable": "41148kB", "slab_unreclaim": "80364kB", "page_tables": "1784kB", "nfs_unstable": "0kB", "bounce": "0kB", "commit_limit": "5156596kB", "committed_as": "74980kB", "vmalloc_total": "34359738367kB", "vmalloc_used": "274512kB", "vmalloc_chunk": "34359449936kB" },

"hostname": "server-1", "fqdn": "server-1.example.com", "domain": "example.com", "network": { "interfaces": { "eth0": { "type": "eth", "number": "0", "encapsulation": "Ethernet", "addresses": { "00:0C:29:43:26:C5": { "family": "lladdr" }, "192.168.177.138": { "family": "inet", "broadcast": "192.168.177.255", "netmask": "255.255.255.0" }, "fe80::20c:29ff:fe43:26c5": { "family": "inet6", "prefixlen": "64", "scope": "Link" } },

Wednesday, 6 March 13

slide-61
SLIDE 61

"memory": { "swap": { "cached": "0kB", "total": "4128760kB", "free": "4128760kB" }, "total": "2055676kB", "free": "1646524kB", "buffers": "35032kB", "cached": "210276kB", "active": "125336kB", "inactive": "142884kB", "dirty": "8kB", "writeback": "0kB", "anon_pages": "22976kB", "mapped": "8416kB", "slab": "121512kB", "slab_reclaimable": "41148kB", "slab_unreclaim": "80364kB", "page_tables": "1784kB", "nfs_unstable": "0kB", "bounce": "0kB", "commit_limit": "5156596kB", "committed_as": "74980kB", "vmalloc_total": "34359738367kB", "vmalloc_used": "274512kB", "vmalloc_chunk": "34359449936kB" },

"hostname": "server-1", "fqdn": "server-1.example.com", "domain": "example.com", "network": { "interfaces": { "eth0": { "type": "eth", "number": "0", "encapsulation": "Ethernet", "addresses": { "00:0C:29:43:26:C5": { "family": "lladdr" }, "192.168.177.138": { "family": "inet", "broadcast": "192.168.177.255", "netmask": "255.255.255.0" }, "fe80::20c:29ff:fe43:26c5": { "family": "inet6", "prefixlen": "64", "scope": "Link" } },

Wednesday, 6 March 13

slide-62
SLIDE 62

execute "load sysctl" do command "/sbin/sysctl -p" action :nothing end bytes = node[‘memory’][‘total’].split("kB")[0].to_i * 1024 / 3, pages = node[‘memory’][‘total’].split("kB")[0].to_i * 1024 / 3 / 2048 # adjust shared memory and semaphores template "/etc/sysctl.conf" do source "sysctl.conf.erb" variables( :shmmax_in_bytes => bytes, :shmall_in_pages => pages ) notifies :run, "execute[load sysctl]", :immediately end

Wednesday, 6 March 13

slide-63
SLIDE 63

Cookbooks and recipes

Wednesday, 6 March 13

slide-64
SLIDE 64

Server Server Server Server chef-server

API chef-client

recipe[ntp::client]

node

ntp

Simple architecture

Wednesday, 6 March 13

slide-65
SLIDE 65

Search!

Wednesday, 6 March 13

slide-66
SLIDE 66

pool_members = search("node","role:webserver”) template "/etc/haproxy/haproxy.cfg" do source "haproxy-app_lb.cfg.erb"

  • wner "root"

group "root" mode 0644 variables :pool_members => pool_members.uniq notifies :restart, "service[haproxy]" end

Wednesday, 6 March 13

slide-67
SLIDE 67

# Set up application listeners here. listen application 0.0.0.0:80 balance roundrobin <% @pool_members.each do |member| -%> server <%= member[:hostname] %> <%= member[:ipaddress] %>:> \ weight 1 maxconn 1 check <% end -%> <% if node["haproxy"]["enable_admin"] -%> listen admin 0.0.0.0:22002 mode http stats uri / <% end -%>

Wednesday, 6 March 13

slide-68
SLIDE 68

node.set[:munin][:server] = true munin_clients = search(:node, "munin_client:true")

cookbook_file "/etc/cron.d/munin" do source "munin-cron" mode "0644"

  • wner "root"

group "root" end

template "/etc/munin/munin.conf" do source "munin.conf.erb" mode 0644 variables(:munin_clients => munin_clients) end

Wednesday, 6 March 13

slide-69
SLIDE 69

node.set[:munin][:client] = true munin_servers = search(:node, "munin_server:true") unless munin_servers.empty? package "munin-node" do action :install end template "/etc/munin/munin-node.conf" do source "munin-node.conf.erb" mode 0644 variables :munin_servers => munin_servers notifies :restart, "service[munin-node]" end service "munin-node" do supports :restart => true action [ :enable, :start ] end end

Wednesday, 6 March 13

slide-70
SLIDE 70

knife ec2 server create -r “recipe[qcon]” knife azure server create -r “recipe[qcon]” knife rackspace server create -r “recipe[qcon]”

=

Wednesday, 6 March 13

slide-71
SLIDE 71

+

Wednesday, 6 March 13

slide-72
SLIDE 72

Wednesday, 6 March 13

slide-73
SLIDE 73

Stephen Nelson-Smith @LordCope stephen@strategic-blue.com http://www.cloudoptions.com

Wednesday, 6 March 13

slide-74
SLIDE 74

ASK ME HARD QUESTIONS (and did I rock?) SEKRIT CODE: 6927

Wednesday, 6 March 13