ser1875bu the power hour - vsphere powercli 10th or ...€¦ · the power hour - vsphere powercli...
TRANSCRIPT
Alan RenoufLuc Dekens
SER1875BU
#VMworld #SER1875BU
The Power Hour -vSphere PowerCLI 10th Birthday Edition
VMworld 2017 Content: Not fo
r publication or distri
bution
• This presentation may contain product features that are currently under development.
• This overview of new technology represents no commitment from VMware to deliver these features in any generally available product.
• Features are subject to change, and must not be included in contracts, purchase orders, or sales agreements of any kind.
• Technical feasibility and market demand will affect final delivery.
• Pricing and packaging for any new technologies or features discussed or presented have not been determined.
Disclaimer
2#SER1875BU CONFIDENTIAL
VMworld 2017 Content: Not fo
r publication or distri
bution
3
VMworld 2017 Content: Not fo
r publication or distri
bution
Agenda
• Humble beginnings
• The path to fame
• What if?
• Community!
• Digging Deep
• It Just Started
4
VMworld 2017 Content: Not fo
r publication or distri
bution
Who are we?
Alan Renouf
– Sr Product Line Manager, VMware
– Personal Blog: http://virtu-al.net/
– vExpert (not awesome enough to be a PowerShell MVP)
– VMTN account: alanrenouf
– Twitter: @alanrenouf
Luc Dekens
– Systems Engineer, Eurocontrol Maastricht
– Personal Blog: http://lucd.info/
– vExpert & PowerShell MVP
– VMTN account: LucD
– Twitter: @Lucd22
5
VMworld 2017 Content: Not fo
r publication or distri
bution
Humble Beginnings
• From 8 cmdlets in the TP to 616 cmdlets in the current
6
VMworld 2017 Content: Not fo
r publication or distri
bution
The Path to Fame
7
Nov2006
PowerShellv1 Beta
1.01.5
VMware Infrastructure Toolkit VMware vSphere PowerCLI VMware PowerCLI
Nov2007
Jul2008
Jan2009
May2009
4.0
Jul2010
4.1
Aug2011
5.0
Sep2012
5.1R1
Sep2013
5.5R1
Sep2014
5.8R1
Mar2015
6.0R1
Mar2016
6.5R1
6.3R1
Nov2016
1.0U1 4.0U1 5.0.1 5.1R2 5.5R24.1U1 6.0R2
6.0R3
Apr2017
6.5.1
6.5.2
VMworld 2017 Content: Not fo
r publication or distri
bution
The Path to Fame
8
Nov2006
PowerShellv1 Beta
1.0 1.5
VMware Infrastructure Toolkit VMware vSphere PowerCLI VMware PowerCLI
Nov2007
Jul2008
Jan2009
May2009
4.0
Jul2010
4.1
Aug2011
5.0
Sep2012
5.1R1
Sep2013
5.5R1
Sep2014
5.8R1
Mar2015
6.0R1
Mar2016
6.5R16.3R1
Nov2016
1.0U1 4.0U1 5.0.1 5.1R2 5.5R24.1U1 6.0R2
6.0R3
Apr2017
6.5.16.5.2
Core Core
DeployAutomation DeployAutomation
ImageBuilder ImageBuilder
License License
Cloud Cloud
Vds Vds
Storage Storage
Cis.Core
HA
PCloud
SDK
vROps
VUM
Common
HorizonView
PowerCLI
StorageUtility
SRM
8 102 120 157 165 237 293 361 400 426 498 528 587 623
VMworld 2017 Content: Not fo
r publication or distri
bution
The path to fame
• IO30 Managing VMware Infrastructure with Windows PowerShell
– First ever PowerCLI presentation
– At VMworld 2007, by Antonio Dias
9
VMworld 2017 Content: Not fo
r publication or distri
bution
The path to fame – First Blog post!
10https://blogs.vmware.com/PowerCLI/2007/09/hello-world-2.html
VMworld 2017 Content: Not fo
r publication or distri
bution
Where are we now?
11
VMworld 2017 Content: Not fo
r publication or distri
bution
VMware PowerCLI 6.x (6.5/6.5.1/6.5.2) Improvements
PS> Whats-New
• New Name - VMware PowerCLI
• No more snapins
• Deploy from the PowerShell Gallery
• Move-VM Now includes Cross vCenter vMotion
• Automate everything in VSAN with lots of new cmdlets
• Independent Disk Management Cmdlets
• VVOL Replication Cmdlets
• New Horizon View Module
• DRS cluster groups and VM/Host rules cmdlets
• SPBM Cmdlets
• Content Library Cmdlet enhancements
• Additional inventory based parameters
VMworld 2017 Content: Not fo
r publication or distri
bution
My, how the community has grown!Thanks to you all.
13
VMworld 2017 Content: Not fo
r publication or distri
bution
Community
• On December 22nd 2007, the VI Toolkit VMTN Community was started
• The VI Toolkit Alpha (build 68764) was made available on December 21st 2007 to early access subscribers
• Until the first official release, VI Toolkit 1.0 on March 11th 2008, this VMTN Community stayed a private community
• Currently the VMTN community for all things PowerCLI is named VMware PowerCLI
• One of the reasons for the success of PowerCLI can be attributed to a very active community
• Automation was becoming more and more popular in IT circles, and System Administrators, with a Windows background, now had a great tool at their disposal
14
VMworld 2017 Content: Not fo
r publication or distri
bution
Community
15
22 December 2007
22 August 2017
11294
5591questions
accepted answer
4399
5141
3.2 ?/day
4.2 ?/business day
Thread Rate
VMworld 2017 Content: Not fo
r publication or distri
bution
Community
16
Avg Answered Time
2.4 days
Shortest Response Time
59 seconds
Longest Response Time
1009 days
Most replies
Most views
166
94303
Top creator
Top replier
TheVMinator215
LucD19663
Thread
VMworld 2017 Content: Not fo
r publication or distri
bution
Community
17
2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017
2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017
Count 7 754 1044 1158 1395 1413 1451 1324 1098 960 690
Threads/Year
374
1760
2292 2266 2276
1916
410
Avg Threads/Day
VMworld 2017 Content: Not fo
r publication or distri
bution
Community
18
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
Count 251 226 212 209 204 216 255 329 419 479 498 472 542 685 871 908 757 645 672 653 640 504 387 260
Avg Threads/Hour
VMworld 2017 Content: Not fo
r publication or distri
bution
Community
19
0
20
40
60
80
100
120
140
160
1 2 3 4 5 6 7 8 9 10 11 12
Th
rea
ds
Month
Threads/Month/Year
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
VMworld 2017 Content: Not fo
r publication or distri
bution
Community
• When you Google PowerCLI, it comes up with an impressive number!
• Funny fact: know to pick your name ☺
20
VMworld 2017 Content: Not fo
r publication or distri
bution
Scripts Revisited
21
VMworld 2017 Content: Not fo
r publication or distri
bution
What if?
• One of the early popular scripts was the “Raiders of the Lost VMX”
• It scanned your datastores to find VMX files for unregistered VMs
• It could take quite a bit of time to scan a datastore (depending on it’s size)
– Time mostly spent in the SearchDatastoreSubFolders method
• What if I told you, we can now make this script run a bit faster!
• It uses the HTTP access method
– Returns all the required info for the script
– Logic more or less the same
22
VMworld 2017 Content: Not fo
r publication or distri
bution
23
VMworld 2017 Content: Not fo
r publication or distri
bution
24
VMworld 2017 Content: Not fo
r publication or distri
bution
VMware is headed towards a REST API
• Since PowerShell v4, we have cmdlet support for calling REST API
• VMware is also providing more and more REST API for their solutions
• Connect-CISServer and Get-CISService cmdlets
– Allow 100% access of the REST APIs
– Session management is easy
– Use the API in a discoverable way
– Expose both properties and methods
• See William’s series on the VAMI REST API:
http://www.virtuallyghetto.com/2017/01/exploring-new-vcsa-vami-api-wpowercli-part-1.html
25
VMworld 2017 Content: Not fo
r publication or distri
bution
26
VMworld 2017 Content: Not fo
r publication or distri
bution
Rest is everywhereWhat else can we do?
27
VMworld 2017 Content: Not fo
r publication or distri
bution
REST API
• REST API are everywhere
– Jive demo
• PowerShell support through Invoke-RestMethod
• No more analyzing HTML
• JSON is easy to use from PowerShell
28
VMworld 2017 Content: Not fo
r publication or distri
bution
What If?
• I published a script, way back, to query the VMTN PowerCLI Community
– Simulated web page queries
– Interpreted HTML page(s) that were returned
– Very Bad!
• Jive does have a REST API
– Invoke-RestMethod
– Script updated, queries way simpler.
– Results returned in JSON format
29
VMworld 2017 Content: Not fo
r publication or distri
bution
30
VMworld 2017 Content: Not fo
r publication or distri
bution
REST API
31
VMworld 2017 Content: Not fo
r publication or distri
bution
REST API
32
• On a side note
– Adapt some coding practices
– For example splatting clean, readable
VMworld 2017 Content: Not fo
r publication or distri
bution
Digging Deep
• By now we all know that we can do a lot more with VMware PowerCLI
– Not only manage Hosts, VM, Datastores…
– We can also manage settings like for example Permissions
• Due to the tree structure of a vSphere environment, and due to Permission inheritance, this can become quite complex
• Solution: recursive walk of the inventory tree!
33
VMworld 2017 Content: Not fo
r publication or distri
bution
34
VMworld 2017 Content: Not fo
r publication or distri
bution
Digging Deep
• For each child call the function again
• … and remember what permissions were set on the parent objects
35
VMworld 2017 Content: Not fo
r publication or distri
bution
36
VMworld 2017 Content: Not fo
r publication or distri
bution
Digging Deep
• For your own ease of mind, and to avoid these “Oops” moments!
• Provide and use WhatIf support in your destructive functions
• It’s easy, it’s built in
37
VMworld 2017 Content: Not fo
r publication or distri
bution
38
VMworld 2017 Content: Not fo
r publication or distri
bution
It Just Started
For more information on what ideas VMware has for PowerCLI in the future attend
SER2529BU
vSphere PowerCLI What’s New: The Next Evolutionary Leap is now!
16:00 – 17:00
Islander C, Lower Level
That’s 30 mins from now so go get in the line!
39
VMworld 2017 Content: Not fo
r publication or distri
bution
Takeaways
1. PowerCLI has come along way – With your help!
2. The community grows from strength to Strength
3. PowerCLI is here to stay and has a bright future!
40
Everything is awesome!
VMworld 2017 Content: Not fo
r publication or distri
bution
VMworld 2017 Content: Not fo
r publication or distri
bution
VMworld 2017 Content: Not fo
r publication or distri
bution