Upload
alan-renouf
View
1.403
Download
7
Tags:
Embed Size (px)
DESCRIPTION
The presentation given at the Dutch VMUG in 2010 by Alan Renouf and Luc Dekens
Citation preview
POWERCLI IS FOR ADMINISTRATORSLUC DEKENSALAN RENOUF
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
• 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
• 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
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
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 !
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
Automating vCenter
The vCenter is a complex structure
• Datacenters• Folders• Roles• Permissions• Alarms• …
DEMO
Folder structure
Export-Folders "Blue" "DC1" "C:\BlueFolders.csv"
Import-Folders -FolderType "blue" -DC "DC2" `-Filename "C:\BlueFolders.csv"
Alarms
• Alarm = Complex Managed Object• No export/import cmdlets• Serialising/deserialing objects • Simple solution !
DEMO
vCenter database backup & restore
• PowerShell is the universal language !• As part of the migration• … or as a part of your DR procedure
DEMO
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
Reporting
• Is the entry point for most PowerCLI users• Numerous possibilities !• Example: PCI information
Monitoring
• Most vSphere activity generates events• Normally retro-active• Can be done ‘direct’• Showcase for the integration with WinForms
DEMO
• They are big !• Easy to fold
PowerCLI Poster
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
• 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