#vFORUMAU#vFORUMAU
4
Jonathan Thorpe, Zettagrid
3 Zones in 3 Weeks. DevOps with Terraform, Ansible and Packer
PROJECT OCTOPUS
• 3 new Zettagrid zones (Singapore, Brisbane and Adelaide)
• 12 week project
• Commencing Mid October - Completed by November
• 8 total Zones by End of 2019
Existing
Building
Proposed
The Challenge
VMware Stack
• vCenter
• ESXi
• vCloud Director
• NSX
• vSAN
• vCloud Availability
• vRealize Operations
• LogInsight
Integrations
• Veeam Backup & Recovery
• Zerto
• Star (Zettagrid Automation)
Supporting Infrastructure
• Load Balancers
• Networking
• Databases
• Message Queues
• Management
• Monitoring
2-3 Months Typical Deployment Time
Why Automate with DevOps?
Manual Deployment Challenges
• Small Team, ~1,000 VMs per engineer
• Manual Tasks Increase:
– Human Error
– Configuration Drift
– Increased lead times and overheads
DevOps Automation Improves
• Speed, Reliability and Consistency
• Team members empowered
• Faster Feedback
• Testable, Repeatable Infrastructure
• Reduction in latency between dependent
tasks
People + Process + Products = Value
What Needs Automating
What How Time - Manual Time - Automated
ESXi Hosts + vSAN • Servers Pre-Imaged with ESXi
• PowerShell/CLI Scripts
• 2 days • ½ day
vCenter Server
Appliance
• VCSA Deployed Manually
• PowerShell/CLI Scripts
• 1 day • ½ day
Virtual Appliance
Deployment
• Terraform
• GOVC
• 2 days • 1 hour
Base VM Templates • Packer • 2 days • 1 hour
vSphere Resource
Deployment
• Terraform • 1 day • 30 minutes
VM Configuration • Ansible • 3-4 Weeks • 1 week
• Infrastructure/Platform Agnostic
– Avoid lock-in to a specific platform
– Nimble, composable and flexibility to adapt
• Ideally Open Source
– Scope to extend to support new platforms/infrastructure
• Widely Adopted
– Training and Reference Materials
• Configured with human readable text files (JSON, YAML)
– Maintain Version Control
– Serves as Documentation
– Point and Click is no longer an acceptable form of configuring infrastructure
Criteria for Tooling
Challenges and Approach - Human Element
Challenges
• Learning Curve
– Expecting too much too soon: People become hostile
– Can be daunting
• Different Teams, Different Tools– Wasted Effort
• DevOps is not a rebranded SysAdmin Role
– Can have similar outcomes, skills and approach differ
Approaches
• Training and Coaching
• KPIs/OKRs: Assess skills, create road maps - individuals evolve at their own pace
• Prioritise tools that have multiple interfaces (CLI, API, Web) – e.g. GitHub/GitLab
• Run regular team “show and tell” sessions
• Understand DevOps team topologies (devopstopologies.com)
Provisioning
Infrastructure as Code – Tools of the Trade
Configuration ManagementTemplates and Containers
Azure Resource Manager
• Packer:
– Single Configuration: Multiple Images
and Platforms
– Open Source, lightweight, runs on all
major OS
– Supports vSphere, AWS EC2 AMIs,
VirtualBox and more
• Use Cases:
– Building Appliances
– Base Templates
– Development and Production Parity
– Continuous Delivery
Building VM Images with Packer
Building VM Images with Packer
• Provisioning, changing and versioning
infrastructure safely
• What is infrastructure?
– VMs (vSphere, vCloud) and Compute Instances (AWS, Azure)
– DNS Entries
– Networks, Firewall Rules
– Databases
– SaaS Services – PagerDuty, StatusCake,
NewRelic
– Community Providers provide automation
of anything imaginable
Deploying Infrastructure with Terraform
Deploying Infrastructure with Terraform
• Terraform Configuration Language:
– Declarative – think about what, rather than how.
– Native syntax but JSON available
– Version 0.12 greatly enhances Dynamic Blocks,
Iterations (Loops) and Types – repeatable
Terraform Configuration
• Terraform Inputs:
– Variable Files: Variables specific to the environment
– Configuration Files: Reference variables and modules
– Modules: Collections of resources, keeps things DRY
• Terraform Outputs:
– Infrastructure
– Updated State Data
• Terraform Plan: Terraform can change and destroy infrastructure as well as create it!
Terraform Configuration
• Configuration Management vs Orchestration/Provisioning
– Terraform: Strictly Orchestration and Provisioning. Declarative language used to define what
infrastructure should look like, not the process.
– Ansible: Procedural – provides a set of Modules which are called through a Playbook to define procedure for configuring software (copying files, installing packages etc).
• Using Ansible and Terraform together
– Terraform (Provisioning): Port Groups, Resource Pools, VMs from Templates (Packer).
– Ansible (VM Configuration): Adds personality (database, load balancer, web server).
Configuration Management with Ansible
• No Agents:
– SSH on Linux
– WinRM on Windows
• Roles:
– Write your own
– Galaxy – thousands of user contributed Roles
– Comprise Variables, Tasks and Handlers
– One Role can target multiple OS/Platform (Facts)
Configuration Management with Ansible
Configuration Management with Ansible
Project Octopus – Bringing it all together
Conclusions
DevOps Benefits
• Existing experience and tooling: Easier ramp-up
• Reduced deployment time, technical debt:
– Avoiding Configuration Drift
– Reducing Human Error
– Self-Documenting
– Version Controlled
– Repeatable
Address Challenges
• People and Process - most important:
– Team Topology – Shared Responsibility Attitude
– Learning Curves: Avoid hostility
• Product (Tool) Selection:
– Take your time to evaluate
– Can have future consequences
• Requires investment – outcomes must be measurable
People + Process + Products = Value
• Tooling: Good place to start
• Terraform: vCloud Director Provider on Zettagrid can manage:
– VMs and vAPPs
– Networks
– NAT
– Firewall Rules
– Load Balancing
• People and Process:
– Process must add value - measurable
– More engagement, less hostility
– KPIs/OKRs to develop skills – people evolve at their own pace
Where to from here?
Questions?
DevOps Topologies: Team Structures for DevOps - https://web.devopstopologies.com/
Terraform Providers (vCloud, vSphere): https://www.terraform.io/docs/providers/index.html
Packer – vSphere Builder for ISOs: https://github.com/jetbrains-infra/packer-builder-vsphere
Ansible Galaxy: Community contributed Roles - https://galaxy.ansible.com/
Zettagrid: 30 Day Free Trial - https://www.zettagrid.com/cloudcomputing/30-day-free-trial/
Resources / Q & A
#vFORUMAU#vFORUMAU
Thank You!
#vFORUMAU
4
Join the conversation
#vFORUMAU @VMwareAU
Top Related