new to chef and puppet ? overview of chef and puppet and how they can automate infrastructure and...

29
Kundana Palagiri Program Manager, Azure Compute Leverage Existing Chef / Puppet Toolsets for Management

Upload: marilynn-shields

Post on 22-Dec-2015

217 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: New to Chef and Puppet ? Overview of Chef and Puppet and how they can automate infrastructure and application deployment on Azure. Existing Chef/Puppet

Kundana PalagiriProgram Manager, Azure Compute

Leverage Existing Chef / Puppet Toolsets for Management

Page 2: New to Chef and Puppet ? Overview of Chef and Puppet and how they can automate infrastructure and application deployment on Azure. Existing Chef/Puppet

Learn about Chef and Puppet Integration.General workflow for VM customization on Azure.

VM Customization on Azure

Page 3: New to Chef and Puppet ? Overview of Chef and Puppet and how they can automate infrastructure and application deployment on Azure. Existing Chef/Puppet

What will we learn?• New to Chef and Puppet ? Overview of Chef and Puppet and how they can automate infrastructure and application deployment on Azure.

• Existing Chef/Puppet Users? Learn about extending Chef & Puppet to Azure.

• Other automated VM customization options?

Learn about VM customization using standard scripts.

Page 4: New to Chef and Puppet ? Overview of Chef and Puppet and how they can automate infrastructure and application deployment on Azure. Existing Chef/Puppet

What will we not cover?• Mastering Chef/Puppet DSL.• Writing cookbooks/modules.• Azure IaaS components.• DevOps workflows and tooling.

Page 5: New to Chef and Puppet ? Overview of Chef and Puppet and how they can automate infrastructure and application deployment on Azure. Existing Chef/Puppet

VM Customization Workflow

Provision/ Manage

Infrastructure

Bootstrap Agents

Customize VM

Page 6: New to Chef and Puppet ? Overview of Chef and Puppet and how they can automate infrastructure and application deployment on Azure. Existing Chef/Puppet

Software provided both Microsoft or by trusted third-party providers for Azure VMs to extend the functionality of the VM.

Windows and Linux support. Deploy to a running or a new VM. Programmability support. Update life cycle that’s independent of the VM.Enables dynamic composition on a VM.

VM Extensions : Building block for Devops

Page 7: New to Chef and Puppet ? Overview of Chef and Puppet and how they can automate infrastructure and application deployment on Azure. Existing Chef/Puppet

Demo : VM Extensions from Portal

Page 8: New to Chef and Puppet ? Overview of Chef and Puppet and how they can automate infrastructure and application deployment on Azure. Existing Chef/Puppet

1. Custom Scripts for VM Customization

Author the scripts

Upload them to Azure

Storage or GitHub

Deploy them to a remote VM – New or

running

Workflow

Scripting Languages Supported:Linux : Ruby, Python,, Bash, perlWindows : PowerShell, DSC

CLI Supported:Azure CLI or Azure Powershell

Page 9: New to Chef and Puppet ? Overview of Chef and Puppet and how they can automate infrastructure and application deployment on Azure. Existing Chef/Puppet

Demo Custom Script for Linux using Azure CLI

Page 10: New to Chef and Puppet ? Overview of Chef and Puppet and how they can automate infrastructure and application deployment on Azure. Existing Chef/Puppet

Custom Script Capabilities

Bootstrap any agent and execute scripts that install software or configure resources on the VM.

Page 11: New to Chef and Puppet ? Overview of Chef and Puppet and how they can automate infrastructure and application deployment on Azure. Existing Chef/Puppet

What is Chef? Chef is a configuration management tools for deploying & managing infrastructure and applications.

- Infrastructure is code- Declarative interface to resource- Policy based configuration management.

2. Chef on Azure

Page 12: New to Chef and Puppet ? Overview of Chef and Puppet and how they can automate infrastructure and application deployment on Azure. Existing Chef/Puppet

Chef Concepts:Knife : Cmdline tool to manage infrastructure and bootstrap chef.

Resource : Fundamental building block, piece of a system.

Recipe : ‘code’ for managing the resource.

Cookbook : Collection of recipes.

Runlist : A policy which needs to be applied on the node.

Click icon to add picture

Page 13: New to Chef and Puppet ? Overview of Chef and Puppet and how they can automate infrastructure and application deployment on Azure. Existing Chef/Puppet

Managing Azure VMs using Knife

Bootstrapping chef agent using Chef

Extension

Leveraging DSC resources using

Chef

Chef Options for Azure

Page 14: New to Chef and Puppet ? Overview of Chef and Puppet and how they can automate infrastructure and application deployment on Azure. Existing Chef/Puppet

Chef Server Account: Sign up for Hosted Chef account : https://manage.opscode.com/signup

Setting up Chef Workstation: Download the starter kit from Chef server. Setup the workstation by downloading the chef-client :

https://www.getchef.com/download-chef-client/ Install knife azure : gem install knife-azure

The workstation is now ready to manage VMs in Azure!

Managing Infrastructure in Azure using Knife

Page 15: New to Chef and Puppet ? Overview of Chef and Puppet and how they can automate infrastructure and application deployment on Azure. Existing Chef/Puppet

Create a VM : Download publish settings file from here : https://manage.windowsazure.com/publishsettings/index?client=powershell

Knife azure image list --azure-publish-settings-file '/path/to/your/cert.publishsettingsfile'knife azure server create--azure-publish-settings-file '/path/to/your/cert.publishsettingsfile'--azure-dns-name 'myservice'--azure-source-image 'windows-image-name'--ssh-user ‘testuser'--ssh-password ‘azuredemo'--azure-service-location "West US"

Managing Infrastructure in Azure using Knife

Page 16: New to Chef and Puppet ? Overview of Chef and Puppet and how they can automate infrastructure and application deployment on Azure. Existing Chef/Puppet

Demo :

Bootstrapping chef agent on Azure

Page 17: New to Chef and Puppet ? Overview of Chef and Puppet and how they can automate infrastructure and application deployment on Azure. Existing Chef/Puppet

Azure Powershell :

Set-AzureVMChefExtension-VM <IPersistentVM> -ValidationPem <Validator.pem> -ClientRb <Client.rb> -RunList <RunList>

Knife Command:

knife azure server create --azure-dns-name 'knifetest2' --bootstrap-protocol 'cloud-api‘ --azure-source-image '3422a428aaf14529884165693cbb90d3__DreamFactory_1.7.8-0_-_Ubuntu_14.04' --azure-service-location 'West US' --ssh-user 'kundanap' --ssh-password 'Azuredemo4'

CLI tools for automating Chef Extension installation

Page 18: New to Chef and Puppet ? Overview of Chef and Puppet and how they can automate infrastructure and application deployment on Azure. Existing Chef/Puppet

Ready to go!Your existing Chef toolkit is now ready to manage resources on Azure

Resources for learning about Chef:https://learn.chef.io/

Windows Azure for Chef:https://www.chef.io/partners/microsoft/

Page 19: New to Chef and Puppet ? Overview of Chef and Puppet and how they can automate infrastructure and application deployment on Azure. Existing Chef/Puppet

Admins who manage a mix of both windows and linux deployments can leverage DSC using Chef.

Preview of DSC cookbook which exposes DSC resources as Chef resources is available : https://supermarket.getchef.com/cookbooks/dsc

All the DSC resources returned by get-dscresource can be managed by Chef using the cookbook.

Simple rules for transforming DSC resource into Chef resource published here : https://github.com/opscode-cookbooks/dsc/blob/master/README.md

Chef + DSC

Page 20: New to Chef and Puppet ? Overview of Chef and Puppet and how they can automate infrastructure and application deployment on Azure. Existing Chef/Puppet

What is Puppet? : Puppet is a configuration management system that allows you to define the state of your IT infrastructure, then automatically enforces the correct state.

Key Concepts:- Supports easy to read declarative language.- Enforces desired state on the system.- Puppet Forge supports many ready to use modules.

- .

3. Puppet on Azure

Page 21: New to Chef and Puppet ? Overview of Chef and Puppet and how they can automate infrastructure and application deployment on Azure. Existing Chef/Puppet

What is Chef? Chef is a configuration management Manifest : A file containing code written in the Puppet language,& managing infrastructure and applications. Manifest contains resources and classes.

Resources : A unit of configuration, whose state can be managed by Puppet.

Module : A collection of classes, resource types, files, and templates, organized around a particular purpose.

Catalog : A catalog is a document that describes the desired system state for one specific computer. Catalogs are compiled from manifests by a puppet master server and served to agent nodes.

- Infrastructure is code- Declarative interface to resource- Policy based configuration management.

Puppet Terminology

Page 22: New to Chef and Puppet ? Overview of Chef and Puppet and how they can automate infrastructure and application deployment on Azure. Existing Chef/Puppet

Provisioning using Puppet Azure

module

Bootstrapping puppet agent using Puppet Extension

Leveraging DSC resources using

Puppet

Puppet Options for Azure

Page 23: New to Chef and Puppet ? Overview of Chef and Puppet and how they can automate infrastructure and application deployment on Azure. Existing Chef/Puppet

Puppet Commands for Azure VM provisioning

Install a Puppet Azure Module

puppet module install msopentech-microsoftazure

puppet azure_vm create \ #> --management-certificate pem-or-pfx-file-path \--azure-subscription-id=your-subscription-id \--image b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-13_04-amd64-server-20130501-en-us-30GB \--location 'west us' \--vm-name vmname \--vm-user username \--password ComplexPassword \--puppet-master-ip yourPuppetMasterIPAddress

Page 24: New to Chef and Puppet ? Overview of Chef and Puppet and how they can automate infrastructure and application deployment on Azure. Existing Chef/Puppet

Demo :

Bootstrapping Puppet agent on Azure VMs.

Page 25: New to Chef and Puppet ? Overview of Chef and Puppet and how they can automate infrastructure and application deployment on Azure. Existing Chef/Puppet

Step1 : Setting up Puppet Master:

Select the Puppet Master Image from Azure Gallery . Note : Provide a lowercase cloud service & vm name for the Puppet Master.

Add the following end points on the Puppet Master VM:443 for HTTPS8140 for Puppet61613 for MCollective

Browse to the Puppet master VM and retrieve the user name and password for PE console:User login is located in the file  /etc/puppetlabs/installer/answers.install (admin@<VM name>.cloudapp.net)

Password is located in the file /etc/puppetlabs/installer/database_info.install

Wait for 10 mins and login to PE console : https://<cloudservicename>.cloudapp.net

Install Puppet Master

Page 26: New to Chef and Puppet ? Overview of Chef and Puppet and how they can automate infrastructure and application deployment on Azure. Existing Chef/Puppet

Setting up Puppet agent from the Azure Portal

Select any windows VM, add Puppet extension with input : puppetmastername.cloudapp.net

Setting up Puppet Agent from Azure Powershell:

vm = get-AzureVM -ServiceName $svcName -Name $name Set-AzureVMPuppetExtension –PuppetMasterServer $puppetmaster –VM $vmUpdate-AzureVM -VM $vm.VM -ServiceName $svcName -Name $name

Install Puppet Agent

Page 27: New to Chef and Puppet ? Overview of Chef and Puppet and how they can automate infrastructure and application deployment on Azure. Existing Chef/Puppet

Ready to go!Your existing Puppet toolkit is now ready to manage resources on Azure

Resources for learning about Puppet:https://puppetlabs.com/ Puppet Resource Guide for Azure:http://puppetlabs.com/sites/default/files/Getting-Started-Guide-Puppet-Enterpise-Azure.pdf Managing DSC resources using Puppet: Community

module in Puppet Forge : https://forge.puppetlabs.com/msutter/dsc

Page 28: New to Chef and Puppet ? Overview of Chef and Puppet and how they can automate infrastructure and application deployment on Azure. Existing Chef/Puppet

Wrap up

Others tools that we should integrate with Azure?

Thank you!

Page 29: New to Chef and Puppet ? Overview of Chef and Puppet and how they can automate infrastructure and application deployment on Azure. Existing Chef/Puppet

© 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.