Tag Archives: vSphere API

A Little Known Security Feature in vCenter: Certificate Based Authentication

Although we are all familiar with the username and password based login to the VMware vSphere, it’s also possible to login into vSphere with just certificates. If you are a third party vendor, either IHV (independent hardware vendor) or ISV (independent software vendor), the certificate based login is actually a better and preferred alternative to the one using username and password.

Let me explain why it’s the case, and how it can be done painlessly.

Posted in vSphere API | Also tagged , , | Leave a comment

Announcing vijavaNG 6.0 with vSphere 6.0 Support

Even before VMware announced the GA of vSphere 6.0, I’ve started to work on the vijavaNG making sure that vijavaNG will keep up with the latest release of vSphere. Although it may take a bit time for customers and partners to move onto this new release, we want early adopters to have the choice to use the best Java APIs for managing vSphere.

Posted in vSphere API | Also tagged , | 4 Responses

Parsing, Modifying, and Generating Java Source Code With Javaparser

It’s not common to do something with Java source code programmatically, but I find the javaparser project is very handy if such a use case comes up. It’s a Java 1.5 parser with AST generation and visitor support. With the API, you can access various elements in the source code like class, methods, statements, javadoc, comments, etc.

Posted in Software Development | Also tagged , , | 3 Responses

Java 8 New Features: Method Reference

Coming with lambda feature in Java 8 is the method reference feature. It allows programmers to use methods as variables, and parameters to other methods. It works for class constructors too, where the method name is unanimously “new.’

There are four types of method references per Oracle documentation. Syntax wise, they all look similar with double colons as shown in the following sample code.

Posted in Software Development | Also tagged , , | 2 Responses

Cisco UCS Director REST APIs: Step By Step Tutorial

As I introduced in last article, there are two sets of APIs in UCS Director: north bound APIs, and south bound APIs. The north bound APIs are REST styled, allowing other applications to invoke UCS Director functionalities, or simply retrieve information from UCS Director. We’ll go through the REST APIs in details so that you can quickly get started with it.

Preparation

Posted in Cloud Computing, Software Development | Also tagged , , , | 8 Responses

Simplest Way to Encode Base64 in Java

Base64 is a straight forward encoding for binary data into readable characters (RFC 4648 and RFC 2045). Although you can do it by yourself, more often than not you would like use an existing library, for example, Apache common. If you just need the Base64 encoding but have to import the whole library, it’s not a good idea. There is actually a better way without introducing extra dependency, which is to hack Java standard library 1.6.

Posted in Software Development | Also tagged , | 4 Responses

VMware Open Sourced Python Binding for vSphere API: What Limit Does It Solve

As reported in the community, there were quite excitement about the open source of the pyVmomi, the Python equivalent of vijava API. It was heatedly debated whether to open source the API even when I was working at VMware years ago. One camp of people thought it should be open sourced and even supported as Web Service SDKs; while the other group didn’t think it’s mature and would cause a lot of trouble in so doing. So it didn’t go anywhere in the past few years.

Posted in vSphere API | Also tagged | 1 Response

Hacking VMware Private Python API for vSphere with a Quick Sample

It’s not a secret that VMware has a private Python API or so called Python binding for vSphere API. If you haven’t heard about it before, no worry. Here is a link to Hostd General Architecture. Somehow it’s not publicly released as a product for customers or partners. Over the years, I only heard a big bank uses it for internal IT automation. But it’s super easy to get it if you want – it’s part of every ESXi installation. Just check it out at /lib/python26-visor.zip if you SSH to your ESXi box. Update: in ESXi 5.5, look at the /lib/python2.6/site-packages.

Posted in vSphere API | Also tagged , | 10 Responses

Agent VM, ESX Agent Manager API, and vijava Support

To understand the ESX Agent Manager API, we have to first explain the Agent, which is essentially Agent Virtual Machine. The agent virtual machine can be hardware drivers for your ESXi server, or simply software, i.e, virus scan, that should be deployed on each ESXi. They could have been designed and installed directly on ESXi via VIB, but it would increase the risk of destablizing ESXi due to access to lower level APIs of ESXi. To lower the risk, the driver VM idea came up – if the driver VM crashes the ESXi is still solid even though some service may be affected.

Posted in vSphere API | Also tagged , , | 2 Responses

VMware ESXi vim-cmd Command: A Quick Tutorial

Command lines are very important for system administrors when it comes to automation. Although GUIs are more likely (not always as I’ve seen too many bad ones) to be more intuitive and easier to get started with, sooner or later administrators will use command lines more for better productivity. Check out DoubleCloud ICE if you want the best of both GUI and command lines.

Posted in Virtualization | Also tagged , , | 27 Responses

Parsing Command Line in Java

If you develop a command line tool, you would probably need to parse options and arguments. In Java, you can use Apache Commons CLI to handle the parsing. Since I don’t write much command line program, I don’t need these tools. While reading vCO API sample, I found one command line tool called args4j which is written by Kohsuke Kawaguchi who had created the famous Hudson/Jenkins server.

Posted in Software Development | Also tagged , | 2 Responses

What’s New in VMware vSphere 5.5: Management APIs

After downloading the vSphere 5.5 SDK GA release last week, I started to look into the API reference immediately. Because I am pretty familiar with previous versions of vSphere APIs already, I just jumped directly into the “New and Changed Managed Object Elements in 5.5” page (there is a link on the home page of API Reference) as I had to work on the open source vijava API 5.5 which was released as beta last Friday.

Posted in vSphere API | Also tagged | 3 Responses

Announcing VI Java API 5.5 Beta Supporting vSphere 5.5

As it’s asked about when the vijava API 5.5 is ready, the answer is NOW. A couple of minutes ago, I uploaded the beta release to the sourceforge.net site. Please feel free to download the beta release and give me your feedbacks and bug reports as soon as possible. I plan to GA the release in about one month.

Posted in vSphere API | Also tagged | 35 Responses

VMware vSphere API Training is Ready

During the last 3 weeks, I’ve been working on the courseware and online lab for the VMware vSphere API training. It’s now available for delivering as private classes, either online or onsite. All the contents in the training will be highly customizable per your project needs in terms of content and time. For example, if you are a networking company, we can put more focuses on the networking aspect of the vSphere APIs. As a former VMware employee who authored the VMware vSphere SDK book with Prentice Hall and created of the de facto open source VI Java API, I can also give you practical advice for your projects.

Posted in News & Events, vSphere API | Also tagged | 22 Responses

Java Native Access: What, How, and Performance Comparison

While trying the libvirt Java binding, I came to know Java Native Access (JNA) which is a great alternative to Java Native Interface (JNI). As it’s said, no one can claim to know all about Java after 1.5. It’s now 1.7 (although majority of us are still with 1.6) and it’s even less likely. I am no exception.

Posted in Software Development | Also tagged , | Leave a comment

Understanding Libvirt and APIs For VMware Professionals

As discussed in my previous post, Libvirt is an open source project for managing hypervisors. With the increasing popularity of Openstack, it’s important to get familiar with KVM as an alternative virtualization platform to commercial products like vSphere and Hyper-V.

To use KVM, you don’t have to install Openstack – you can just install KVM as a standalone product as described in my previous post. In that, it’s pretty much like VMware Player or Workstation. In terms of maturity, KVM is pretty solid and way ahead of Openstack which is also improving quickly since last year with many commercial vendors jumping in.

Posted in Virtualization | Also tagged , , , | 1 Response

A Bug with Disabling SSH Service Port in vSphere 5.1

While playing vSphere API last week, I got into an issue that I cannot disable the SSH server with Firewall APIs (see HostFirewallSystem). The following call would throw an exception:

hfs.disableRuleset(“sshServer”);

There are many other different services like “sshClient” whose ports can be enabled and disabled via the API. As a nice surprise, they all work just fine.

Posted in vSphere API | Tagged | 6 Responses

How to Read GIT Repository Using Java APIs

GIT is a source code control system created by Linus and others for managing Linux kernel development. It becomes one of the most popular version control systems especially in the open source community. Most developers use command line or the plugins to IDEs like Eclipse, NetBeans. I think even Microsoft VisualStudio has add-on for connecting to GIT, but I haven’t checked it.

Posted in Software Development | Also tagged , | 14 Responses

VI Java API Project Upgrade

During the past weekend, I upgraded the vijava API project to the new Allura platform provided by Sourceforge.net. That’s really a button click and then waited for incoming emails for status updates. It went smoothly and didn’t take long before it finished.

Note that the upgrade is limited to the project hosting, not the Web site (http://vijava.sf.net) which remains the same and continues to work as before.

Posted in News & Events, vSphere API | Also tagged , | 6 Responses

Announcing GA of VI Java API 5.1 Supporting vSphere 5.1

It’s been two months since I announced beta of VI Java API 5.1 supporting vSphere 5.1 on September 23. I got many emails asking for the GA date from ISVs and IHVs as the API is now a corner stone in their products. With the long (could be longer, BTW) Thanksgiving holidays, I got some time to review the fixes and release the GA version. I intended to announce it yesterday but somehow extra spam comments pushed the database behind over 100MB limit thus I could not post any new article.

Posted in vSphere API | Also tagged | 13 Responses
  • NEED HELP?


    My company has created products like vSearch ("Super vCenter"), vijavaNG APIs, EAM APIs, ICE tool. We also help clients with virtualization and cloud computing on customized development, training. Should you, or someone you know, need these products and services, please feel free to contact me: steve __AT__ doublecloud.org.

    Me: Steve Jin, VMware vExpert who authored the VMware VI and vSphere SDK by Prentice Hall, and created the de factor open source vSphere Java API while working at VMware engineering. Companies like Cisco, EMC, NetApp, HP, Dell, VMware, are among the users of the API and other tools I developed for their products, internal IT orchestration, and test automation.