ser1906bu vmware and chef - leveraging the vsphere … ·  · 2017-10-13vmware and chef -...

31
SER1906BU #VMworld #SER1906BU VMware and Chef - Leveraging the vSphere API Together VMworld 2017 Content: Not for publication or distribution

Upload: ngoxuyen

Post on 15-May-2018

238 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: SER1906BU VMware and Chef - Leveraging the vSphere … ·  · 2017-10-13VMware and Chef - Leveraging the vSphere API Together VMworld 2017 ... •Demo using knife-vcenter with the

SER1906BU

#VMworld #SER1906BU

VMware and Chef -Leveraging the vSphere API Together

VMworld 2017 Content: Not fo

r publication or distri

bution

Page 2: SER1906BU VMware and Chef - Leveraging the vSphere … ·  · 2017-10-13VMware and Chef - Leveraging the vSphere API Together VMworld 2017 ... •Demo using knife-vcenter with the

• This presentation may contain product features that are currently under development.

• This overview of new technology represents no commitment from VMware to deliver these features in any generally available product.

• Features are subject to change, and must not be included in contracts, purchase orders, or sales agreements of any kind.

• Technical feasibility and market demand will affect final delivery.

• Pricing and packaging for any new technologies or features discussed or presented have not been determined.

Disclaimer

#SER1906BU CONFIDENTIAL 2

VMworld 2017 Content: Not fo

r publication or distri

bution

Page 3: SER1906BU VMware and Chef - Leveraging the vSphere … ·  · 2017-10-13VMware and Chef - Leveraging the vSphere API Together VMworld 2017 ... •Demo using knife-vcenter with the

Agenda

• Introduction

• Current API Overview

• API Discovery 101

• API and Interfaces demo

• Basic what is Chef?

• Traditional knife-vsphere usage

• Why knife-vcenter is so much easier now with this API

• Demo using knife-vcenter with the vSphere REST API

• Demo using kitchen-vcenter and InSpec with the vSphere REST API for full integration test

• Conclusion - Including Takeaways

CONFIDENTIAL 3

VMworld 2017 Content: Not fo

r publication or distri

bution

Page 4: SER1906BU VMware and Chef - Leveraging the vSphere … ·  · 2017-10-13VMware and Chef - Leveraging the vSphere API Together VMworld 2017 ... •Demo using knife-vcenter with the

Introduction

Alan Renouf

– Sr Product Line Manager, VMware

– Book Author

– vExpert

– Personal Blog: http://virtu-al.net/

– Twitter: @alanrenouf

JJ Asghar

– Partner Architect, Chef

– US Patent holder at age 8

– Likes a good beer when he can

[email protected] || @jjasghar || http://jjasghar.github.io

4

VMworld 2017 Content: Not fo

r publication or distri

bution

Page 5: SER1906BU VMware and Chef - Leveraging the vSphere … ·  · 2017-10-13VMware and Chef - Leveraging the vSphere API Together VMworld 2017 ... •Demo using knife-vcenter with the

vSphere 6.5 API Overview

VMworld 2017 Content: Not fo

r publication or distri

bution

Page 6: SER1906BU VMware and Chef - Leveraging the vSphere … ·  · 2017-10-13VMware and Chef - Leveraging the vSphere API Together VMworld 2017 ... •Demo using knife-vcenter with the

ESXiESXi

vSphere API Interfaces (the big picture)

ESXi

vCenter

vCenter ManagementReporting and Features

SOAP API REST API

SOAP API

vSphere Management SDKs

Perl

.Net

Java

Web Services

Storage Management

ESX Agent Manager

SSO Client

vSphere Storage Policy

vSphere Automation SDK

VMC on AWS

VM Management

VCSA API

Content Library

Tags

REST

Perl

.Net

Java

Python

Ruby

Open Source SDK

pyvmomi (Python)

rbvmomi (Ruby)

govmomi (Go)

Web

Services

Automation / Operator Interfaces

PowerCLI

vCLI

vRealize Orchestrator

VM Management

VCSA API

Content Library

Tags

ESXi Management Reportingand

Features

VMworld 2017 Content: Not fo

r publication or distri

bution

Page 7: SER1906BU VMware and Chef - Leveraging the vSphere … ·  · 2017-10-13VMware and Chef - Leveraging the vSphere API Together VMworld 2017 ... •Demo using knife-vcenter with the

Transforming vCenter APIsDeveloper and Automation friendly API and interfaces that simplify automation and development.

REST API

vCenter

Server

SDKsAutomation

Tooling

REST

based tools

• REST APIs for VM Management

• Simplified and Modern API Design

• Enables easy access to automation from standard tooling

• Designed with Automation and DevOps in mind

• Full featured SDKs, CLI and Workflow access

Overview

Key Use Case: VM Automation and Development

Benefits

• Reduces API development complexity and time

• Access via modern automation and development processes for

consistency and repeatability

• Simplified API model

• Single point of access for all API samples

Benefits

7

Docs

VMworld 2017 Content: Not fo

r publication or distri

bution

Page 8: SER1906BU VMware and Chef - Leveraging the vSphere … ·  · 2017-10-13VMware and Chef - Leveraging the vSphere API Together VMworld 2017 ... •Demo using knife-vcenter with the

VM Management - REST API’s

8

Manage the following areas from our consistent set of tooling:

• Work with VM operations • Power actions• Hardware

• Boot • Device• Disk• CDROM• CPU• Disk

• Ethernet• Floppy• Memory• Parallel• Serial• Adapter

• Sata• SCSI

• Cluster• Datacenter• Datastore• Folder• Host• Network• Resource pool• Tag Category• Tagging

VMworld 2017 Content: Not fo

r publication or distri

bution

Page 9: SER1906BU VMware and Chef - Leveraging the vSphere … ·  · 2017-10-13VMware and Chef - Leveraging the vSphere API Together VMworld 2017 ... •Demo using knife-vcenter with the

VCSA - REST API’s

9

Manage the following areas from our consistent set of tooling:

• Appliance Access (DCUI/Shell/SSH)• Appliance User accounts• Check the Health of the appliance (Load/Mem/Database/Storage/Etc..)• Monitoring of services and statistics• Configure and test Networking aspects including:

• Hostname• DNS Domains/Servers• Network Interfaces• Firewall Rules• Proxy Settings• Routes

• Perform Backup/Recovery of the appliance• Configure System settings:

• List and resize storage• NTP/Timesync Settings • View System Versions and Uptime• SNMP Settings• Shutdown and reboot• Update

VMworld 2017 Content: Not fo

r publication or distri

bution

Page 10: SER1906BU VMware and Chef - Leveraging the vSphere … ·  · 2017-10-13VMware and Chef - Leveraging the vSphere API Together VMworld 2017 ... •Demo using knife-vcenter with the

Content Library - REST API’s

10

Manage the following areas from our consistent set of tooling:

• Configure Global Settings

• Work with Local Libraries

• Enable Publish and Subscribe features

• Sync options and actions

• Work with library items

• Upload and download of library items

• Deploy from content library

• Work with media library itemsVMworld 2017 Content: Not fo

r publication or distri

bution

Page 11: SER1906BU VMware and Chef - Leveraging the vSphere … ·  · 2017-10-13VMware and Chef - Leveraging the vSphere API Together VMworld 2017 ... •Demo using knife-vcenter with the

API Discovery 101

VMworld 2017 Content: Not fo

r publication or distri

bution

Page 12: SER1906BU VMware and Chef - Leveraging the vSphere … ·  · 2017-10-13VMware and Chef - Leveraging the vSphere API Together VMworld 2017 ... •Demo using knife-vcenter with the

API Explorer

12

• Available at

https://vchostname/apiexplorer

• Navigate REST based APIs for

• vCenter

• Appliance Management

• Tags

• Content Library

• API Query

• Easily understand the API model

• Determine required fields

• Easily understand the request body

• Detailed filter information

• List of response messages and examples

• Live “Try it out” feature

• Sample Curl statement after try it out

VMworld 2017 Content: Not fo

r publication or distri

bution

Page 13: SER1906BU VMware and Chef - Leveraging the vSphere … ·  · 2017-10-13VMware and Chef - Leveraging the vSphere API Together VMworld 2017 ... •Demo using knife-vcenter with the

Choice of SDKs and Automation tools

13

• vSphere Automation SDKs for multiple languages

• Choice of CLIs• PowerCLI Cmdlets• Datacenter CLI - DCLI

• Consistently named with the APIs

• vRealize Orchestrator Integration

• Docs are automatically generated• REST & SDKS

• More to come in the future

REST

Java

.NET

Python

Ruby

Perl

DCLI

PowerCLI

Docs

vRO Plugins

API & SDK &

Language

Specific Docs

Documentation

Automation CLIs

& Workflows

VMworld 2017 Content: Not fo

r publication or distri

bution

Page 14: SER1906BU VMware and Chef - Leveraging the vSphere … ·  · 2017-10-13VMware and Chef - Leveraging the vSphere API Together VMworld 2017 ... •Demo using knife-vcenter with the

Open Sourced vSphere Automation SDKs

14

• Available at

https://vmware.github.io/vsphere-automation-sdk/

• VMware maintained

• Get up and running in less than 5 minutes!

• SDKs for managing vSphere and VMC in

• REST

• Java

• Python

• Perl

• .Net

• Ruby

• Full of samples

• Community contributions welcome

VMworld 2017 Content: Not fo

r publication or distri

bution

Page 15: SER1906BU VMware and Chef - Leveraging the vSphere … ·  · 2017-10-13VMware and Chef - Leveraging the vSphere API Together VMworld 2017 ... •Demo using knife-vcenter with the

vSphere API Demo

VMworld 2017 Content: Not fo

r publication or distri

bution

Page 16: SER1906BU VMware and Chef - Leveraging the vSphere … ·  · 2017-10-13VMware and Chef - Leveraging the vSphere API Together VMworld 2017 ... •Demo using knife-vcenter with the

Configuration Management and why you want it.

• Day 1 and Day 2 configuration

• Configuration drift doesn't happen

• Scalability

16

VMworld 2017 Content: Not fo

r publication or distri

bution

Page 17: SER1906BU VMware and Chef - Leveraging the vSphere … ·  · 2017-10-13VMware and Chef - Leveraging the vSphere API Together VMworld 2017 ... •Demo using knife-vcenter with the

Chef

• Manages deployment and on-going automation

• Define reusable resources and infrastructure state as code

• Scale elegantly from one to tens of thousands of managed nodes across multiple complex environments

• Community, Certified Partner, and Chef supported content available for all common automation tasks

• Infrastructure automation and delivery at scale

windows_feature ‘IIS-WebServerRole’ doaction :install

end

windows_feature ‘IIS-ASPNET’ doaction :install

end

iis_pool FooBarPool doruntime_version “4.0”

action :addend

package "apache" doaction :install

end

template “/etc/httpd/https.conf” dosource “httpd.conf.erb”mode 0075owner “root”group “root”

end

service “apache2” doaction :start

done

VMworld 2017 Content: Not fo

r publication or distri

bution

Page 18: SER1906BU VMware and Chef - Leveraging the vSphere … ·  · 2017-10-13VMware and Chef - Leveraging the vSphere API Together VMworld 2017 ... •Demo using knife-vcenter with the

2-

Managing Additional Systems

©2016 Chef Software Inc.

• Now

Your Laptop

Web Server

Web ServersYour Laptop

Future

More complex

to manage

VMworld 2017 Content: Not fo

r publication or distri

bution

Page 19: SER1906BU VMware and Chef - Leveraging the vSphere … ·  · 2017-10-13VMware and Chef - Leveraging the vSphere API Together VMworld 2017 ... •Demo using knife-vcenter with the

2-

Example: Package

©2016 Chef Software Inc.

• package 'httpd' do

• action :install

• end

The package named 'httpd' is installed.

https://docs.chef.io/resource_package.html

VMworld 2017 Content: Not fo

r publication or distri

bution

Page 20: SER1906BU VMware and Chef - Leveraging the vSphere … ·  · 2017-10-13VMware and Chef - Leveraging the vSphere API Together VMworld 2017 ... •Demo using knife-vcenter with the

Overview

Companies can turbo-charge their value creation by using VMware Cloud on AWS

for development. Using VMware Cloud on AWS, a company can use Chef to

create as many developer environments as needed. What’s more, developers

can seamlessly move their workloads into production in the Software Defined

Data Center, since VMware Cloud uses the same APIs as on-premise VMware

based Data Center.

The ability to have a development environment in the cloud that mirrors your

production environment in the Data Center will increase your team’s velocity

while InSpec to verify compliance automatically across both cloud and data

center environments keep it secure.

VMworld 2017 Content: Not fo

r publication or distri

bution

Page 21: SER1906BU VMware and Chef - Leveraging the vSphere … ·  · 2017-10-13VMware and Chef - Leveraging the vSphere API Together VMworld 2017 ... •Demo using knife-vcenter with the

The Chef Automate PlatformContinuous Automation for High Velocity IT

Workflow • Local development • Integration • Tooling (APIs & SDKs)

COLLABORATE

▪ Package

▪ Test

▪ Approve

BUILD

▪ Provision

▪ Configure

▪ Execute

▪ Update

DEPLOY

▪ Secure

▪ Comply

▪ Audit

▪ Measure

▪ Log

MANAGE

Infrastructure Automation Compliance AutomationApplication Automation

OSS AUTOMATION ENGINES

Increase Speed

▪ Package infrastructure and app

configuration as code

▪ Continuously automate infrastructure

and app updates

Improve Efficiency

▪ Define and execute standard

workflows and automation

▪ Audit and measure effectiveness of

automation

Decrease Risk

▪ Define compliance rules as code

▪ Deliver continuous compliance as

part of standard workflow

VMworld 2017 Content: Not fo

r publication or distri

bution

Page 22: SER1906BU VMware and Chef - Leveraging the vSphere … ·  · 2017-10-13VMware and Chef - Leveraging the vSphere API Together VMworld 2017 ... •Demo using knife-vcenter with the

from idea to ship with Chef and VMwareIdea Ship

Local Dev IntegrationShared Dev

Development Speed

Pre-Production

Compatibility

Production

TEST KITCHEN

Environment + Node Compliance

KNIFE CHEF CLIENT

INSPEC

VMworld 2017 Content: Not fo

r publication or distri

bution

Page 23: SER1906BU VMware and Chef - Leveraging the vSphere … ·  · 2017-10-13VMware and Chef - Leveraging the vSphere API Together VMworld 2017 ... •Demo using knife-vcenter with the

Demo using knife-vsphere with the vSphere SOAP API

VMworld 2017 Content: Not fo

r publication or distri

bution

Page 24: SER1906BU VMware and Chef - Leveraging the vSphere … ·  · 2017-10-13VMware and Chef - Leveraging the vSphere API Together VMworld 2017 ... •Demo using knife-vcenter with the

Why knife-vcenter is so much easier now with this API

• https://github.com/chef-partners/knife-vsphere/blob/master/lib/chef/knife/vsphere_vm_list.rb#L63-L69

• https://github.com/chef/knife-vcenter/blob/master/lib/chef/knife/vcenter_vm_list.rb#L36-L64

CONFIDENTIAL 24

VMworld 2017 Content: Not fo

r publication or distri

bution

Page 25: SER1906BU VMware and Chef - Leveraging the vSphere … ·  · 2017-10-13VMware and Chef - Leveraging the vSphere API Together VMworld 2017 ... •Demo using knife-vcenter with the

Demo using kitchen-vcenter and InSpec with the vSphere REST API for full integration test

VMworld 2017 Content: Not fo

r publication or distri

bution

Page 26: SER1906BU VMware and Chef - Leveraging the vSphere … ·  · 2017-10-13VMware and Chef - Leveraging the vSphere API Together VMworld 2017 ... •Demo using knife-vcenter with the

Lets make it live! (Github and rubygem push)

VMworld 2017 Content: Not fo

r publication or distri

bution

Page 27: SER1906BU VMware and Chef - Leveraging the vSphere … ·  · 2017-10-13VMware and Chef - Leveraging the vSphere API Together VMworld 2017 ... •Demo using knife-vcenter with the

What about VMware Cloud on AWS?

VMworld 2017 Content: Not fo

r publication or distri

bution

Page 28: SER1906BU VMware and Chef - Leveraging the vSphere … ·  · 2017-10-13VMware and Chef - Leveraging the vSphere API Together VMworld 2017 ... •Demo using knife-vcenter with the

VMware Cloud on AWS

28

AWS Global Infrastructure

VMware Cloud™ on AWSPowered by VMware Cloud Foundation

AWS Global Infrastructure

vSphere vSAN NSX

vCenter

• ESXi on Dedicated Hardware

• Support for VMs and Containers

• vSAN on Flash and EBS Storage

• Replication and DR Orchestration

• NSX Spanning on-premises and Cloud

• Advanced Networking & Security Services

AWS Global Infrastructure

• Same vCenter Endpoint

• Focus on REST APIs

• Same tools, different VC!

• Chef integrates natively with the vSphere REST Endpoint

• Repoint to VMware Cloud on AWS

• Private cloud and Public cloud automation has never been

easier with VMware and Chef together!VMworld 2017 Content: N

ot for publicatio

n or distribution

Page 29: SER1906BU VMware and Chef - Leveraging the vSphere … ·  · 2017-10-13VMware and Chef - Leveraging the vSphere API Together VMworld 2017 ... •Demo using knife-vcenter with the

Conclusion - Including Takeaways

• #1: It is easy to navigate the vSphere API and there are multiple tools to do so

• #2: It is easy to leverage Chef to declare your infrastructure as code in the vSphere REST API

• #3: You can use the same Automation Interfaces in your own datacenter or using VMware on AWS

• Example code is at: https://github.com/jjasghar/vmworld2017-demo || https://git.io/v53YZ

CONFIDENTIAL 29

Come to the Chef booth or come find JJ!

VMworld 2017 Content: Not fo

r publication or distri

bution

Page 30: SER1906BU VMware and Chef - Leveraging the vSphere … ·  · 2017-10-13VMware and Chef - Leveraging the vSphere API Together VMworld 2017 ... •Demo using knife-vcenter with the

VMworld 2017 Content: Not fo

r publication or distri

bution

Page 31: SER1906BU VMware and Chef - Leveraging the vSphere … ·  · 2017-10-13VMware and Chef - Leveraging the vSphere API Together VMworld 2017 ... •Demo using knife-vcenter with the

VMworld 2017 Content: Not fo

r publication or distri

bution