4 Ways to WIN $2,500 Prize With vSphere Java API
You may have read blogs from my colleagues Mike DiPetrillo, Duncan Epping about the VMware Script-O-Mania contest. The prizes are $2,500 (1st), $1,000 (2nd), and $500(3rd) respectively. The contest ends in March 15, 2010. So act quickly!
“Wait, how can I WIN the prizes?”
Time to learn how to "Google" and manage your VMware and clouds in a fast and secureHTML5 App
Well, first of all, you want to read carefully the criteria. Note that your script is for System Administrators with ESXi. So it could be for initial server set up, health monitoring, trouble shooting, reporting auditing, or anything else that is cool and creative. I suggest you talk to system administrators what REAL PAINS they have, and how they would like to fix the problems.
When you are clear what problems to solve, then let’s move on.
If you are already familiar with PowerCLI and RCLI, you should probably stick with them. You can get helps from VMware Developer Community.
If not, open source VI Java API can help you!
Here are 4 ways the API can do for you to win the $2,500:
#1. You can write program in Java on top of the VI Java API. Just download the VI Java API and plug it into any Java IDE. Here are the resources you may need: Get Started Tutorial, Download, 50+ Samples.
Have a question? Try our forum. It’s been pretty active.
Not yet convinced it’s a right choice? Check out what others say about it.
#2. You can write real scripts in Jython. To get started, you can check out my presentation. Timo Sugliani contributed a virtual appliance with everything packaged. Here are a little more instructions copied my last October announcement.
To run the virtual appliance, you will need either VMware Workstation, VMware Server or VMware Player. The later two are free products from VMware Download Site.
After compressed to RAR format, the virtual appliance is about 600M. After downloading the virtual appliance here, you can uncompress it to a folder using free 7-Zip or other tools. Double chicking the .vmx file will bring up the Virtual Applicance. The initial username/password is vijava/vijava. You can and should change your credential after first login.
In the home directory in the virtual appliance, there is an existing jython sample code. You can open it with any editor. My recommendation is vim which can highlight the syntax with different colors.
The sample code is really simple, it iterates through the hosts and virtual machines, and print out related information. It doesn’t run as it is because it doesn’t know your target server (ESX/VC/VMware Server 2.0+) host name or IP address, and username/password. All you need to do is to replace the XXX strings in one line of the sample code to match your environment. When you are done, just run it:
Want more samples? I need to ping Timo and his colleague David for their helps.
#3. OK. Since you read this far, I know you are probably not a Java or Python/Jython guy. How about Groovy, jRuby or Scala or any languages listed here?. If so, you need to do a little more research by yourself on how to set up the environment and call into VI Java API.
#4. If you are here, I assume it’s not the language that is in concern. Maybe you concern about the size of your script? No problem. Check the tiny client REST API I blogged yesterday. It’s all open sourced under BSD license just like other part of the API. Please feel free to port it to any languages you are comfortable with, for example C# which we haven’t talked above but is a good choice as well.
Now I am done my part. It’s now your turn to give it a try. Any question on using the API, just ask a help here, or leave a comment.
Please let me know when you win the prize because of this blog, and I can feature you on our VI Java API project home.