Sascha Möllering | ZANOX.de AG
Infrastructure as Code
About me
Sascha Möllering
sascha.moellering@zanox.com
Software Engineering Team Lead
ZANOX.de AG
http://www.der-maschinenstuermer.de/
@sascha242
Agenda
• Problem?
• VMware and SDKs
• Chef
• Chef and JBoss
• What’s next?
• Q&A
Problem?
Problem?
Problem?
VMware and SDKs
VMware and SDKs
• SDKs? More than one?
– VMware vSphere Web Services SDK
– VMware VI (vSphere) Java API
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
vSphere server
VMware and SDKs
VirtualMachine
Managed
object
GuestInfo
data object
vSphere client application
Managed object
reference to a
VirtualMachine
GuestInfo
data object
data objects
network
connection
VMware and SDKs
• Example: VMWare Event History
• Reads the event history from VMWare
• > 100 (!!!) lines using vSphere Web
Services SDK
VMware and SDKs
VMware and SDKs
VMware and SDKs
• Same example using VMware VI Java
SDK: 28 lines
VMware and SDKs
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
VMware and SDKs
VMware and SDKs
VMware and SDKs
https://github.com/zanox/viAutomator
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)
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.”
Chef
Chef
• Node:
– Any (virtual) server configured to be
maintained by a chef-client
– Chef-client runs on each node
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
Chef
• Knife
– Command-line tool
– Provides interface between local Chef repo
and Chef server
Chef
Chef
• Linux-installation
1. FAI (http://fai-project.org/) for basic setup
2. Chef for additional APT-packages
3. Chef for middleware installation
Chef and JBoss
Java Magazin 11.12:
Automatisierung nach Chef-Rezept
Automatisiertes Deployment von
JBoss Middleware
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
Chef and JBoss
Chef and JBoss
Autodiscovery
Queue
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
Chef and JBoss
1. Import JON-Agent
2. Import JBoss EAP 5/6
3. Change settings
Chef and JBoss
Chef and JBoss
Chef and JBoss
Chef and JBoss
VMware and SDKs
https://github.com/rhq-
project/samples/tree/master/cli/autoi
mport
Chef and JBoss
And Clustering?
Chef and JBoss
• UPD: Just works!
• TCP
– Move cluster-config from XML to
Properties-file
– Use Chef to modify Properties-file
Infrastructure as Code
Infrastructure as Code

Infrastructure as Code

Editor's Notes

  • #5 - Sysadmins never have time- Clicking in vSphere client is boring- Setting up JBoss manually is a PITA- Manual processes are error-prone- Donkey work should be automated- Don’t touch the production-system!!!
  • #6 Solution based on VMware, Debian Linux,JBoss, JON/RHQ and Chef
  • #8 - Software zurRechenzentrumsvirtualiserungfür x86-64-basierte Computersysteme-
  • #9 - Software zurRechenzentrumsvirtualiserungfür x86-64-basierte Computersysteme-
  • #12 Managed Objects:Exist on a vSphereserverRepresent vSphere services and componentsManaged object referencesClient references to server-side objectsClient application uses ManagedObjectReference (MOR)MOR is unique and persistent during an object’s lifetimeData objectsContain information about managed objectsClient application sends/receives data objects
  • #23 Chef is an open-source automation platform built to address the hardest infrastructure challenges on the planet.
  • #30 FAI - Fully Automatic InstallationFAI is a non-interactive system to install, customize and manage Linux systems and software configurations on computers as well as virtual machines
  • #44 -IPAdressenVerwaltungPool mit VM-NamenF5 automatisieren