• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
TA6944 PowerCLI is for Administrators!
 

TA6944 PowerCLI is for Administrators!

on

  • 3,417 views

The presentation given at VMworld San Francisco and Copenhagen by Alan Renouf and Luc Dekens

The presentation given at VMworld San Francisco and Copenhagen by Alan Renouf and Luc Dekens

Statistics

Views

Total Views
3,417
Views on SlideShare
2,914
Embed Views
503

Actions

Likes
2
Downloads
0
Comments
0

6 Embeds 503

http://www.virtu-al.net 294
http://xtravirt.com 194
http://www.linkedin.com 10
http://static.slidesharecdn.com 3
http://www.netvibes.com 1
http://feeds2.feedburner.com 1

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • I propose we introduce each other. Then they can’t accuse us of bragging ;-)
  • This is where we start the actual scenario.One of us says he was tasked by his mgmt to provision X-number of machines for a new project.The other remarks, that meant overtime, clicking away in the vSphere client.Answer is that it was a piece of cake with the help of PowerCLI.This is where we could use some audience participation!Mgmt remarked if that PowerCLI would be easy.You tell them that it is so simple that it’s nearly as if your reading an English text.Some examples on screen and ask the audience if they know what the line is supposed to do ?Even mgmt could read it.Do we dare ask if there are managers in the audience (?)Then we show a video with the baby-maker:Specs for the new machines in a spreadsheetDeploy the new machinesShow the option of scheduling the deployment by a max number of parallel tasks.
  • This is where we start the actual scenario.One of us says he was tasked by his mgmt to provision X-number of machines for a new project.The other remarks, that meant overtime, clicking away in the vSphere client.Answer is that it was a piece of cake with the help of PowerCLI.This is where we could use some audience participation!Mgmt remarked if that PowerCLI would be easy.You tell them that it is so simple that it’s nearly as if your reading an English text.Some examples on screen and ask the audience if they know what the line is supposed to do ?Even mgmt could read it.Do we dare ask if there are managers in the audience (?)Then we show a video with the baby-maker:Specs for the new machines in a spreadsheetDeploy the new machinesShow the option of scheduling the deployment by a max number of parallel tasks.
  • Changes in the project, new HW is introduced.Part of the guests has to be moved to new clusters/new datastores.It’s easy to ‘motion’ guests with PowerCLIVideo:Complex selection criteriaPart of the guests are already running, we show vMotionPart of the guests have to go to other storage, we show svMotion
  • Changes in the project, new HW is introduced.Part of the guests has to be moved to new clusters/new datastores.It’s easy to ‘motion’ guests with PowerCLIVideo:Complex selection criteriaPart of the guests are already running, we show vMotionPart of the guests have to go to other storage, we show svMotion
  • One remarks, this is all very well, but there is still quite a console work involved (starting scripts, opening the resulting logs/reports).The other one answers, that why I used a Gui to do all this.Video:How to add the scripts to the GuiHow to run themHow to see the resultsThe Europe branch needs to do something similar.Avoid sending all the scripts and instructions, create a PowerPack.Video:How to create a PowerPackHow you can update a PowerPack
  • Project requires PVLANs.Not yet available in PowerCLI, but that’s where we show how to use the SDK APIsVideo:- Where is the SDK information and how to use itCreate functions for working with dvSwitches and PVLANs (can you use a module in a PowerPack ?)Perhaps we can also include some New-VIProperty stuff in here ?
  • Project requires PVLANs.Not yet available in PowerCLI, but that’s where we show how to use the SDK APIsVideo:- Where is the SDK information and how to use itHow to go from PowerCLI objects to SDK objectsCreate functions for working with dvSwitches and PVLANs (can you use a module in a PowerPack ?)Perhaps we can also include some New-VIProperty stuff in here ?
  • Mgmt wants to know where the project’s at. That means reports need to be produced.Video:Show how to find what is available (Get-Member)Different ways the reports can be scheduledPerhaps show the strength of PowerShell by using my Export-Xls function in here. Show how simple it is to interface with other products.
  • Mgmt wants to know if there is a need for new HW. This means capacity reports.Solution is the Get-Stat cmdletVideo:We show how CPU usage increased over a period of time on a cluster. From there we can make predictions.Similar thing for storage (add a joke that you want to sell storage since you’re a vExpert)What network traffic is the project generating ?
  • The audit team wants to know how secured/hardened the environment is.We show how we automated the hardening of the ESX(i) host through scripts.The auditors want to know if we can show any changes to the environment.We can produce a report that shows the permissions (principals and roles).We show a report that lists for example all portgroup changes to a specific set of guests over a specific period.
  • The project nears completion, the operators need to monitor the environment.PowerShell is present in SCOM 2007 R2. It’s simple to integrate (agentless, based on SNMP traps)Video:We show how to configure SNMP on the ESX(i) hostsWe show how to monitor the hosts in SCOMWe also show how vCenter can be integrated.We show a sample how generate a SCOM mgmt pack with the help of PowerWF Studio

TA6944 PowerCLI is for Administrators! TA6944 PowerCLI is for Administrators! Presentation Transcript

  • VMworld 2010 - San Francisco - TA6944PowerCLI is for Administrators!
    Alan Renouf & Luc Dekens
  • Who Are we ?
    Alan
    • vExpert 2009 & 2010
    • EMC vSpecialist
    • Blog http://www.virtu-al.net/
    • Podcast http://get-scripting.blogspot.com/
    Luc
    • vExpert 2009 & 2010
    • Eurocontrol Maastricht
    • Blog http://lucd.info/
    • LucD on the VMTN PowerCLI community
  • Agenda
    • Introduction
    • Request 1: Deploy guests
    • Request 2: Move the guests around
    • Request 3: Simplify through GUI
    • Request 4: Network update
    • Request 5: Report on what is there
    • Request 6: Capacity planning
    • Request 7: Visit of the auditors
    • Request 8: Single-pane-of-glass
  • Introduction
    • PowerCLI is for all your vSphere administration tasks
    • PowerCLI is extended with each release
    • PowerCLI is build on the vSphere APIs
    • Easy to call other public APIs
    • PowerShell is the ‘lingua franca’ for Windows datacenters
    • Active Community: PowerShell and PowerCLI
  • Agenda
    • Introduction
    • Request 1: Deploy guests
    • Request 2: Move the guests around
    • Request 3: Simplify through GUI
    • Request 4: Network update
    • Request 5: Report on what is there
    • Request 6: Capacity planning
    • Request 7: Visit of the auditors
    • Request 8: Single-pane-of-glass
  • Deploy guests 1
    • First step in life-cycle management
    • New or from a template
    • Number of clicks in the vSPhere client
    • PowerCLI helps to automate this process
    DEMO
  • Deploy guests 2
    Import-Csv C:TempServers.csv | Foreach {
    New-VM –Name $_.Name `
    -VMHost (Get-VMHost virtuesx1*) `
    -Datastore (Get-Datastore ix2*) `
    -DiskMB $_.OSDisk `
    -MemoryMB $_.Mem `
    -NumCpu $_.NumCPU `
    -Location (Get-Folder $_.Project) `
    -RunAsync
    }
  • Agenda
    • Introduction
    • Request 1: Deploy guests
    • Request 2: Move the guests around
    • Request 3: Simplify through GUI
    • Request 4: Network update
    • Request 5: Report on what is there
    • Request 6: Capacity planning
    • Request 7: Visit of the auditors
    • Request 8: Single-pane-of-glass
  • Move guests 1
    • Selecting guests
    • Complicated selection criteria
    • vMotion
    • svMotion
  • Move guests 2
    # vMotion
    Move-VM –Name ACME-DC01 `
    -Destination (Get-Cluster Cluster01)
    # svMotion
    Move-VM –Name ACME-DC01 `
    -Datastore (Get-Datastore DS1)
  • Agenda
    • Introduction
    • Request 1: Deploy guests
    • Request 2: Move the guests around
    • Request 3: Simplify through GUI
    • Request 4: Network update
    • Request 5: Report on what is there
    • Request 6: Capacity planning
    • Request 7: Visit of the auditors
    • Request 8: Single-pane-of-glass
  • GUI
    • Still a lot of typing involved
    • vEcoShell/PowerGUI
    • PowerPacks: collection of actions
  • Agenda
    • Introduction
    • Request 1: Deploy guests
    • Request 2: Move the guests around
    • Request 3: Simplify through GUI
    • Request 4: Network update
    • Request 5: Report on what is there
    • Request 6: Capacity planning
    • Request 7: Visit of the auditors
    • Request 8: Single-pane-of-glass
  • Network update 1
    • Change portgroups and VLAN
    • Distributed switches: not yet available
    • Use vSphere APIs to extend your options
    • vSphere API Referenceis indispensable!
    • And Onyx can guide you!
  • Network update 2
  • Network update 3
  • Network update 4
  • Network update 5
    function New-dvSwPVLAN{
    param($dvSw, $primaryNr, [int[]] $secondaryNr, [string[]] $secondaryType)
    $spec = New-Object VMware.Vim.VMwareDVSConfigSpec
    # Primary
    $pvlan = New-Object VMware.Vim.VMwareDVSPvlanConfigSpec
    $pvlan.operation = "add"
    $pvlan.pvlanEntry = New-Object VMware.Vim.VMwareDVSPvlanMapEntry
    $pvlan.pvlanEntry.primaryVlanId = $primaryNr

    $taskMoRef = $dvSw.ReconfigureDvs_Task($spec)

    }
    Full script on http://lucd.info
  • Agenda
    • Introduction
    • Request 1: Deploy guests
    • Request 2: Move the guests around
    • Request 3: Simplify through GUI
    • Request 4: Network update
    • Request 5: Report on what is there
    • Request 6: Capacity planning
    • Request 7: Visit of the auditors
    • Request 8: Single-pane-of-glass
  • reporting
    • First encounter with PowerCLI for most
    • The information is out there
    • Know what is available
    • PowerCLI 4.1 introduced new features:
    • the ExtensionDataproperty
    • The New-VIPropertycmdlet
    • Use the PowerShell to create different types of files
    • Builtin: CSV, Html, text…
    • COM interface: Office documents (Visio, Word, Excel)
  • Agenda
    • Introduction
    • Request 1: Deploy guests
    • Request 2: Move the guests around
    • Request 3: Simplify through GUI
    • Request 4: Network update
    • Request 5: Report on what is there
    • Request 6: Capacity planning
    • Request 7: Visit of the auditors
    • Request 8: Single-pane-of-glass
  • Capacity planning 1
    • vSPhere has historical statistical data
    • Get-Stat is your friend!
    • Know what is available
    • How to get the data in the format you want
    • Create Office documents from PS through COM objects
  • Statistical intervals
    Full article on http://lucd.info
  • Find the metrics 1
  • Find the metrics 2
  • Capacity planning 2
    • Think before you write the script
    • Use PowerShell to your advantage
    • Group-Object is your friend!
    • Use COM to produce Office documents
  • Capacity planning 3
  • Capacity planning 4
    Export-Xls -Path $fileName -WorksheetName "Memory" -ChartType "xlLine"
  • Agenda
    • Introduction
    • Request 1: Deploy guests
    • Request 2: Move the guests around
    • Request 3: Simplify through GUI
    • Request 4: Network update
    • Request 5: Report on what is there
    • Request 6: Capacity planning
    • Request 7: Visit of the auditors
    • Request 8: Single-pane-of-glass
  • Audit 1
    • vSPhere keeps track of tasks and events
    • Know what is available
    • How to get at the information?
  • Audit 2
    Script to CSV
    vSphere API Reference
  • Audit 3
  • Audit 4
  • Agenda
    • Introduction
    • Request 1: Deploy guests
    • Request 2: Move the guests around
    • Request 3: Simplify through GUI
    • Request 4: Network update
    • Request 5: Report on what is there
    • Request 6: Capacity planning
    • Request 7: Visit of the auditors
    • Request 8: Single-pane-of-glass
  • Single pane of glass
    • Integrate with your monitoring tool
    • PowerShell is in SCOM 2007 R2
    • Roll your own scripts
    • Use PowerWF Studio to create a Management Pack
  • Conclusion
    • PowerCLI covers all your vSphere administration tasks
    • Easy access to the Web Services
    • PowerShell is omnipresent
    • Easily integrates with your Windows environment
    • Access .Net, Office, Back-Office… features/components
  • Book
    • We are writing a PowerCLI book
    • A ‘practical’ book
    • 4 vExperts and a MVP !
    • Available: 2011 Q1
  • Links & references
    • PowerCLI
    • Update Manager
    • Onyx
    • PowerCLI Community
    • PowerCLI Blog
    • vEcoShell
    • PowerWFStudio
    • Podcasts: Get-Scripting & PowerScripting
  • PowerCLI Poster
    • They are big !
    • Easy to fold
    • Plenty for everyone !
  • SUPPORT AND TRAINING
    VMware vSphere Automation
    2 day instructor led course, 40% Lecture, 60% hands on lab
    Available worldwide, use PSO credits
    http://vmware.com/go/vsphereautomation
    VMware Scripting and SDK Support
    Dedicated help when developing scripts / applications
    Expert API engineers happy to help
    http://vmware.com/go/sdksupport
  • PowerCLI is for admins!