VMware

Developer Center Blog

VMware Developer Blog provides content for the VMware Developer Community.

7 Posts tagged with the sample tag
0

We wanted to let you know we ran a very successful vSphere SDK lab at [Partner Exchange / Tech Exchange a few weeks ago in Orlando. For those of you who missed the event, I'm posting the manuals and code files. Going through the lab is a great way to get started with the API and includes handy sample code for modification or inclusion in your own programs.

{youtube}http://www.youtube.com/watch?v=paGqr9SWl-4{youtube}

The lab covers both the Java and C# versions of the VI SDK and uses the vSphere Web Services SDK 4.0 (formerly VI SDK 4.0). Though the lab doesn't cover any vSphere-specific features, I haven't tested it with VI SDK 2.5 and it will probably require some minor modification. For scripters that would prefer an introduction to the vSphere Perl SDK (formerly the VI Perl Toolkit) or the vSphere PowerCLI (formerly VI Toolkit for Windows), I posted a similar lab for those in an earlier blog post.

Exercises cover all the basics for using the SDK:
* Understanding managed objects and data objects
* Connecting to the VI API webservice
* getting the properties of managed objects using the PropertyCollector
* Using the SearchIndex
* Finding objects using TraversalSpecs
* Finding objects based on arbitrary criteria
* Collecting properties of multiple objects at the same time
* Understanding performance differences in some basic property collection strategies
* Monitoring properties for changes
* Monitoring tasks for completion
* Gathering performance statistics

There's obviously a lot more to do in the SDK, but once you've mastered those basic skills, most of the rest of the SDK is just an extension of what you already know. The exercises on collecting multiple objects properties at the same time and understanding performance differences due to property collector strategies cover some common problems I see with the management ecosystem partners I handle and are a great review for anyone trying to make sure their SDK code scales well.

A few things to note: I didn't update the doc with the new names of the various API components... I wrote the lab while those names were still under development. Also, I want to thank the other folks who helped put this lab together: Balaji Parimi (who wrote the Java code), Rajesh Kamal (who wrote the C# code), Alton Yu, John Kennedy, Paul Vasquez, and Steve Jin.

While most of the code handles errors gracefully and follows best practices, I’d like to point out that the code here is designed to teach concepts, not to be “enterprise ready”.

0 Comments Permalink
4

Hello, my name is David Deeths and I’m a new contributor to the VMware Developer Blog. I wanted to share with the community the scripting lab we put together for VMworld 2008. This is a great introduction to scripting with the VI Toolkits in Perl or PowerShell. The PowerShell version doesn’t require any programming or scripting experience at all.

The labs will help you get started with scripting VMware Infrastructure to enable automation, extensibility, and integration with existing tools. When we ran this at VMworld, we had about 600 attendees and it was so popular some students camped out in line to attend the lab a second time. We had so many folks request a way to share this with their teams that we decided to publish the whole thing for the community.

The lab is available in two versions: one shows how to use the VI Perl Toolkit and the other shows how to use the PowerShell-based VI Toolkit (for Windows). The attached files contain the manuals for both versions of the lab and the exercises for both versions of the lab.

The lab takes 2-3 hours to complete (not including the time to set the environment up first), but is conveniently split into 20 minute exercises. You’ll walk away with a better understanding of VMware Infrastructure, resources for using the toolkits, and a variety of useful scripts for performing common administrative tasks. The exercises cover triggering tasks, examining VM attributes, performing actions on VMs, and exporting performance data.

My team for the lab was phenomenal, and I want to thank Doug Baer, Shridhar Deuskar, Lisa Guinn, Terry Lyons, Aaron Miller, Alket Memushaj, Owen Thomas, Brian Watrous, and Alton Yu for building this exceptional lab.

If you don’t have gear to try this out on or if you want more lab opportunities, a similar lab is in the works for VMworld EMEA (Cannes, February 24-26). For Technology Exchange (Orlando, April 14-17), we’re looking into doing a lab focused more on professional-developers that covers the VI SDK using Java and C#.

Enjoy!

PS. I’d like to point out that the code here is designed to teach concepts, not to be “enterprise ready”. Things like error checking have been kept to a minimum so concepts covered in each exercise are as easy as possible to understand. The lawyers have asked that I inform you that the sample code is provided "AS-IS" for use, modification, and redistribution in source and binary forms, provided that the copyright notice and this following list of conditions are retained and/or reproduced in your distribution. To the maximum extent permitted by law, VMware, Inc., its subsidiaries and affiliates hereby disclaim all express, implied and/or statutory warranties, including duties or conditions of merchantability, fitness for a particular purpose, and non-infringement of intellectual property rights. IN NO EVENT WILL VMWARE, ITS SUBSIDIARIES OR AFFILIATES BE LIABLE TO ANY OTHER PARTY FOR THE COST OF PROCURING SUBSTITUTE GOODS OR SERVICES, LOST PROFITS, LOSS OF USE, LOSS OF DATA, OR ANY INCIDENTAL, CONSEQUENTIAL, DIRECT, INDIRECT, OR SPECIAL DAMAGES, ARISING OUT OF THIS OR ANY OTHER AGREEMENT RELATING TO THE SAMPLE CODE.

You agree to defend, indemnify and hold harmless VMware, and any of its directors, officers, employees, agents, affiliates, or subsidiaries from and against all losses, damages, costs and liabilities arising from your use, modification and distribution of the sample code.

VMware does not certify or endorse your use of the sample code, nor is any support or other service provided in connection with the sample code.

4 Comments Permalink
0

Folks,

Just wanted to let everyone know we have moved the great collection of scripts from the PowerShell Scripting contest over to our Community Sample Code site. We also tagged the scripts by language in order to make it a bit easier to find. We will be shutting down the Contest site shortly please update your book marks - This site will be going away -> http://vmware.com/go/powershellcontest pscontest.jpg will be going away.

If you forgot who won our contest or for the folks out there that just want to bathe in glory once again..visit http://blogs.vmware.com/vipowershell/2008/09/announcing-the.html

To see the collection of community sample code, or if you have some very cool code you want to share (it does not have to be in PowerShell:) This site is also linked from the Developer Community http://vmware.com/developer

Visit: http://communities.vmware.com/community/developer/utilities?view=documents communitysamplecode.jpg

0 Comments 0 References Permalink
1

The open source client side Java API for VI can now be found at

http://sourceforge.net/projects/vijava

Thanks!

1 Comments Permalink
0

Folks,

Just wanted to let you know that we have just published a document to help you get started when using the VI Toolkit for Windows.

Document Title: Managing VMware with PowerShell - Frequently Asked Questions.

Document contains frequently asked questions and code samples to help you get going.

A big thank you to the Product Management, Developer Support Engineering and R&D teams who contributed to document. We hope the document is useful, and please feel to comment so we can improve our products.

Link: http://communities.vmware.com/docs/DOC-4210

Regards,

Pablo

0 Comments Permalink
0

Folks latest script added to our library. Script allows users to set the boot preference for a virtual machine.

http://download3.vmware.com/sample_code/Perl/VMBootOrder.html

For complete list of scripts:
http://www.vmware.com/communities/content/developer/samplecode/index.html

Let us know what else you would like to see added...

_P

0 Comments Permalink
2

Welcome to the VMware Developer Center Blog
elsalvi.jpg


Atami Beach, San Salvador

Hello,

Welcome the VMware Developer Center Blog. My name is Pablo Roesch and I am the Product Marketing Manager for the VMware Infrastructure SDKs. My job at VMware is to help empower developers, IT administrators when integrating, and automating with our SDKs.

Before VMware I worked for Sun Microsystems in various roles, most recently responsible for building out the Developer Services Portfolio for the Sun Developer Network. On the personal side I have lived in San Francisco most of my life, and enjoy spending time with my wife and kids. Just in case you are ever in this fine city I would recommend the Slanted Door for dinner and CafeGreco for an after dinner Cappuccino. As a side note I have included a photo of my all time favorite beach in San Salvador which helps me put things into perspective.

It is an exciting time for us at VMware as our SDKs are going through a much needed evolution with recent release of the VI Perl Toolkit 1.5 and upcoming sneak peak of the VI Toolkit for Windows (manage VI using Powershell)

I often get asked what the difference is between the VMware Developer Center and the Developer Community so thought I would bring this up front.

The VMware Developer Center provides information on latest SDK product downloads, knowledge base articles, webinars, questions and answers as expressed by VMware. The Developer Community is how the community interacts with VMware. The VMware Community is where developers, scripters post questions about our SDKs, provide sample code for community use, and comments on our products.

Visit our VMware Developer Center http://vmware.com/developer as we have recently made some much needed improvements to hope you find them helpful.

Navigation: Created a new navigational bar on right hand side, which will help with navigation of our site.

Knowledge Base Articles: Growing list of KB articles, to see current list click here

SDK Questions and Answers: Adding list of frequently asked questions

New webinars and sessions: New sessions posted range Product information to VMworld Sessions.

VMware Sample Code: Ongoing effort to increase our code sample library as requested by our users. Comment or suggestion for Sample Code? Please let us know by answering this quick questionnaire.

We look forward to continuing improvements to our site, please keep the feedback coming !

Pablo Roesch - VMware SDK Product Marketing Manager

Visit the VMware Developer Center: http://vmware.com/developer Latest Downloads, Code Samples, Knowledge Base Articles

2 Comments Permalink

Developer Center Blog

VMware Developer Blog provides content for the VMware Developer Community.

Communities