In a previous blog I demonstrated using the VMware VI (vSphere) Java API with VMware ESXi (see prior blog Using the VI Java API with VMware ESXi). I’ve decided to add to this code to provide further functionality and demonstrate the power of the API. In the prior blog I created a vSphere Client in Java from scratch to connect to VMware ESXi and perform basic management functions. This update adds on and improves the original foundation we have already built.
Not only can we connect to an ESXi server and do simple management tasks such as Power On VM, Reset VM, Shutdown Guest, Restart Guest, Delete VM, and many others, but we can now also manage the actual physical server and obtain server information including uptime! Further, with the help of a friend and fellow developer, any changes made either on the Java VI client or on the ESXi Server, such as deleting a VM are appropriately reflected in the client.
This is just example code and not meant to be a full fledged program, but it is something that can be a good starting point and easily expanded. I will leave it to you to explore the source code which can be found on the download section or for the latest updates on GitHub.