Top Banner
Assembling an Open Source Tool Chain for the Hybrid Cloud Isaac Christoffersen Bit Herder & Cloud Wrangler @ichristo
45

OpenSource ToolChain for the Hybrid Cloud

Jul 15, 2015

Download

Internet

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: OpenSource ToolChain for the Hybrid Cloud

Assembling an Open Source Tool Chain for the Hybrid Cloud

Isaac Christoffersen Bit Herder & Cloud Wrangler

@ichristo

Page 2: OpenSource ToolChain for the Hybrid Cloud

Bit Herder, Cloud Wrangler

●  Geek,  Insomniac,  Tinkerer  

●  Wearer  of  Many  Hats  

●  Delivering  Open  Source  Solutions  for  10+  years  

●  Solution  Architect  at  Vizuri  

Page 3: OpenSource ToolChain for the Hybrid Cloud

Why  the  Hybrid  Cloud?  

Page 4: OpenSource ToolChain for the Hybrid Cloud

Our  App  is  going  to  change  the  world  as  we  know  it!  

“The  best  way  to  predict  the  future  is  to  invent  it”  -­‐-­‐  Ed  Catmull  

Page 5: OpenSource ToolChain for the Hybrid Cloud

Unleash the System Administrators!

source  -­‐  http://commons.wikimedia.org/wiki/  

Page 6: OpenSource ToolChain for the Hybrid Cloud

Word of Mouth Spreads. Popularity Rises.

Page 7: OpenSource ToolChain for the Hybrid Cloud

source  -­‐  http://commons.wikimedia.org/wiki/File:Ford_assembly_line_-­‐_1913.jpg  

More Sys Admins and a Little Automation

Page 8: OpenSource ToolChain for the Hybrid Cloud

SlashDot / Oprah / Twitter Effect ...

Page 9: OpenSource ToolChain for the Hybrid Cloud

We Need More DevOps!

Page 10: OpenSource ToolChain for the Hybrid Cloud

Your App Has Gone Global!

Page 11: OpenSource ToolChain for the Hybrid Cloud

All Hail the Fail Whale!

source  -­‐  http://www.whatisfailwhale.info/  

Page 12: OpenSource ToolChain for the Hybrid Cloud

But We Had DevOps?!

Page 13: OpenSource ToolChain for the Hybrid Cloud

source  -­‐  http://upload.wikimedia.org/wikipedia/commons/e/e0/Nagasakibomb.jpg  

Cloud Bursting?

Page 14: OpenSource ToolChain for the Hybrid Cloud

Assembling  the  Hybrid  Cloud  Tool  Chain  

Page 15: OpenSource ToolChain for the Hybrid Cloud
Page 16: OpenSource ToolChain for the Hybrid Cloud

Automatically create machine images for multiple platforms from a single blueprint

Page 17: OpenSource ToolChain for the Hybrid Cloud

AWS: AMIVMware: VMX + disks VirtualBox: OVF + disks DigitalOcean: Snapshots and many more … http://www.packer.io/docs/templates/builders.html

Page 18: OpenSource ToolChain for the Hybrid Cloud

BoxCutter (github.com/boxcutter) •  Build VirtualBox, VMWare, and Parallels Images •  Choose your desired CM tool (Puppet, Chef,

Ansible)

Bento (https://github.com/chef/bento) •  Used by Chef Release Team for Testing •  Chef specific Configuration Managment

Page 19: OpenSource ToolChain for the Hybrid Cloud

AutomationNo human interaction. Great for Continuous Integration / Deployment

StandardizationUse Puppet, Chef, Ansible, Bash to configure the image

RepeatabilityTemplate goes into version control Image creation knowledge is now in code Anyone can build / rebuild the base images

Page 20: OpenSource ToolChain for the Hybrid Cloud

EXAMPLECentOS Image in both AWS

& Digital Ocean

Page 21: OpenSource ToolChain for the Hybrid Cloud

{ "builders": [ { "type" "access_key" "secret_key" "region" "source_ami" "security_group_id" "instance_type" "ssh_username" "ssh_timeout" "ami_name"

}, …

: "amazon-ebs", : "{{user `aws_access_key`}}", : "{{user `aws_secret_key`}}", : "us-east-1", : "ami-8997afe0", : "sg-8f7e24e4", : "t1.micro", : "ec2-user", : "5m", : "centos-baseline {{timestamp}}"

Page 22: OpenSource ToolChain for the Hybrid Cloud

… {

"type" "api_key" "client_id" "image_id"

: "digitalocean", : "{{user `do_api_key`}}", : "{{user `do_client_id`}}", : "562354",

"snapshot_name" : "centos-baseline {{timestamp}}" } ] …

}

Page 23: OpenSource ToolChain for the Hybrid Cloud

$ packer validate base-image.json Template validated successfully. $ packer build base-image.json amazon-ebs output will be in this color. digitalocean output will be in this color. … ==> amazon-ebs: Deleting temporary keypair... Build 'amazon-ebs' finished. ==> digitalocean: Destroying droplet... ==> digitalocean: Deleting temporary ssh key... Build 'digitalocean' finished. ==> Builds finished. The artifacts of successful builds are: --> digitalocean: A snapshot was created: 'centos-baseline 1396457723' in region 'New York 1'

Page 24: OpenSource ToolChain for the Hybrid Cloud

EXAMPLEBoxCutter Provisioning of

Centos to VMWare

Page 25: OpenSource ToolChain for the Hybrid Cloud

Isaacs-MBP-2:centos-vm isaac$ make list Prepend 'vmware/', 'virtualbox/', or 'parallels/' to build only one target platform: make vmware/centos66 Targets: … centos66-desktop centos66-docker centos66-i386 centos66 centos70-desktop centos70-docker centos70 Isaacs-MBP-2:centos-vm isaac$

Page 26: OpenSource ToolChain for the Hybrid Cloud

isaac$ make vmware/centos70-docker rm -rf output-vmware-iso mkdir -p box/vmware packer build -only=vmware-iso -var 'cm=nocm’ -var 'headless=' -var 'update=' -var 'version=1.0.10' -var 'ssh_username=vagrant' -var 'ssh_password=vagrant' -var 'install_vagrant_key=true' -var "iso_url=http://mirrors.sonic.net/centos/7/isos/x86_64/CentOS-7-x86_64-DVD-1503-01.iso" centos70-docker.json vmware-iso output will be in this color. …

Page 27: OpenSource ToolChain for the Hybrid Cloud

… ==> vmware-iso: Downloading or copying ISO vmware-iso: Downloading or copying: http://mirrors.sonic.net/centos/7/isos/x86_64/CentOS-7-x86_64-DVD-1503-01.iso ==> vmware-iso: Creating floppy disk... vmware-iso: Copying: floppy/vmware9.compat_dcache.h.patch ==> vmware-iso: Creating virtual machine disk ==> vmware-iso: Building and writing VMX file ==> vmware-iso: Starting HTTP server on port 8597 ==> vmware-iso: Starting virtual machine... ==> vmware-iso: Waiting 10s for boot... ==> vmware-iso: Connecting to VM via VNC ==> vmware-iso: Typing the boot command over VNC... ==> vmware-iso: Waiting for SSH to become available.. …

Page 28: OpenSource ToolChain for the Hybrid Cloud

+

Page 29: OpenSource ToolChain for the Hybrid Cloud

Mature, stable, proven. Development since Jan 2010. Used by thousands of companies.

Page 30: OpenSource ToolChain for the Hybrid Cloud

Deploy to Multiple Providersvagrant up --provider=foo

AWS, DigitalOcean, HP Cloud, Joyent, KVM, libvirt, lxc, OpenStack, Rackspace, Vmware, VirtualBox

Page 31: OpenSource ToolChain for the Hybrid Cloud

Leverage your own Packer Images

•  Base image as starting point. •  Integrates with multiple

“provisioners” including Puppet, Chef, Ansible, Bash

Page 32: OpenSource ToolChain for the Hybrid Cloud

AutomationNo human interaction. Great for Continuous Integration / Deployment

StandardizationUse Puppet, Chef, Ansible, Bash to configure the image

RepeatabilityTemplate goes into version control Image creation knowledge is now in code Anyone can build / rebuild the base images

Page 33: OpenSource ToolChain for the Hybrid Cloud

Vagrant.configure("2") do |config| config.vm.box = "dummy" config.vm.box_url = "https://github.com/mitchellh/

vagrant-aws/raw/master/dummy.box"

config.vm.provider :aws do |aws, override| aws.access_key_id = "YOUR KEY" aws.secret_access_key = "YOUR SECRET KEY" aws.keypair_name = "KEYPAIR NAME” aws.ami

= ”ami-9baa9cf2” override.ssh.username = “ec2-user” override.ssh.forward_agent = true override.ssh.private_key_path = “YOUR PRIVATE KEY”

end

Page 34: OpenSource ToolChain for the Hybrid Cloud

EXAMPLEMultiple CentOS Images

created in AWS from base AMI

Page 35: OpenSource ToolChain for the Hybrid Cloud

$ vagrant up --provider=aws

Use `vagrant plugin` commands to manage plugins. This warning will be removed in the next version of Vagrant.

Bringing machine 'test-broker' up with 'aws' provider... Bringing machine 'test-node-01' up with 'aws' provider... Bringing machine 'test-node-02' up with 'aws' provider…

Page 36: OpenSource ToolChain for the Hybrid Cloud
Page 37: OpenSource ToolChain for the Hybrid Cloud

•  Configuration Management tool like Puppet, Chef, CFEngine

•  Quick to get started •  Builds on familiar tools •  Run commands over SSH. No

additional agents required

Page 38: OpenSource ToolChain for the Hybrid Cloud

… config.vm.provision :ansible do |ansible|

ansible.sudo = true ansible.playbook = "provisioning/ansible/playbook.yml” ansible.verbose = true

end

- hosts: all tasks: - name: ensure ntpd is at the latest version yum: pkg=ntp state=latest notify: - restart ntpd

handlers: - name: restart ntpd service: name=ntpd state=restarted

Page 39: OpenSource ToolChain for the Hybrid Cloud

EXAMPLEProvision a CentOS LAMP

Stack in AWS

Page 40: OpenSource ToolChain for the Hybrid Cloud

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| boxes.each do |box| config.vm.define box[:name], primary: box[:primary] do |config|

config.vm.box = "aws-centos" config.vm.box_url =

https://github.com/mitchellh/vagrant-aws/raw/master/dummy.box …

config.vm.provision :shell, :privileged => false, :inline => "sudo yum -y install screen"

config.vm.provision :ansible do |ansible|

ansible.sudo ansible.playbook

lamp.yml" ansible.verbose

end …

= true = "provisioning/ansible/playbook-

= true

Page 41: OpenSource ToolChain for the Hybrid Cloud

- name : Install LAMP Stack user: ec2-user hosts: all tasks: - name: Install mysql yum: name=mysql-server state=latest

- name: install httpd yum: name=httpd

-  name: Install php for mysql yum: name=$item with_items: - php - php-mysql - mysql-server

Page 42: OpenSource ToolChain for the Hybrid Cloud

Only  Scratching  the  Surface  

Page 43: OpenSource ToolChain for the Hybrid Cloud

So many categories, so little time …

● Cloud Management (Scalr, ManageIQ) ● Log Aggregation (ELK) ● Monitoring Tools (nagios, zenoss) ● Version Control (Git, Subversion) ● CI Servers (Jenkins, TravisCI) ● … and many more

Page 44: OpenSource ToolChain for the Hybrid Cloud

OSS DevOps Tools Ecosystem

Check  Out  -­‐  http://www.devopsbookmarks.com/  

Page 45: OpenSource ToolChain for the Hybrid Cloud

Thank You

Isaac Christoffersen www.vizuri.com [email protected] @ichristo

vagrantup.com packer.io ansible.com