3 Zones in 3 Weeks. DevOps with Terraform, · Declarative language used to define what...

24
#vFORUMAU #vFORUMAU 4 Jonathan Thorpe, Zettagrid 3 Zones in 3 Weeks. DevOps with Terraform, Ansible and Packer

Transcript of 3 Zones in 3 Weeks. DevOps with Terraform, · Declarative language used to define what...

Page 1: 3 Zones in 3 Weeks. DevOps with Terraform, · Declarative language used to define what infrastructure should look like, not the process. – Ansible: Procedural –provides a set

#vFORUMAU#vFORUMAU

4

Jonathan Thorpe, Zettagrid

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

Page 2: 3 Zones in 3 Weeks. DevOps with Terraform, · Declarative language used to define what infrastructure should look like, not the process. – Ansible: Procedural –provides a set

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

Page 3: 3 Zones in 3 Weeks. DevOps with Terraform, · Declarative language used to define what infrastructure should look like, not the process. – Ansible: Procedural –provides a set

Existing

Building

Proposed

Page 4: 3 Zones in 3 Weeks. DevOps with Terraform, · Declarative language used to define what infrastructure should look like, not the process. – Ansible: Procedural –provides a set

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

Page 5: 3 Zones in 3 Weeks. DevOps with Terraform, · Declarative language used to define what infrastructure should look like, not the process. – Ansible: Procedural –provides a set

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

Page 6: 3 Zones in 3 Weeks. DevOps with Terraform, · Declarative language used to define what infrastructure should look like, not the process. – Ansible: Procedural –provides a set

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

Page 7: 3 Zones in 3 Weeks. DevOps with Terraform, · Declarative language used to define what infrastructure should look like, not the process. – Ansible: Procedural –provides a set

• 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

Page 8: 3 Zones in 3 Weeks. DevOps with Terraform, · Declarative language used to define what infrastructure should look like, not the process. – Ansible: Procedural –provides a set

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)

Page 9: 3 Zones in 3 Weeks. DevOps with Terraform, · Declarative language used to define what infrastructure should look like, not the process. – Ansible: Procedural –provides a set

Provisioning

Infrastructure as Code – Tools of the Trade

Configuration ManagementTemplates and Containers

Azure Resource Manager

Page 10: 3 Zones in 3 Weeks. DevOps with Terraform, · Declarative language used to define what infrastructure should look like, not the process. – Ansible: Procedural –provides a set

• 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

Page 11: 3 Zones in 3 Weeks. DevOps with Terraform, · Declarative language used to define what infrastructure should look like, not the process. – Ansible: Procedural –provides a set

Building VM Images with Packer

Page 12: 3 Zones in 3 Weeks. DevOps with Terraform, · Declarative language used to define what infrastructure should look like, not the process. – Ansible: Procedural –provides a set

• 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

Page 13: 3 Zones in 3 Weeks. DevOps with Terraform, · Declarative language used to define what infrastructure should look like, not the process. – Ansible: Procedural –provides a set

Deploying Infrastructure with Terraform

Page 14: 3 Zones in 3 Weeks. DevOps with Terraform, · Declarative language used to define what infrastructure should look like, not the process. – Ansible: Procedural –provides a set

• 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

Page 15: 3 Zones in 3 Weeks. DevOps with Terraform, · Declarative language used to define what infrastructure should look like, not the process. – Ansible: Procedural –provides a set

• 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

Page 16: 3 Zones in 3 Weeks. DevOps with Terraform, · Declarative language used to define what infrastructure should look like, not the process. – Ansible: Procedural –provides a set

• 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

Page 17: 3 Zones in 3 Weeks. DevOps with Terraform, · Declarative language used to define what infrastructure should look like, not the process. – Ansible: Procedural –provides a set

• 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

Page 18: 3 Zones in 3 Weeks. DevOps with Terraform, · Declarative language used to define what infrastructure should look like, not the process. – Ansible: Procedural –provides a set

Configuration Management with Ansible

Page 19: 3 Zones in 3 Weeks. DevOps with Terraform, · Declarative language used to define what infrastructure should look like, not the process. – Ansible: Procedural –provides a set

Project Octopus – Bringing it all together

Page 20: 3 Zones in 3 Weeks. DevOps with Terraform, · Declarative language used to define what infrastructure should look like, not the process. – Ansible: Procedural –provides a set

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

Page 21: 3 Zones in 3 Weeks. DevOps with Terraform, · Declarative language used to define what infrastructure should look like, not the process. – Ansible: Procedural –provides a set

• 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?

Page 22: 3 Zones in 3 Weeks. DevOps with Terraform, · Declarative language used to define what infrastructure should look like, not the process. – Ansible: Procedural –provides a set

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

Page 23: 3 Zones in 3 Weeks. DevOps with Terraform, · Declarative language used to define what infrastructure should look like, not the process. – Ansible: Procedural –provides a set

#vFORUMAU#vFORUMAU

Thank You!

Page 24: 3 Zones in 3 Weeks. DevOps with Terraform, · Declarative language used to define what infrastructure should look like, not the process. – Ansible: Procedural –provides a set

#vFORUMAU

4

Join the conversation

#vFORUMAU @VMwareAU