dutch vmug 2010 powercli presentation

18
POWERCLI IS FOR ADMINISTRATORS LUC DEKENS ALAN RENOUF [email protected]

Upload: alan-renouf

Post on 21-Dec-2014

1.403 views

Category:

Technology


7 download

DESCRIPTION

The presentation given at the Dutch VMUG in 2010 by Alan Renouf and Luc Dekens

TRANSCRIPT

Page 1: Dutch VMUG 2010 PowerCLI Presentation

POWERCLI IS FOR ADMINISTRATORSLUC DEKENSALAN RENOUF

[email protected]

Page 2: Dutch VMUG 2010 PowerCLI Presentation

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

Page 3: Dutch VMUG 2010 PowerCLI Presentation

• PowerShell is for System Administrators• PowerShell is the universal language for Windows datacenters• GUI interfaces are single purpose and rigid• Microsoft Common Engineering Criteria program• Cmdlets are in a Verb-Noun format

• Microsoft making admin tasks PowerShell enabled– Exchange– SQL Server– IIS 7– More

• PowerShell is the Glue between your infrastructure

What is PowerShell

Page 4: Dutch VMUG 2010 PowerCLI Presentation

• PowerCLI is a Snapin for PowerShell• PowerCLI 4.1 U1 adds 258 cmdlets to PowerShell• PowerCLI is built on the vSphere APIs• PowerCLI is for all your vSphere administration tasks

• Active Community: PowerShell and PowerCLI

What is PowerCLI

Page 5: Dutch VMUG 2010 PowerCLI Presentation

VMware vSphere PowerCLI Reference: Automating vSphere Administration

Introduction1 Automating vCenter Deployment and Configuration2 Automating ESX/ESXi Server Deployment and Configuration3 Automating Storage and Networking4 Using Advanced vSphere Features5 Creating virtual machines6 Templates and Customisation Specifications7 Configuring Virtual Machine Hardware8 Advanced Virtual Machine Features9 Using vApps10 Backup and Restore your Virtual Machines11 Organize your Disaster Recovery12 Hardening the vSphere Environment13 Maintain Security in Your vSphere Environment 14 Report the Status of Your vSphere Environment15 Using Statistical Data 16 Monitoring the vSphere Environment17 Auditing the vSphere Environment18 Schedule Automation Scripts19 The SDK20 The Onyx Project 21 PowerGUI and vEcoShell22 PowerWF Studio23 Add a GUI Frontend to Your Automation ScriptsAppendices

• Luc Dekens• Alan Renouf• Arnim Van Lieshout• Jonathan Medd• Glenn Sizemore

• Released early 2011

• Today's examples are from the book

Page 6: Dutch VMUG 2010 PowerCLI Presentation

Today's Scenario

A DR site needs to be setup as our current DC keeps getting snowed in.

Our pointy haired manager has bought us a Vblock in a hosted DC and now we need to set it up.

We have drawn a quick outline of the things we need to do and automate the process so if things go wrong in live we can minimise the amount of downtime to our production systems.

Our Mission is to build a virtual environment in an hour - and show you !

Page 7: Dutch VMUG 2010 PowerCLI Presentation

Automating ESX Hosts

Initial Config• 80% - 90% configuration included in installation• Linux Kickstart

Post config• %post%• Host Profiles (Ent +) - $$$$• PowerCLI

• Storage• Networking• Advanced Features

DEMO

Page 8: Dutch VMUG 2010 PowerCLI Presentation

Automating vCenter

The vCenter is a complex structure

• Datacenters• Folders• Roles• Permissions• Alarms• …

DEMO

Page 9: Dutch VMUG 2010 PowerCLI Presentation

Folder structure

Export-Folders "Blue" "DC1" "C:\BlueFolders.csv"

Import-Folders -FolderType "blue" -DC "DC2" `-Filename "C:\BlueFolders.csv"

Page 10: Dutch VMUG 2010 PowerCLI Presentation

Alarms

• Alarm = Complex Managed Object• No export/import cmdlets• Serialising/deserialing objects • Simple solution !

DEMO

Page 11: Dutch VMUG 2010 PowerCLI Presentation

vCenter database backup & restore

• PowerShell is the universal language !• As part of the migration• … or as a part of your DR procedure

DEMO

Page 12: Dutch VMUG 2010 PowerCLI Presentation

Creating Virtual Machines• Automated VM Creation• Interaction with the guest OS

• WMI• PowerShell Remoting• Invoke-VMScript

• Testing VMotion and SVMotion• Move-VM

• Backups

Automating Virtual Machines

DEMO

Page 13: Dutch VMUG 2010 PowerCLI Presentation

Reporting

• Is the entry point for most PowerCLI users• Numerous possibilities !• Example: PCI information

Page 14: Dutch VMUG 2010 PowerCLI Presentation

Monitoring

• Most vSphere activity generates events• Normally retro-active• Can be done ‘direct’• Showcase for the integration with WinForms

DEMO

Page 15: Dutch VMUG 2010 PowerCLI Presentation
Page 16: Dutch VMUG 2010 PowerCLI Presentation

• They are big !• Easy to fold

PowerCLI Poster

Page 17: Dutch VMUG 2010 PowerCLI Presentation

VMware vSphere Automation 2 day instructor led course, 40% Lecture, 60% hands on labAvailable worldwide, use PSO creditshttp://vmware.com/go/vsphereautomation

VMware Scripting and SDK SupportDedicated help when developing scripts / applicationsExpert API engineers happy to help http://vmware.com/go/sdksupport

Support and Training

Page 18: Dutch VMUG 2010 PowerCLI Presentation

• Do you use PowerCLI ?• Why not ?• What is holding you back ?

• Are you blocked in a PowerCLI script ?• Do you have tasks you cant do with PowerCLI ?

Q & A