+ All Categories
Home > Technology > PowerCLI & Onyx

PowerCLI & Onyx

Date post: 19-Jun-2015
Category:
Upload: alan-renouf
View: 1,374 times
Download: 11 times
Share this document with a friend
Description:
A slide deck presented on the 8th October to a select audiance in London, visit Virtu-al.net for more information
Popular Tags:
28

Click here to load reader

Transcript
Page 1: PowerCLI & Onyx

© 2009 VMware Inc. All rights reserved

PowerCLI & Onyx

Vladimir Goranov, Manager R&D, Resource & Policy Management

Yavor Boychev, Manager R&D, VIM Platform and Solutions QA

Page 2: PowerCLI & Onyx

2

Agenda

� VMware vSphere ТМ PowerCLI

� Tips and tricks

� VMware Project Onyx

� Q&A

Page 3: PowerCLI & Onyx

3

Disclaimer

�This session may contain product features that are currently under development.

�This session/overview of the new technology represent s no commitment from VMware to deliver these features in any generally available product.

�Features are subject to change, and must not be inclu ded in contracts, purchase orders, or sales agreements of any k ind.

�Technical feasibility and market demand will affect final delivery.

�Pricing and packaging for any new technologies or feat ures discussed or presented have not been determined.

“THESE FEATURES ARE REPRESENTATIVE OF FEATURE AREAS UNDER DEVELOPMENT. FEATURE COMMITMENTS ARE SUBJECT TO CHA NGE, AND MUST NOT BE INCLUDED IN CONTRACTS, PURCHASE ORDERS, OR SALES

AGREEMENTS OF ANY KIND. TECHNICAL FEASIBILITY AND M ARKET DEMAND WILL AFFECT FINAL.”

Page 4: PowerCLI & Onyx

4

VMware vSphere ТМ PowerCLIWindows PowerShell interface for managing vSphereTM

Page 5: PowerCLI & Onyx

5

VMware vSphere ТМ PowerCLI

PowerCLI will save you a ton of time.

PowerCLI is the easiest way to automate.

PowerCLI will help you identify problemsbefore they become crises.

PowerCLI can automate anything you careabout in your virtual environment.

PowerCLI lets you make large scale changesin a consistent and auditable way.

Page 6: PowerCLI & Onyx

6

VMware vSphere ТМ PowerCLI

� Official communityhttp://vmware.com/go/powershell

• Registered users - 1 382

• Discussions - 2 481

• Documents - 48

� Official bloghttp://blogs.vmware.com/vipowershell/

• Blog posts - 125

• Comments - 177

� Extensions projecthttp://vitoolkitextensions.codeplex.com/

• More than 100 functions

• Page views - 118 577

• Visits - 15 261

• Downloads - 3 638

Page 7: PowerCLI & Onyx

7

VMware vSphere ТМ PowerCLI

� Blog ecosystem

• http://blogs.vmware.com/vipowershell

• http://www.van-lieshout.com/powercli

• http://get-admin.com/blog

• http://ict-freak.nl

• http://www.lucd.info

• http://www.ntpro.nl/blog

• http://poshoholic.com

• http://professionalvmware.com

Page 8: PowerCLI & Onyx

8

VMware vSphere ТМ PowerCLI

� Software ecosystem

• PowerGUI - http://powergui.org

• PowerShell Plus - http://www.idera.com

• PowerWF for VMware - http://powerwf.com

• VI PowerScripter - http://www.icomasoft.com

• vEcoShell -http://vcommunity.vizioncore.com/administration/vec oshell/default.aspx

Page 9: PowerCLI & Onyx

9

VMware vSphere ТМ PowerCLI

� Books

…and more coming

Page 10: PowerCLI & Onyx

10

Resources

Developer Support

• Dedicated support for your organization when building solutions using vSphere APIs, PowerCLI, vSphere Web Services SDKs and many more VMware SDKs

• http://vmware.com/go/sdksupport

PowerCLI Training

• 2 day instructor led training, 40% lecture, 60% lab

• http://vmware.com/go/vsphereautomation

VMware Developer Community

• SDK Downloads, Documentation, Sample Code, Forums, Blogs

• http://developer.vmware.com

Technology Alliance Partner (TAP) Program

• Updated partner benefits

• http://www.vmware.com/partners/alliances/programs/

Page 11: PowerCLI & Onyx

11

VMware vSphere ТМ PowerCLI

� Large and Small customers around the world in differen t industry areas

• Education

• Energy

• Finance

• Government

• Health Care

• Manufacturing

• Retail

• Transportation

� Roadmap and solutions exposure

Page 12: PowerCLI & Onyx

12

Tips and TricksThe art of being efficient

Page 13: PowerCLI & Onyx

13

It’s a fact: PowerCLI does cover the entire vSphere API !

� PowerCLI introduces over 225 cmdlets

and 170 automation objects

•Designed to be fast and easy to use

•vSphere API has close to 500 operations and over 2000 objects

� .Net toolkit expose the entire vSphereAPI

•Client side .Net library distributed with PowerCLI

•Could be used in .Net applications and Powershell scripts

•Powershell interface – Get-View cmdlet

� Get started with .Net toolkit

Page 14: PowerCLI & Onyx

14

Retrieving views in PowerCLI

� Get-View – the entry point to the .Net toolkit

� View – static copy of a server side managed object

Page 15: PowerCLI & Onyx

15

Retrieving views in PowerCLI – performance impact

# Retrieve views for several vms filtered by PowerState

Get-VM | Where {$_.PowerState -eq "PoweredOn"} | Get-View

VS

Get-View -ViewType "VirtualMachine" `

-Filter @{"Runtime.PowerState" = "PoweredOn"} √

Page 16: PowerCLI & Onyx

16

# Interested only in few of the view properties?

Get-View -ViewType “VirtualMachine”

VS

Get-View -ViewType “VirtualMachine” `

-Property “Name” , “Runtime.PowerState” √

Increase performance when retrieving view objects

WOW !

Specifying property parameter is ~2000% faster on 100 vms

Page 17: PowerCLI & Onyx

17

� MoRef - Managed Object Reference

� Most API method invocations require MoRef as a parameter

MoRefs made easier in PowerCLI 4.1 !

# Retrieve MoRef from the view object

$vm = Get-VM “MyVm”

$vmView = $vm | Get-View

$_this = Get-View -Id ‘ScheduledTaskManager’

$_this.CreateScheduledTask($vmView.MoRef, $spec)

# Using object’s Id where MoRef is needed

$vm = Get-VM “MyVm”

$_this = Get-View -Id ‘ScheduledTaskManager’

$_this.CreateScheduledTask($vm.Id, $spec)

Page 18: PowerCLI & Onyx

18

Increase your scripts performance by reducing OBN c alls

� Object By Name selection (OBN)

Start-VM "PsDemo"

Start-VM -VM (Get-VM -Name "PsDemo")

Page 19: PowerCLI & Onyx

19

� Object By Name selection (OBN)

Start-VM "PsDemo"

...

Update-Tools "PsDemo"

...

New-Snapshot -Name "UpdatedTools" -VM "PsDemo"

...

Stop-VM "PsDemo"

Increase your scripts performance by reducing OBN c alls

Page 20: PowerCLI & Onyx

20

� Object By Name selection (OBN)

Start-VM -VM (Get-VM -Name "PsDemo")

...

Update-Tools -VM (Get-VM -Name "PsDemo")

...

New-Snapshot -Name "UpdatedTools" -VM `

(Get-VM -Name "PsDemo")

...

Stop-VM (Get-VM -Name "PsDemo")

Increase your scripts performance by reducing OBN c alls

Page 21: PowerCLI & Onyx

21

� Object By Name selection (OBN)

$psDemo = Get-VM -Name "PsDemo"

Start-VM $psDemo

...

Update-Tools -VM $psDemo

...

New-Snapshot -Name "UpdatedTools" -VM $psDemo

...

Stop-VM $psDemo

Increase your scripts performance by reducing OBN c alls

Page 22: PowerCLI & Onyx

22

VMware Project OnyxWhat is happening behind the covers

Page 23: PowerCLI & Onyx

23

What is Project Onyx?

� Serves as a proxy between vSphere Client and vCenter Server

� Monitors the network communication and translates it into a reusable Powershell code

vSphere Client vCenter ServerOnyx

Page 24: PowerCLI & Onyx

24

Onyx history

� VMWorld 2009 San Francisco - Onyx announced as a prototype

� November 2009 – Onyx available for download as Technology preview on blogs.vmware.com

� January 2010 – Official launch of Onyx community forum: vmware.com/go/onyx

� Vmworld 2010 San Francisco Onyx 2.0 released

• C# 2.0 and raw SOAP messaging code generation

• Connection usability enhancements

• Configurable obfuscation of methods with sensitive data

Page 25: PowerCLI & Onyx

25

Demo scenario

a

Create Scheduled Task

Page 26: PowerCLI & Onyx

26

Demo scenario

a

Modify code

PowerCLI

Page 27: PowerCLI & Onyx

27

Demo scenario

� Execute script

a

Scheduled Tasks created

Page 28: PowerCLI & Onyx

28

Q&AIts your time


Recommended