VMworld 2015/Automate Everything with PowerCLI

From Omnia
Jump to navigation Jump to search

Automate Everything with PowerCLI

by Alan Renouf (VMware), and Luc Dekens (Eurocontrol)

Check the PowerCLI Blog for the code and video

Alan Renouf - http://blogs.vmware.com/PowerCLI and http://virtu-al.net/

  • Started vCheck script

Luc Dekens - http://lucd.info

Cmdlets

New cmdlets - vRealize Operations Manager

Low level API access - view access

Next build high level cmdlets on top of the low level APIs

Get-VM Photon01 | Get-OMResource
Get-VM Datastore | Get-OMResource | Where { $_.Health -ne "Green" }
Get-VM Datastore | Get-OMResource | Where { $_.Health -ne "Green" } | Get-OMAlert | FT -AutoSize
... | Where { $_.value -gt 30 } | FT -AutoSize
$global:DefaultOMServers
$global:VIServers
$global:DefaultOMServers | Select *
$global:DefaultOMServers[0].???  ??? get-member ???

Released a FLING that has the NFS User Cmdlets

Flings are where a lot of our innovations go into - show off to customers

vCloud Air

Key to VMware's future

$CI = Get-PIComputeInstance -Region *cali* | Where { $_.ServiceGroup -match "MT87..." }
$CI | Connect-CIServe
$VVM = Get | Select Name, ....
$emptyarray = @()

Note: look into calculated properties

github

http://github.com/alanrenouf/vAudit-vCloudAir

Update Manager

Update Manager now included in core installer

Backwards compatibility to VUM 5.5

Technical preview - not generally available yet

DSC & vSphere

"Shut up and automate everything"

Desired State Configuration (DSC)

  • define your configuration
  • set it and forget it
  • A watch dog for configurations

Use at least PowerShell v5

DSC Pull Server - don't install on vCenter server, place on another server

Powershell can now work with disconnected sessions

REST API

Best Practices for working with REST APIs

Tools to help:

  • Chrome - advanced rest client
  • Fiddler
  • Postman ?