openslava infrastructure automation patterns
DESCRIPTION
Antons talking about patterns of Infrastructure Automation in the OpenSlava conference. Bratislava, October 2013TRANSCRIPT
![Page 1: OpenSlava Infrastructure Automation Patterns](https://reader035.vdocuments.site/reader035/viewer/2022062404/554a3420b4c9051b578b547d/html5/thumbnails/1.jpg)
Organizers Top Media Partner Media Partner Supporter
Antons Kranga DevOps:Cloud Automation October 11, 2013
![Page 2: OpenSlava Infrastructure Automation Patterns](https://reader035.vdocuments.site/reader035/viewer/2022062404/554a3420b4c9051b578b547d/html5/thumbnails/2.jpg)
Presenter
- Technology Architect at Accenture
- 10+ years experience in Enterprise Development
- Projects: - Accenture Foundation Platform for Java - Accenture Cloud Platform
- ALPJ - Monsoon
![Page 4: OpenSlava Infrastructure Automation Patterns](https://reader035.vdocuments.site/reader035/viewer/2022062404/554a3420b4c9051b578b547d/html5/thumbnails/4.jpg)
Copyright © 2013 Accenture All rights reserved.
Cloud
![Page 5: OpenSlava Infrastructure Automation Patterns](https://reader035.vdocuments.site/reader035/viewer/2022062404/554a3420b4c9051b578b547d/html5/thumbnails/5.jpg)
This is cloud
![Page 6: OpenSlava Infrastructure Automation Patterns](https://reader035.vdocuments.site/reader035/viewer/2022062404/554a3420b4c9051b578b547d/html5/thumbnails/6.jpg)
Copyright © 2013 Accenture All rights reserved.
Definition of Cloud Computing
![Page 7: OpenSlava Infrastructure Automation Patterns](https://reader035.vdocuments.site/reader035/viewer/2022062404/554a3420b4c9051b578b547d/html5/thumbnails/7.jpg)
Copyright © 2013 Accenture All rights reserved.
Cloud Computing
![Page 8: OpenSlava Infrastructure Automation Patterns](https://reader035.vdocuments.site/reader035/viewer/2022062404/554a3420b4c9051b578b547d/html5/thumbnails/8.jpg)
Copyright © 2013 Accenture All rights reserved.
Accenture Cloud Platform
Testing as Service Monsoon ALPJ etc
Cloud Broker API
![Page 9: OpenSlava Infrastructure Automation Patterns](https://reader035.vdocuments.site/reader035/viewer/2022062404/554a3420b4c9051b578b547d/html5/thumbnails/9.jpg)
Copyright © 2012 Accenture All rights reserved.
Challenges of Cloud (What IaaS Offers)
Web Tier
Application Tier
Database
![Page 10: OpenSlava Infrastructure Automation Patterns](https://reader035.vdocuments.site/reader035/viewer/2022062404/554a3420b4c9051b578b547d/html5/thumbnails/10.jpg)
Copyright © 2012 Accenture All rights reserved.
Challenges of Cloud (What Users Want)
Web Tier
Application Tier
Database
![Page 11: OpenSlava Infrastructure Automation Patterns](https://reader035.vdocuments.site/reader035/viewer/2022062404/554a3420b4c9051b578b547d/html5/thumbnails/11.jpg)
Infrastructure services and patterns
![Page 12: OpenSlava Infrastructure Automation Patterns](https://reader035.vdocuments.site/reader035/viewer/2022062404/554a3420b4c9051b578b547d/html5/thumbnails/12.jpg)
example
![Page 13: OpenSlava Infrastructure Automation Patterns](https://reader035.vdocuments.site/reader035/viewer/2022062404/554a3420b4c9051b578b547d/html5/thumbnails/13.jpg)
include_recipe “java“ package "tomcat6“ artifact_deploy "tomcat6“ do version "latest“ artifact_location "foo.war" deploy_to node[:tomcat][:work_dir] end service "tomcat6" do action [:enable, :start] end
OS Type: RedHat OS Version: 6.2
Tomcat Home: /etc/tomcatTomcat Port: 8080
MySQL IP: 10.10.0.1 MySQL Root Password: password
RecipeAttributes
OS Specific Instructions
![Page 14: OpenSlava Infrastructure Automation Patterns](https://reader035.vdocuments.site/reader035/viewer/2022062404/554a3420b4c9051b578b547d/html5/thumbnails/14.jpg)
Copyright © 2012 Accenture All rights reserved.
Chef Workstation Virtualized Infrastructure
![Page 15: OpenSlava Infrastructure Automation Patterns](https://reader035.vdocuments.site/reader035/viewer/2022062404/554a3420b4c9051b578b547d/html5/thumbnails/15.jpg)
Copyright © 2012 Accenture All rights reserved.
Chef Workstation Virtualized Infrastructure
Chef Server
...Roles
Cookbooks
REST
CMDB
![Page 16: OpenSlava Infrastructure Automation Patterns](https://reader035.vdocuments.site/reader035/viewer/2022062404/554a3420b4c9051b578b547d/html5/thumbnails/16.jpg)
Copyright © 2012 Accenture All rights reserved.
Chef Workstation Virtualized Infrastructure
Chef Server
...Roles
Cookbooks
REST
CMDB
![Page 17: OpenSlava Infrastructure Automation Patterns](https://reader035.vdocuments.site/reader035/viewer/2022062404/554a3420b4c9051b578b547d/html5/thumbnails/17.jpg)
Copyright © 2012 Accenture All rights reserved.
Chef Workstation Virtualized Infrastructure
Chef Server
knife
...Roles
Cookbooks
REST
CMDB
Uses SSH tobootstraps Chef
client
![Page 18: OpenSlava Infrastructure Automation Patterns](https://reader035.vdocuments.site/reader035/viewer/2022062404/554a3420b4c9051b578b547d/html5/thumbnails/18.jpg)
Copyright © 2012 Accenture All rights reserved.
Chef Workstation Virtualized Infrastructure
Chef Server
knife
...Roles
Cookbooks
REST
CMDB
chef client
tomcat6
![Page 19: OpenSlava Infrastructure Automation Patterns](https://reader035.vdocuments.site/reader035/viewer/2022062404/554a3420b4c9051b578b547d/html5/thumbnails/19.jpg)
Chef Workstation Virtualized Infrastructure
Chef Server
knife
...Roles
Cookbooks
REST
CMDB
chef client
tomcat6
HTTP call signed with certificate
![Page 20: OpenSlava Infrastructure Automation Patterns](https://reader035.vdocuments.site/reader035/viewer/2022062404/554a3420b4c9051b578b547d/html5/thumbnails/20.jpg)
Chef Workstation Virtualized Infrastructure
Chef Server
knife
...Roles
Cookbooks
REST
CMDB
chef client
tomcat6
![Page 21: OpenSlava Infrastructure Automation Patterns](https://reader035.vdocuments.site/reader035/viewer/2022062404/554a3420b4c9051b578b547d/html5/thumbnails/21.jpg)
Copyright © 2012 Accenture All rights reserved.
Chef Workstation Virtualized Infrastructure
Chef Server
knife
...Roles
Cookbooks
REST
CMDB
chef client
tomcat6
tomca
t6
java
iptab
les
Cookbooks
![Page 22: OpenSlava Infrastructure Automation Patterns](https://reader035.vdocuments.site/reader035/viewer/2022062404/554a3420b4c9051b578b547d/html5/thumbnails/22.jpg)
Copyright © 2012 Accenture All rights reserved.
Chef Workstation Virtualized Infrastructure
Chef Server
knife
...Roles
Cookbooks
REST
CMDB
chef client
tomcat6
tomca
t6
java
iptab
les
Cookbooks
upload facts
ohai
![Page 23: OpenSlava Infrastructure Automation Patterns](https://reader035.vdocuments.site/reader035/viewer/2022062404/554a3420b4c9051b578b547d/html5/thumbnails/23.jpg)
Service discovery
![Page 24: OpenSlava Infrastructure Automation Patterns](https://reader035.vdocuments.site/reader035/viewer/2022062404/554a3420b4c9051b578b547d/html5/thumbnails/24.jpg)
Node 1 Node 2 Node 3 Node N
![Page 25: OpenSlava Infrastructure Automation Patterns](https://reader035.vdocuments.site/reader035/viewer/2022062404/554a3420b4c9051b578b547d/html5/thumbnails/25.jpg)
Node 1 Node 2 Node 3 Node N
Database
Register RegisterRegisterRegister
![Page 26: OpenSlava Infrastructure Automation Patterns](https://reader035.vdocuments.site/reader035/viewer/2022062404/554a3420b4c9051b578b547d/html5/thumbnails/26.jpg)
Node 1 Node 2 Node 3 Node N
Database
Register RegisterRegisterRegister
Discover nodes
![Page 27: OpenSlava Infrastructure Automation Patterns](https://reader035.vdocuments.site/reader035/viewer/2022062404/554a3420b4c9051b578b547d/html5/thumbnails/27.jpg)
Node 1 Node 2 Node 3 Node N
Database
Register RegisterRegisterRegister
Discover nodes
![Page 28: OpenSlava Infrastructure Automation Patterns](https://reader035.vdocuments.site/reader035/viewer/2022062404/554a3420b4c9051b578b547d/html5/thumbnails/28.jpg)
Load balancing
![Page 29: OpenSlava Infrastructure Automation Patterns](https://reader035.vdocuments.site/reader035/viewer/2022062404/554a3420b4c9051b578b547d/html5/thumbnails/29.jpg)
Node 1 Node 2 Node 3 Node N
LB
![Page 30: OpenSlava Infrastructure Automation Patterns](https://reader035.vdocuments.site/reader035/viewer/2022062404/554a3420b4c9051b578b547d/html5/thumbnails/30.jpg)
Node 1 Node 2 Node 3 Node N
LBSingle point of
failure
![Page 31: OpenSlava Infrastructure Automation Patterns](https://reader035.vdocuments.site/reader035/viewer/2022062404/554a3420b4c9051b578b547d/html5/thumbnails/31.jpg)
Node 1 Node 2 Node 3 Node N
LB LB2Heartbeat
![Page 32: OpenSlava Infrastructure Automation Patterns](https://reader035.vdocuments.site/reader035/viewer/2022062404/554a3420b4c9051b578b547d/html5/thumbnails/32.jpg)
Node 1 Node 2 Node 3 Node N
LB LB2Heartbeat
Shared virtual IP
![Page 33: OpenSlava Infrastructure Automation Patterns](https://reader035.vdocuments.site/reader035/viewer/2022062404/554a3420b4c9051b578b547d/html5/thumbnails/33.jpg)
Dealing with sticky sessions
![Page 34: OpenSlava Infrastructure Automation Patterns](https://reader035.vdocuments.site/reader035/viewer/2022062404/554a3420b4c9051b578b547d/html5/thumbnails/34.jpg)
Tomcat 1 Tomcat 2 Tomcat 3 Tomcat N
LB LB2Heartbeat
Shared virtual IP
![Page 35: OpenSlava Infrastructure Automation Patterns](https://reader035.vdocuments.site/reader035/viewer/2022062404/554a3420b4c9051b578b547d/html5/thumbnails/35.jpg)
Tomcat 1 Tomcat 2 Tomcat 3 Tomcat N
LB LB2Heartbeat
Shared virtual IP
Memcached 1 Memcached 2 Memcached 3 Memcached N
Save session Save session Save session Save session
Same ServerSame ServerSame ServerSame Server
![Page 36: OpenSlava Infrastructure Automation Patterns](https://reader035.vdocuments.site/reader035/viewer/2022062404/554a3420b4c9051b578b547d/html5/thumbnails/36.jpg)
Tomcat 1 Tomcat 2 Tomcat 3 Tomcat N
LB LB2Heartbeat
Shared virtual IP
Memcached 1 Memcached 2 Memcached 3 Memcached N
Save session Save session Save session Save session
Same ServerSame ServerSame ServerSame Server
Repl Repl Repl
![Page 37: OpenSlava Infrastructure Automation Patterns](https://reader035.vdocuments.site/reader035/viewer/2022062404/554a3420b4c9051b578b547d/html5/thumbnails/37.jpg)
Tomcat 1 Tomcat 2 Tomcat 3 Tomcat N
LB LB2Heartbeat
Shared virtual IP
Memcached 1 Memcached 2 Memcached 3 Memcached N
Save session Save session Save session Save session
Same ServerSame ServerSame ServerSame Server
Repl Repl Repl
If session repl not hitting netw capacity
![Page 38: OpenSlava Infrastructure Automation Patterns](https://reader035.vdocuments.site/reader035/viewer/2022062404/554a3420b4c9051b578b547d/html5/thumbnails/38.jpg)
Tomcat 1 Tomcat 2 Tomcat 3 Tomcat N
LB LB2Heartbeat
Shared virtual IP
Memcached
save session
Large RAM VM
![Page 39: OpenSlava Infrastructure Automation Patterns](https://reader035.vdocuments.site/reader035/viewer/2022062404/554a3420b4c9051b578b547d/html5/thumbnails/39.jpg)
Elasticity
![Page 40: OpenSlava Infrastructure Automation Patterns](https://reader035.vdocuments.site/reader035/viewer/2022062404/554a3420b4c9051b578b547d/html5/thumbnails/40.jpg)
Tomcat 1 Tomcat 2 Tomcat 3 Tomcat N
LB LB2Heartbeat
Shared virtual IP
Memcached 1 Memcached 2 Memcached 3 Memcached N
Save session Save session Save session Save session
Same ServerSame ServerSame ServerSame Server
Repl Repl Repl
![Page 41: OpenSlava Infrastructure Automation Patterns](https://reader035.vdocuments.site/reader035/viewer/2022062404/554a3420b4c9051b578b547d/html5/thumbnails/41.jpg)
Tomcat 1 Tomcat 2 Tomcat 3 Tomcat N
LB LB2Heartbeat
Shared virtual IP
Memcached 1 Memcached 2 Memcached 3 Memcached N
Save session Save session Save session Save session
Same ServerSame ServerSame ServerSame Server
Repl Repl Repl
Auto scaling group
![Page 42: OpenSlava Infrastructure Automation Patterns](https://reader035.vdocuments.site/reader035/viewer/2022062404/554a3420b4c9051b578b547d/html5/thumbnails/42.jpg)
Dealing with sticky sessions
![Page 43: OpenSlava Infrastructure Automation Patterns](https://reader035.vdocuments.site/reader035/viewer/2022062404/554a3420b4c9051b578b547d/html5/thumbnails/43.jpg)
Node 1 Node 2 Node 3 Node N
Database
Register RegisterRegisterRegister
Discover nodes
![Page 44: OpenSlava Infrastructure Automation Patterns](https://reader035.vdocuments.site/reader035/viewer/2022062404/554a3420b4c9051b578b547d/html5/thumbnails/44.jpg)
Node 1 Node 2 Node 3 Node N
Message Broker
publish facts publish facts publish facts publish facts
![Page 45: OpenSlava Infrastructure Automation Patterns](https://reader035.vdocuments.site/reader035/viewer/2022062404/554a3420b4c9051b578b547d/html5/thumbnails/45.jpg)
Node 1 Node 2 Node 3 Node N
Message Broker
publish facts publish facts publish facts publish factssubscribe events subscribe events subscribe events subscribe events
![Page 46: OpenSlava Infrastructure Automation Patterns](https://reader035.vdocuments.site/reader035/viewer/2022062404/554a3420b4c9051b578b547d/html5/thumbnails/46.jpg)
Node 1 Node 2 Node 3 Node N
Message Broker
publish facts publish facts publish facts publish factssubscribe events subscribe events subscribe events subscribe events
heartbeat heartbeatheartbeatheartbeat
![Page 47: OpenSlava Infrastructure Automation Patterns](https://reader035.vdocuments.site/reader035/viewer/2022062404/554a3420b4c9051b578b547d/html5/thumbnails/47.jpg)
Virtualized Infrastructure
Chef Server
Message BrokerCMDB
Infra Management: 1. Provisioning 2. Service Discovery
![Page 48: OpenSlava Infrastructure Automation Patterns](https://reader035.vdocuments.site/reader035/viewer/2022062404/554a3420b4c9051b578b547d/html5/thumbnails/48.jpg)
Operating Scenarios: Operations
Virtualized Infrastructure
Chef Server
mCollectiveCMDB
Server Orchestration: 1. Cluster Orchestration 2. Scalability 3. Deployment Orchestration
Infra Management: 1. Provisioning 2. Patching
Multi zone example
![Page 49: OpenSlava Infrastructure Automation Patterns](https://reader035.vdocuments.site/reader035/viewer/2022062404/554a3420b4c9051b578b547d/html5/thumbnails/49.jpg)
Distributed logging
![Page 50: OpenSlava Infrastructure Automation Patterns](https://reader035.vdocuments.site/reader035/viewer/2022062404/554a3420b4c9051b578b547d/html5/thumbnails/50.jpg)
Node 1 Node 2 Node 3 Node N
Auto scaling group
![Page 51: OpenSlava Infrastructure Automation Patterns](https://reader035.vdocuments.site/reader035/viewer/2022062404/554a3420b4c9051b578b547d/html5/thumbnails/51.jpg)
Node 1 Node 2 Node 3 Node N
Cloud storage
Auto scaling group
![Page 52: OpenSlava Infrastructure Automation Patterns](https://reader035.vdocuments.site/reader035/viewer/2022062404/554a3420b4c9051b578b547d/html5/thumbnails/52.jpg)
Node 1 Node 2 Node 3 Node N
Log collector
Cloud storage
Auto scaling group
Log agent Log agent Log agent Log agent
![Page 53: OpenSlava Infrastructure Automation Patterns](https://reader035.vdocuments.site/reader035/viewer/2022062404/554a3420b4c9051b578b547d/html5/thumbnails/53.jpg)
Phoenix Server
![Page 54: OpenSlava Infrastructure Automation Patterns](https://reader035.vdocuments.site/reader035/viewer/2022062404/554a3420b4c9051b578b547d/html5/thumbnails/54.jpg)
Node 1 Node 2 Node 3 Node N
![Page 55: OpenSlava Infrastructure Automation Patterns](https://reader035.vdocuments.site/reader035/viewer/2022062404/554a3420b4c9051b578b547d/html5/thumbnails/55.jpg)
Node 1 Node 2 Node 3 Node N
Want to apply change/patch
![Page 56: OpenSlava Infrastructure Automation Patterns](https://reader035.vdocuments.site/reader035/viewer/2022062404/554a3420b4c9051b578b547d/html5/thumbnails/56.jpg)
Node 1 Node 2 Node 3 Node N Node M
![Page 57: OpenSlava Infrastructure Automation Patterns](https://reader035.vdocuments.site/reader035/viewer/2022062404/554a3420b4c9051b578b547d/html5/thumbnails/57.jpg)
Node 1 Node 2 Node 3 Node N Node M
Migrate data
All changes included
![Page 58: OpenSlava Infrastructure Automation Patterns](https://reader035.vdocuments.site/reader035/viewer/2022062404/554a3420b4c9051b578b547d/html5/thumbnails/58.jpg)
Node 1 Node 2 Node 3 Node N Node M
Shared data
Cloud storage
![Page 59: OpenSlava Infrastructure Automation Patterns](https://reader035.vdocuments.site/reader035/viewer/2022062404/554a3420b4c9051b578b547d/html5/thumbnails/59.jpg)
Test and learn
![Page 60: OpenSlava Infrastructure Automation Patterns](https://reader035.vdocuments.site/reader035/viewer/2022062404/554a3420b4c9051b578b547d/html5/thumbnails/60.jpg)
Virtualized Infrastructure
Chef Server
CMDB
![Page 61: OpenSlava Infrastructure Automation Patterns](https://reader035.vdocuments.site/reader035/viewer/2022062404/554a3420b4c9051b578b547d/html5/thumbnails/61.jpg)
Virtualized Infrastructure
Chef Server
CMDB
Chaos Monkey
![Page 62: OpenSlava Infrastructure Automation Patterns](https://reader035.vdocuments.site/reader035/viewer/2022062404/554a3420b4c9051b578b547d/html5/thumbnails/62.jpg)
Cookbook development
![Page 63: OpenSlava Infrastructure Automation Patterns](https://reader035.vdocuments.site/reader035/viewer/2022062404/554a3420b4c9051b578b547d/html5/thumbnails/63.jpg)
Stop forking, really!!!
![Page 64: OpenSlava Infrastructure Automation Patterns](https://reader035.vdocuments.site/reader035/viewer/2022062404/554a3420b4c9051b578b547d/html5/thumbnails/64.jpg)
community cookbook
wrapper cookbook
wrapper cookbook adds new functionality to community version of the cookbook instead of changing it directly
![Page 65: OpenSlava Infrastructure Automation Patterns](https://reader035.vdocuments.site/reader035/viewer/2022062404/554a3420b4c9051b578b547d/html5/thumbnails/65.jpg)
community cookbook
wrapper cookbook
include_recipe “tomcat“ chef_gem "chef-rewind“ rewind "template[catalina.xml]“ do # add your custom staff end
![Page 66: OpenSlava Infrastructure Automation Patterns](https://reader035.vdocuments.site/reader035/viewer/2022062404/554a3420b4c9051b578b547d/html5/thumbnails/66.jpg)
Copyright © 2012 Accenture All rights reserved.
• Food Critic: Cookbook style analysis tool
• URL: http://acrmp.github.com/foodcritic/
• Integration: Travis CI
• Cookbook Style Guide: https://github.com/ampledata/cookbook-style-guide
Cookbook Quality
![Page 67: OpenSlava Infrastructure Automation Patterns](https://reader035.vdocuments.site/reader035/viewer/2022062404/554a3420b4c9051b578b547d/html5/thumbnails/67.jpg)
Takeaways
- Accenture Cloud Platform
- Monsoon
- Accenture Lightweight Platform for Java
- Accenture Foundation Platform for Java
- Opscode Chef