3 Zones in 3 Weeks. Devops With Terraform, Ansible and Packer

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 24

4

3 Zones in 3 Weeks.
DevOps with Terraform,
Ansible and Packer

Jonathan Thorpe, Zettagrid

#v FORUMAU
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

2-3 Months Typical Deployment Time

VMware Stack Integrations Supporting Infrastructure

• vCenter
• Veeam Backup & Recovery • Load Balancers
• ESXi
• Zerto • Networking
• vCloud Director
• NSX • Star (Zettagrid Automation) • Databases
• vSAN • Message Queues
• vCloud Availability • Management
• vRealize Operations • Monitoring
• LogInsight
Why Automate with DevOps?

People + Process + Products = Value

Manual Deployment Challenges DevOps Automation Improves

• Small Team, ~1,000 VMs per engineer • Speed, Reliability and Consistency
• Manual Tasks Increase: • Team members empowered
– Human Error • Faster Feedback
– Configuration Drift • Testable, Repeatable Infrastructure
– Increased lead times and overheads • Reduction in latency between dependent
tasks
What Needs Automating

What How Time - Manual Time - Automated


ESXi Hosts + vSAN • Servers Pre-Imaged with ESXi • 2 days • ½ day
• PowerShell/CLI Scripts
vCenter Server • VCSA Deployed Manually • 1 day • ½ day
Appliance • PowerShell/CLI Scripts
Virtual Appliance • Terraform • 2 days • 1 hour
Deployment • GOVC
Base VM Templates • Packer • 2 days • 1 hour
vSphere Resource • Terraform • 1 day • 30 minutes
Deployment
VM Configuration • Ansible • 3-4 Weeks • 1 week
Criteria for Tooling

• 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
Challenges and Approach - Human Element

Challenges Approaches

• Learning Curve
• Training and Coaching
– Expecting too much too soon: People
become hostile • KPIs/OKRs: Assess skills, create road maps
– Can be daunting - individuals evolve at their own pace
• Different Teams, Different Tools • Prioritise tools that have multiple interfaces
– Wasted Effort (CLI, API, Web) – e.g. GitHub/GitLab
• DevOps is not a rebranded SysAdmin Role • Run regular team “show and tell” sessions
– Can have similar outcomes, skills and • Understand DevOps team topologies
approach differ (devopstopologies.com)
Infrastructure as Code – Tools of the Trade

Templates and Containers Provisioning Configuration Management

Azure Resource Manager


Building VM Images with Packer

• 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
Deploying Infrastructure with Terraform

• 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
Terraform Configuration

• 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!
Configuration Management with Ansible

• 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
Project Octopus – Bringing it all together
Conclusions

People + Process + Products = Value

DevOps Benefits Address Challenges

• People and Process - most important:


• Existing experience and tooling: Easier ramp-up
– Team Topology – Shared Responsibility Attitude
• Reduced deployment time, technical debt: – Learning Curves: Avoid hostility
– Avoiding Configuration Drift • Product (Tool) Selection:
– Reducing Human Error – Take your time to evaluate
– Self-Documenting – Can have future consequences
– Version Controlled • Requires investment – outcomes must be
measurable
– Repeatable
Where to from here?

• 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
Resources / Q & A

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/
Thank You!

#v FORUMAU
4

Join the
conversation
#vFORUMAU @VMwareAU

#v FORUMAU

You might also like