infrastructure as code
TRANSCRIPT
![Page 1: Infrastructure as Code](https://reader035.vdocuments.net/reader035/viewer/2022062220/554f6cedb4c905c8088b52ef/html5/thumbnails/1.jpg)
Sascha Möllering | ZANOX.de AG
Infrastructure as Code
![Page 2: Infrastructure as Code](https://reader035.vdocuments.net/reader035/viewer/2022062220/554f6cedb4c905c8088b52ef/html5/thumbnails/2.jpg)
About me
Sascha Mö[email protected]
Software Engineering Team Lead
ZANOX.de AG
http://www.der-maschinenstuermer.de/
@sascha242
![Page 3: Infrastructure as Code](https://reader035.vdocuments.net/reader035/viewer/2022062220/554f6cedb4c905c8088b52ef/html5/thumbnails/3.jpg)
Agenda
• Problem?• VMware and SDKs• Chef• Chef and JBoss• What’s next?• Q&A
![Page 4: Infrastructure as Code](https://reader035.vdocuments.net/reader035/viewer/2022062220/554f6cedb4c905c8088b52ef/html5/thumbnails/4.jpg)
Problem?
![Page 5: Infrastructure as Code](https://reader035.vdocuments.net/reader035/viewer/2022062220/554f6cedb4c905c8088b52ef/html5/thumbnails/5.jpg)
Problem?
![Page 6: Infrastructure as Code](https://reader035.vdocuments.net/reader035/viewer/2022062220/554f6cedb4c905c8088b52ef/html5/thumbnails/6.jpg)
Problem?
![Page 7: Infrastructure as Code](https://reader035.vdocuments.net/reader035/viewer/2022062220/554f6cedb4c905c8088b52ef/html5/thumbnails/7.jpg)
![Page 8: Infrastructure as Code](https://reader035.vdocuments.net/reader035/viewer/2022062220/554f6cedb4c905c8088b52ef/html5/thumbnails/8.jpg)
VMware and SDKs
![Page 9: Infrastructure as Code](https://reader035.vdocuments.net/reader035/viewer/2022062220/554f6cedb4c905c8088b52ef/html5/thumbnails/9.jpg)
VMware and SDKs
• SDKs? More than one?– VMware vSphere Web Services SDK– VMware VI (vSphere) Java API
![Page 10: Infrastructure as Code](https://reader035.vdocuments.net/reader035/viewer/2022062220/554f6cedb4c905c8088b52ef/html5/thumbnails/10.jpg)
VMware and SDKs
• VMware vSphere Web Services SDK– Official SDK– Supported by VMware– Complicated– Architecture based on
• managed objects (server)• managed object reference (client)• data objects
![Page 11: Infrastructure as Code](https://reader035.vdocuments.net/reader035/viewer/2022062220/554f6cedb4c905c8088b52ef/html5/thumbnails/11.jpg)
vSphere server
VMware and SDKs
VirtualMachineManaged
object
GuestInfodata object
vSphere client application
Managed object reference to a
VirtualMachine
GuestInfodata object
data objects
network connection
![Page 12: Infrastructure as Code](https://reader035.vdocuments.net/reader035/viewer/2022062220/554f6cedb4c905c8088b52ef/html5/thumbnails/12.jpg)
VMware and SDKs
• Example: VMWare Event History• Reads the event history from VMWare• > 100 (!!!) lines using vSphere Web
Services SDK
![Page 13: Infrastructure as Code](https://reader035.vdocuments.net/reader035/viewer/2022062220/554f6cedb4c905c8088b52ef/html5/thumbnails/13.jpg)
VMware and SDKs
![Page 14: Infrastructure as Code](https://reader035.vdocuments.net/reader035/viewer/2022062220/554f6cedb4c905c8088b52ef/html5/thumbnails/14.jpg)
VMware and SDKs
![Page 15: Infrastructure as Code](https://reader035.vdocuments.net/reader035/viewer/2022062220/554f6cedb4c905c8088b52ef/html5/thumbnails/15.jpg)
VMware and SDKs
• Same example using VMware VI Java SDK: 28 lines
![Page 16: Infrastructure as Code](https://reader035.vdocuments.net/reader035/viewer/2022062220/554f6cedb4c905c8088b52ef/html5/thumbnails/16.jpg)
VMware and SDKs
![Page 17: Infrastructure as Code](https://reader035.vdocuments.net/reader035/viewer/2022062220/554f6cedb4c905c8088b52ef/html5/thumbnails/17.jpg)
VMware and SDKs
• VMware VI Java SDK– Open source project created by Steve Jin
from VMware R&D– http://vijava.sourceforge.net/– Simplify the use of VI SDK and improve the
performance– Less lines of code, much faster, and much
more readable code
![Page 18: Infrastructure as Code](https://reader035.vdocuments.net/reader035/viewer/2022062220/554f6cedb4c905c8088b52ef/html5/thumbnails/18.jpg)
VMware and SDKs
![Page 19: Infrastructure as Code](https://reader035.vdocuments.net/reader035/viewer/2022062220/554f6cedb4c905c8088b52ef/html5/thumbnails/19.jpg)
VMware and SDKs
![Page 20: Infrastructure as Code](https://reader035.vdocuments.net/reader035/viewer/2022062220/554f6cedb4c905c8088b52ef/html5/thumbnails/20.jpg)
VMware and SDKs
https://github.com/zanox/viAutomator
![Page 21: Infrastructure as Code](https://reader035.vdocuments.net/reader035/viewer/2022062220/554f6cedb4c905c8088b52ef/html5/thumbnails/21.jpg)
VMware and SDKs
• Small service implemented in Java • SOAP-interface• Requires JBoss 5• Add, delete, start, stop, change
network, … etc.• (will be upgraded to use JBoss 7,
REST, Java EE 6 soon)
![Page 22: Infrastructure as Code](https://reader035.vdocuments.net/reader035/viewer/2022062220/554f6cedb4c905c8088b52ef/html5/thumbnails/22.jpg)
![Page 23: Infrastructure as Code](https://reader035.vdocuments.net/reader035/viewer/2022062220/554f6cedb4c905c8088b52ef/html5/thumbnails/23.jpg)
Chef
"Chef is like a little system admin robot ... you tell it how you want your system configured, and it will do all the dirty work.”
![Page 24: Infrastructure as Code](https://reader035.vdocuments.net/reader035/viewer/2022062220/554f6cedb4c905c8088b52ef/html5/thumbnails/24.jpg)
Chef
![Page 25: Infrastructure as Code](https://reader035.vdocuments.net/reader035/viewer/2022062220/554f6cedb4c905c8088b52ef/html5/thumbnails/25.jpg)
Chef
• Node:– Any (virtual) server configured to be
maintained by a chef-client– Chef-client runs on each node
![Page 26: Infrastructure as Code](https://reader035.vdocuments.net/reader035/viewer/2022062220/554f6cedb4c905c8088b52ef/html5/thumbnails/26.jpg)
Chef
• Workstation:– Computer to run Knife– To synchronize with Chef repo– Interact with single Chef server– Develop Cookbooks and Recipes– Use Knife to upload items from Chef repo
to Chef server
![Page 27: Infrastructure as Code](https://reader035.vdocuments.net/reader035/viewer/2022062220/554f6cedb4c905c8088b52ef/html5/thumbnails/27.jpg)
Chef
• Knife– Command-line tool – Provides interface between local Chef repo
and Chef server
![Page 28: Infrastructure as Code](https://reader035.vdocuments.net/reader035/viewer/2022062220/554f6cedb4c905c8088b52ef/html5/thumbnails/28.jpg)
Chef
![Page 29: Infrastructure as Code](https://reader035.vdocuments.net/reader035/viewer/2022062220/554f6cedb4c905c8088b52ef/html5/thumbnails/29.jpg)
Chef
• Linux-installation1. FAI (http://fai-project.org/) for basic setup
2. Chef for additional APT-packages
3. Chef for middleware installation
![Page 30: Infrastructure as Code](https://reader035.vdocuments.net/reader035/viewer/2022062220/554f6cedb4c905c8088b52ef/html5/thumbnails/30.jpg)
Chef and JBoss
Java Magazin 11.12: Automatisierung nach Chef-Rezept Automatisiertes Deployment von JBoss Middleware
![Page 31: Infrastructure as Code](https://reader035.vdocuments.net/reader035/viewer/2022062220/554f6cedb4c905c8088b52ef/html5/thumbnails/31.jpg)
Chef and JBoss
• Automatic deployment of JBoss application server using Chef
• Components:• JBoss EAP 5/6 preconfigured in SVN• JBoss Operations Network (JON): Monitoring-
solution for e.g. JBoss• JON Agent: Agent scanning JBoss-processes• Remote-CLI: CLI running JavaScript-files
accessing the JON-API
![Page 32: Infrastructure as Code](https://reader035.vdocuments.net/reader035/viewer/2022062220/554f6cedb4c905c8088b52ef/html5/thumbnails/32.jpg)
Chef and JBoss
![Page 33: Infrastructure as Code](https://reader035.vdocuments.net/reader035/viewer/2022062220/554f6cedb4c905c8088b52ef/html5/thumbnails/33.jpg)
Chef and JBoss
JON-Server 3.1
Remote-CLI
JBoss EAP 5/6
JON-Agent
Knife
AutodiscoveryQueue
![Page 34: Infrastructure as Code](https://reader035.vdocuments.net/reader035/viewer/2022062220/554f6cedb4c905c8088b52ef/html5/thumbnails/34.jpg)
Chef and JBoss
• JON/RHQ has a remote API– JON/RHQ-CLI with JavaScript-files– JON/RHQ-JARs with Java
• Executing JavaScript-files using the CLI:– rhq-cli.sh –f import-servers.js -s ${RHQ_SERVER} –u user –p pwd
![Page 35: Infrastructure as Code](https://reader035.vdocuments.net/reader035/viewer/2022062220/554f6cedb4c905c8088b52ef/html5/thumbnails/35.jpg)
Chef and JBoss
1. Import JON-Agent
2. Import JBoss EAP 5/6
3. Change settings
![Page 36: Infrastructure as Code](https://reader035.vdocuments.net/reader035/viewer/2022062220/554f6cedb4c905c8088b52ef/html5/thumbnails/36.jpg)
Chef and JBoss
![Page 37: Infrastructure as Code](https://reader035.vdocuments.net/reader035/viewer/2022062220/554f6cedb4c905c8088b52ef/html5/thumbnails/37.jpg)
Chef and JBoss
![Page 38: Infrastructure as Code](https://reader035.vdocuments.net/reader035/viewer/2022062220/554f6cedb4c905c8088b52ef/html5/thumbnails/38.jpg)
Chef and JBoss
![Page 39: Infrastructure as Code](https://reader035.vdocuments.net/reader035/viewer/2022062220/554f6cedb4c905c8088b52ef/html5/thumbnails/39.jpg)
Chef and JBoss
![Page 40: Infrastructure as Code](https://reader035.vdocuments.net/reader035/viewer/2022062220/554f6cedb4c905c8088b52ef/html5/thumbnails/40.jpg)
VMware and SDKs
https://github.com/rhq-project/samples/tree/master/cli/autoimport
![Page 41: Infrastructure as Code](https://reader035.vdocuments.net/reader035/viewer/2022062220/554f6cedb4c905c8088b52ef/html5/thumbnails/41.jpg)
Chef and JBoss
And Clustering?
![Page 42: Infrastructure as Code](https://reader035.vdocuments.net/reader035/viewer/2022062220/554f6cedb4c905c8088b52ef/html5/thumbnails/42.jpg)
Chef and JBoss
• UPD: Just works!• TCP
– Move cluster-config from XML to Properties-file
– Use Chef to modify Properties-file
![Page 43: Infrastructure as Code](https://reader035.vdocuments.net/reader035/viewer/2022062220/554f6cedb4c905c8088b52ef/html5/thumbnails/43.jpg)
![Page 44: Infrastructure as Code](https://reader035.vdocuments.net/reader035/viewer/2022062220/554f6cedb4c905c8088b52ef/html5/thumbnails/44.jpg)