SER1906BU VMware and Chef - Leveraging the vsphere API Together #VMworld #SER1906BU
Disclaimer 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. #SER1906BU CONFIDENTIAL 2
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
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 jj@chef.io @jjasghar http://jjasghar.github.io 4
vsphere 6.5 API Overview
vsphere API Interfaces (the big picture) Perl.Net Java vsphere Management SDKs pyvmomi (Python) rbvmomi (Ruby) govmomi (Go) Web Services Storage Management ESX Agent Manager SSO Client vsphere Storage Policy Open Source SDK Web Services SOAP API vcenter Management Reporting and Features Automation / Operator Interfaces PowerCLI vcli vrealize Orchestrator vcenter REST API VM Management VCSA API Content Library Tags vsphere Automation SDK REST Perl.Net Java Python Ruby VMC on AWS VM Management VCSA API Content Library Tags SOAP API ESXi Management Reporting and Features ESXi ESXi ESXi
Transforming vcenter APIs Developer and Automation friendly API and interfaces that simplify automation and development. Docs REST based tools REST API vcenter Server SDKs Automation Tooling REST APIs for VM Management Simplified and Modern API Design Overview Enables easy access to automation from standard tooling Designed with Automation and DevOps in mind Full featured SDKs, CLI and Workflow access 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 Benefits Single point of access for all API samples 7
VM Management - REST API s 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 for publication 8
VCSA - REST API s 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 9
Content Library - REST API s 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 items 10
API Discovery 101
API Explorer 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 for publication 12
Choice of SDKs and Automation tools 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 VMworld 2017 REST Java.NET Python Ruby Perl Docs DCLI PowerCLI vro Plugins API & SDK & Language Specific Docs Content: Not for publication Documentation Automation CLIs & Workflows 13
Open Sourced vsphere Automation SDKs 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 VMworld 2017 Community contributions welcome Content: Not for publication 14
vsphere API Demo
Configuration Management and why you want it. Day 1 and Day 2 configuration Configuration drift doesn't happen Scalability 16
Chef Infrastructure automation and delivery at scale 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 VMworld 2017 windows_feature IIS-WebServerRole do action :install end windows_feature IIS-ASPNET do action :install end iis_pool FooBarPool do runtime_version 4.0 action :add end Content: Not for publication package "apache" do action :install end template /etc/httpd/https.conf do source httpd.conf.erb mode 0075 owner root group root end service apache2 do action :start done
Managing Additional Systems Your Laptop Now Web Server Your Laptop Future More complex to manage Web Servers 2016 Chef Software Inc. 2-
Example: Package package 'httpd' do action :install end The package named 'httpd' is installed. https://docs.chef.io/resource_package.html 2016 Chef Software Inc. 2-
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.
The Chef Automate Platform Continuous Automation for High Velocity IT Package Test Approve BUILD COLLABORATE Workflow Local development Integration Tooling (APIs & SDKs) Provision Configure Execute Update DEPLOY OSS AUTOMATION ENGINES Secure Comply Audit Measure Log MANAGE 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 Infrastructure Automation Application Automation Compliance Automation Deliver continuous compliance as part of standard workflow
Idea Local Dev TEST KITCHEN from idea to ship with Chef and VMware Development Speed Shared Dev Integration KNIFE Pre-Production CHEF CLIENT Compatibility INSPEC Ship Production Environment + Node Compliance
Demo using knife-vsphere with the vsphere SOAP API VMworld 2017 Content: Not for publication
Why knife-vcenter is so much easier now with this API https://github.com/chef-partners/knifevsphere/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
Demo using kitchen-vcenter and InSpec with the vsphere REST API for full integration test VMworld 2017 Content: Not for publication
Lets make it live! (Github and rubygem push) VMworld 2017 Content: Not for publication
What about VMware Cloud on AWS? VMworld 2017 Content: Not for publication
VMware Cloud on AWS 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 VMware Cloud on AWS Powered by VMware Cloud Foundation vcenter Content: Not for publication vsphere vsan NSX ESXi on Dedicated Hardware Support for VMs and Containers vsan on Flash and EBS Storage Replication and DR Orchestration NSX Spanning onpremises and Cloud Advanced Networking & Security Services AWS Global Infrastructure 28
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 Come to the Chef booth or come find JJ! CONFIDENTIAL 29