42
1 nforcing a vSphere Cluster Desig Using PowerCLI Automation

VMworld 2016 - INF8036 - enforcing a vSphere cluster design with powercli automation

Embed Size (px)

Citation preview

Page 1: VMworld 2016 - INF8036 - enforcing a vSphere cluster design with powercli automation

1

Enforcing a vSphere Cluster DesignUsing PowerCLI Automation

Page 2: VMworld 2016 - INF8036 - enforcing a vSphere cluster design with powercli automation

Who is Duncan Epping?

WriterAuthorAuthor

JobVMware

Social

@ Yellow-Bricks.comof Essential Virtual SANof Clustering DeepdiveChief Technologist @ VMwareVCDX@DuncanYB (twitter)

Page 3: VMworld 2016 - INF8036 - enforcing a vSphere cluster design with powercli automation

Who is @ChrisWahl?

WriterHost

InstructorEvangelistMicrosoft

VMware

@ WahlNetwork.com@ DatanautsPodcast.com@ Pluralsight.com@ Rubrik.comMVP (PowerShell)VCDX (DCV & NV)

Page 4: VMworld 2016 - INF8036 - enforcing a vSphere cluster design with powercli automation

4

Agenda

• vSphere Cluster Design Basics• Crafting Declarative Configurations• Infrastructure as Code• An Introduction to the Vester project

Page 5: VMworld 2016 - INF8036 - enforcing a vSphere cluster design with powercli automation

vSphere Cluster Design

5

Page 6: VMworld 2016 - INF8036 - enforcing a vSphere cluster design with powercli automation

Vision

Design

PlanTransition

Manage

Governance

Architecture Methodology

Page 7: VMworld 2016 - INF8036 - enforcing a vSphere cluster design with powercli automation

It is all about the app

App

Page 8: VMworld 2016 - INF8036 - enforcing a vSphere cluster design with powercli automation

What are the things we need to think about?

Consistency is the key to success

• Compute– DNS / NTP / TPS

• Storage– Protocol / Limits / Resiliency

• Networking– vMotion / Management / Storage / VMs

• vSphere HA and DRS

Page 9: VMworld 2016 - INF8036 - enforcing a vSphere cluster design with powercli automation

9

Brief intro to vSphere Clusters

vSphere HA Basics

• Configured through vCenter Server• Each host has an agent (FDM) for monitoring state• HA restarts VMs when a failure impacts those VMs

FDM SlaveFDM Master

FDM Slave

Page 10: VMworld 2016 - INF8036 - enforcing a vSphere cluster design with powercli automation

10

Brief intro to vSphere Clusters

vSphere HA Specifics

• One of the hosts is elected as master• Heartbeats via network and storage

– Management network (or)– VSAN network (if VSAN is enabled)

• It can reserve resources for restarts (Admission Control)

Page 11: VMworld 2016 - INF8036 - enforcing a vSphere cluster design with powercli automation

11

Brief intro to vSphere Clusters

vSphere DRS Basics

• DRS provides load balancing and initial placement– To keep VMs happy and maximize cluster

utilization• DRS is the broker of resources between

producers and consumers• DRS goal is to provide the resources the

virtual machine demands

Page 12: VMworld 2016 - INF8036 - enforcing a vSphere cluster design with powercli automation

12

Brief intro to vSphere Clusters

vSphere DRS Specifics

• DRS provides cluster management – Maintenance Mode– Affinity / anti-affinity rules– VM-Host groups– Resource Pools

Page 13: VMworld 2016 - INF8036 - enforcing a vSphere cluster design with powercli automation

13

And then there is compute

Many things to think about during install / config

• Gateway / DNS• NTP• NUMA• Syslog + Scratch Partition• TPS enabled or disabled?

– If enabled, how?• Security?

– Lock down enabled?

Page 14: VMworld 2016 - INF8036 - enforcing a vSphere cluster design with powercli automation

14

Storage, you got an hour or two?

iSCSI, FC, FCoE or maybe VSAN

• Many different storage systems• Many different design considerations

– And also implications on for instance vSphere HA

– PDL / APD– Stretched? Replication? Sync / Async?

• Resignature? Mount? Orchestration of DR?• Number of Paths, Number of LUNs• Performance aspects – RAID Types –

Flash vs Hybrid

Page 15: VMworld 2016 - INF8036 - enforcing a vSphere cluster design with powercli automation

15

It is always the networkYes, we usually do blame others… Reality is, many issues arise from inconsistency...

• Distributed Switch vs normal vSwitch?• Consistency in configuration of

network segments– VLANs / Portgroups– MTU (end to end)

• Load Balancing– Load based teaming– Virtual Port ID– IP Hash / LACP

Page 16: VMworld 2016 - INF8036 - enforcing a vSphere cluster design with powercli automation

Crafting Declarative Configurations

Page 17: VMworld 2016 - INF8036 - enforcing a vSphere cluster design with powercli automation

17

Imperative Declarative

Page 18: VMworld 2016 - INF8036 - enforcing a vSphere cluster design with powercli automation
Page 19: VMworld 2016 - INF8036 - enforcing a vSphere cluster design with powercli automation

Where’s the Value?

Page 20: VMworld 2016 - INF8036 - enforcing a vSphere cluster design with powercli automation

20

Avoids Building by Handstatements become actionable

Page 21: VMworld 2016 - INF8036 - enforcing a vSphere cluster design with powercli automation

21

Repeatable Processesconsistency is your friend

Page 22: VMworld 2016 - INF8036 - enforcing a vSphere cluster design with powercli automation

22

Force Multiplierthe entire team is now empowered

Page 23: VMworld 2016 - INF8036 - enforcing a vSphere cluster design with powercli automation

23

Annihilate Tribal Knowledgedocumentation is stale upon creationconfigurations are self documenting

Page 24: VMworld 2016 - INF8036 - enforcing a vSphere cluster design with powercli automation

Infrastructure as Code

Page 25: VMworld 2016 - INF8036 - enforcing a vSphere cluster design with powercli automation
Page 26: VMworld 2016 - INF8036 - enforcing a vSphere cluster design with powercli automation

26

Abstract End State from Configurationdon’t store declarative configuration inside the endpoint

Page 27: VMworld 2016 - INF8036 - enforcing a vSphere cluster design with powercli automation

Where do Objects Live?

Page 28: VMworld 2016 - INF8036 - enforcing a vSphere cluster design with powercli automation
Page 29: VMworld 2016 - INF8036 - enforcing a vSphere cluster design with powercli automation
Page 30: VMworld 2016 - INF8036 - enforcing a vSphere cluster design with powercli automation

But I already have a vSphere environment!

• How do I pull the config out of it?• Leverage PowerCLI as a starting point …

– DRS Rules (affinity, anti-affinity, vm-to-host)– VDS and Port Group configs– Resource pools– Generic cluster configs– VSAN & SPBM policies

Page 31: VMworld 2016 - INF8036 - enforcing a vSphere cluster design with powercli automation

Get-DrsRule

31

Page 32: VMworld 2016 - INF8036 - enforcing a vSphere cluster design with powercli automation

Export-VDSwitch & Export-VDPortGroupNote! Import-Module VMware.VimAutomation.Vds

32

http://blogs.vmware.com/PowerCLI/2013/03/vds-exportimport-with-powercli.html

Page 33: VMworld 2016 - INF8036 - enforcing a vSphere cluster design with powercli automation

Get-ResourcePool

33

Page 34: VMworld 2016 - INF8036 - enforcing a vSphere cluster design with powercli automation

Get-SpbmStoragePolicy &Get-VsanDisk / Get-VsanDiskGroup

34

Page 35: VMworld 2016 - INF8036 - enforcing a vSphere cluster design with powercli automation

35

Conversational Configurationtracking, logging, and implementation in a single system

Page 36: VMworld 2016 - INF8036 - enforcing a vSphere cluster design with powercli automation

Ops Collaboration

Page 37: VMworld 2016 - INF8036 - enforcing a vSphere cluster design with powercli automation
Page 38: VMworld 2016 - INF8036 - enforcing a vSphere cluster design with powercli automation

38

Gathering Objects with PowerCLI

• Get information on the cluster– HA, NTP, SSH, DRS, DNS, so forth

• Compare with declarative configuration• Inspect results

– Validate always– Remediate optional

• Report metrics

Page 39: VMworld 2016 - INF8036 - enforcing a vSphere cluster design with powercli automation

Vester

Page 40: VMworld 2016 - INF8036 - enforcing a vSphere cluster design with powercli automation
Page 41: VMworld 2016 - INF8036 - enforcing a vSphere cluster design with powercli automation

41

Interesting Projects

• Vester– https://github.com/WahlNetwork/Vester

• vSphereDSC– https://github.com/lucdekens/vSphereDSC

• Operation Validation Framework (OVF)– https://github.com/PowerShell/Operation-Validation-Framework

• Watchmen– https://github.com/devblackops/watchmen

• vSphere HA Deepdive– https://ha.yellow-bricks.com (Free ebook!)

• PoshSpec– https://github.com/Ticketmaster/poshspec

Page 42: VMworld 2016 - INF8036 - enforcing a vSphere cluster design with powercli automation

Thank you!Duncan Epping – Chief Technologist, VMwareChris Wahl – Technical Evangelist, Rubrik