In my previous blog, I talked about the object model of the vSphere API. Many people like the UML diagram that illustrates how the managed objects are inherited from each other.
Following that blog, I will introduce the object model of the open source Java API that is built on top of the Web Services, as well as some key design decisions I made while designing the API.
The following UML diagram is extracted from the overall model but adds much more details with properties and methods. If you can understand this diagram, you can then easily understand all other managed object types. Read more... (568 words, 2 images, estimated 2:16 mins reading time)
I mentioned the vSphere API self paced lab at PEX in my previous blog. Not all the people who are interested in learning the API made it to PEX last month. A reader asked me when it can be online in his comment.
Here is the VI Java API part in the tutorial. We had the environment set up all together for you in the PEX lab including the Eclipse and all the related jar files. So it’s very easy to get started there. Without going to PEX, you need to do something extra by yourself. But that is not too hard at all. I promise it won’t take you much time at all. To get the basic one done, you probably need 5 to 30 minutes depending on your familiarity with Java.
Ready to learn? Read more... (1261 words, 1 image, estimated 5:03 mins reading time)
If you have trouble to understand vSphere API when you first use it, you are definitely not alone. I had the same trouble when I first used it a while back.
Some of the troubles come from the disconnect between conventional programming model and that of vSphere API. In this blog, I summarize the top 5 myths about vSphere API based on my experience and the questions I see in the VMware community forum and vSphere Java API forum:
- Non-existing Managed Objects
- Pervasive PropertyCollector
- Short-Lived Task Object
- “Weak” HostSystem
- “Un-documented” View
Let’s examine each of them one by one. Read more... (734 words, 1 image, estimated 2:56 mins reading time)
When I start to use a new API/SDK, I always look for the object model diagram before digging into the API Reference. With that, I can have a good overview of the API, from the concepts to the structure. This can save a lot of time.
Unfortunately, we don’t find such a object model diagram in any official document. The following is the UML diagram from my book VMware VI and vSphere SDK. Read more... (340 words, 2 images, estimated 1:22 mins reading time)
Last summer, Reflex VP engineering Aaron Bawcom visited VMware campus. He is one of the authors of Virtualization For Security: Including Sandboxing, Disaster Recovery, High Availability, Forensic Analysis, And Honeypotting.
During our talk, Aaron told me a secret project called VQL. Because it’s a secret, I didn’t talk about it to anyone. Just before the PEX 2010, we exchanged emails about the VQL. Aaron told me it’s already shipped. So it’s time to broadcast it.
VQL is a DSL that looks like SQL, easy to understand and easy to use. Unlike SQL on data, it’s on virtual resources in vSphere environment. The following is a quick sample. It gets back the VMs installed with SQL servers with verions newer than 9.2 and they are running 10 minutes ago.
SQL Server and VersionMajor >= 9 and VersionMinor >= 2 project vm at 10 minutes ago Read more... (339 words, 1 image, estimated 1:21 mins reading time)
Several folks asked me about how to use vSphere(VI) Java API to connect to a VM running on vSphere. The quick answer is vSphere Java API is not designed for this. You will need VMware Remote Console, browser plug-in, remote desktop/VNC, SSH client etc. However, it can help you to get the information required by the console or plug-in. Tal Altman from CISCO suggested that it be a topic for doublecloud.org. Here it is.
There are 3 ways to connect to the VM from your client side outside the vSphere and Web Access which have built-in support for console access.
- Using VMware Remote Console which is a standalone application
- Using browser plug-in to either IE or Firefox (Note: this is NOT supported by VMware. Please don’t call the company tech support for this.)
- Using Remote Desktop, VNC or SSH
The first two connect to the ESX host, and work even there is no guest OS installed on the VM. The last one assumes you have guest OS installed, and have IP network and server components in place already.
Note that these 3 ways work for the VMs in the public cloud as well if the related ports are open in your firewall. It is, however, not the case for most enterprises, therefore I particularly say it’s for VMs in private cloud. If you don’t have firewall issue, feel free to give it a try with public cloud as well.
Let’s go over one by one in details and see how vSphere Java API helps. Read more... (1112 words, 2 images, estimated 4:27 mins reading time)
While browsing the project home of VI Java API, I found a link to a great tool contributed by pitchcat. It is a standalone Java application that shows managed objects and data objects in a tree hierarchy, and all the methods attached to a managed object.
I highly recommend it to all the VI Java API developers. Why? Although you can get similar information from MOB, vijava browser gives you an overview of all the managed objects and clear paths to any managed objects or data objects. Read more... (129 words, 2 images, estimated 31 secs reading time)
During last Friday VMware beer bash, I bumped into Carter Shanklin. He told me he’s ready show off how his Onyx project can help Java developers using VI Java API at Partner Exchange next week in Las Vegas. If you will be there, be sure to attend his session TEXIBP1007 – also known as “Getting Stoned with ‘Project Onyx’” on Thursday at 11:30. Read more... (180 words, estimated 43 secs reading time)
In my previous blogs, I talked about session management for scalability and best practices (#9). In this one, I am going to drill down to the bottom.
To your surprises, there are two types of sessions involved in vSphere SDK:
- HTTP Session. It’s used to identify a client and tracked by the cookie in HTTP header. Once you login the server, all the successive requests have to carry the cookie header similar as follows
vmware_soap_session=”5229c547-1342-47d1-e830-223d99a47fba” Read more... (434 words, estimated 1:44 mins reading time)
- User Session. It’s used to identify a login session of a particular user. You can use SessionManager to find out more the details of the current user and other login users from the UserSession data object. The key in the UserSession is in the same format as the HTTP session, but you should never confuse them, or use them interchangeably.
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?”
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: Read more... (680 words, 1 image, estimated 2:43 mins reading time)
Categories: News & Events, vSphere API code contest, Groovy, java, jRuby, Jython, open source, powerCLI, RCLI, REST, scripting, system admin, vi java api, virtual appliance, vmware. ESXi
#6 Consider Views in Your GUI Application
Most developers don’t know much about the View and related managed objects. The reason for that is that they were mainly designed for VI/vSphere Client in the first place. But nothing stops you from using it to your advantages.
As you can imagine, you can use the View and its subtypes InventoryView, ListView, and ContainerView to monitor changes on the server side. It provides an efficient way to monitor for changes with only these visible in your GUI and nothing more. You can use ViewManager to create views according to your specific needs. Read more... (888 words, estimated 3:33 mins reading time)
VMware vSphere (as known as VI in earlier versions) SDK includes a comprehensive set of APIs managing the vSphere CloudOS. It can be used to build different types of applications: standalone GUI applications, vSphere Client plug-in, utility tools, Web applications, server applications. It is becoming increasingly important as more and more enterprises become 100% virtualized with vSphere. Read more... (788 words, estimated 3:09 mins reading time)
Besides the talks on VMware APIs, two self paced labs are there for you to try out the vSphere SDK and PowerShell at PEX. More details are quoted in later part.
As a bonus, you will get a chance to learn VI Java API in the SDK lab. Thanks to VMware TAM Alton Yu for making this happen! I will be there when I am not presenting my talk “Architecting Your Applications for VMware Cloud”, or helping on the BOF, genius bar, etc. Read more... (325 words, estimated 1:18 mins reading time)
After we released VI Java 2.0 GA for about half year, it’s about time to plan for the next release. My current plan is to have a synchronized release with next major release of vSphere. Therefore the must-have feature is to support next vSphere.
On top of that, here are several things we most likely do as well: Read more... (408 words, estimated 1:38 mins reading time)
Last week VMware released a news “VMware Expands VMware vCloud Developer Ecosystem With Open-Source Java and Python SDKs for VMware vCloud API”. It says,
VMware has also made a number of open-source contributions to the Cloud Tools project, which powers the SpringSource Cloud Foundry service, enabling Java developers to deploy, test, and manage applications for VMware environments via VMware vSphere(TM) and the VMware vCloud API. Read more... (393 words, estimated 1:34 mins reading time)
Our business team invited me to a phone call with one of our strategic partners days ago. They had a scalability issue with their server application. It turned out to be related to session management. I think they are not the only one who got into this type of problems, and most likely not the last one. So I decide to share it and hopefully you can avoid similar problems in your projects. Read more... (584 words, estimated 2:20 mins reading time)
Among many well know improvements like huge performance boost, VI Java API 2.0 has a big feature that we don’t talk much. It’s the full compatibility: one library for all the existing version from 2.0, 2.0 to 4.0. Read more... (469 words, estimated 1:53 mins reading time)