How to Hack vCenter Database in vCSA Appliance

As @lamw documented in his blog, you can access the database in the vCenter software appliance (vCSA). In the first appliance of version 5.0, VMware included IBM DB2 Embedded and then switched to vPostgres right after. That’s because vPostgres is VMware’s own product based on the open source Postgres.

By default, the access to the vPostgress database is limited to local applications. In other words, if you want to access the database remotely, it will not work. After researching a little, I figured out how to configure the databse for remote access.

Posted in Virtualization | Tagged , , , , , | Leave a comment

How to Expire ESXi License immediately

VMware has evaluation license for ESXi servers. After 60 days, it expires and you have to apply a paid or free license to continue. Technically, there is a trick to reset the evaluation key by deleting two files (/etc/vmware/vmware.lic and /etc/vmware/license.cfg) and rebooting the server. It’s of course not complying with VMwrae license terms. Under some circumstances like training lab, it may be OK. Make sure to consult VMware on this if you are not working for VMware. But wait – if you are working for VMware, do you need evaluation license? In his reply to my tweet, Duncan mentioned he never saw license expiration.

Posted in Virtualization | Tagged , , , | Leave a comment

How to Manually Change ESXi Time

Although VMware ESXi supports common Linux commands, its implementation is based on busybox. Some of the commands are not supported, or functionalities are reduced. Setting time is one of the cases.

To find out the current time, you issue the following command:

~ # date
Sun Jul 13 10:50:59 UTC 2014

Now if you want to use the same date command to change the time, it’s a different story. In fact, the help of the date command works as normal, but when you really type in full command, you’ll see it won’t work.

Posted in Virtualization | Tagged , , , | Leave a comment

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 | Tagged , , , | Leave a comment

How To Monitor Log File in Real Time and Save New Log To Another File

During software development, we often add lots of logs that help debug and trace the code. When the log files grow bigger, it gets harder to locate the right information of interest. Even we restart the application, the old log remains and new info appends the end of the file unless we delete log file. It’s OK to delete a log file but it’s better to keep it in case for information of previous runs. Here is a trick that I use to make it easier for me to find right log of interest, and it may help you as well.

Posted in Applications & Tools | Tagged , , | Leave a comment

Which Process Holds My File? Tools on Linux and Windows

Once in a while, I got into issues that my build failed because the IDE could not clean certain folder or file. The root cause was that they were opened by another application/process. If the application is known, just closed it and the build worked well. Some times I had no clue which application held the file. To find out quickly without guessing, right tools are needed.

On Linux, it’s quite easy with a command called lsof as follows:

Posted in Applications & Tools | Tagged , | Leave a comment

A Hidden Gem VMware Should Invest More For Its Long Term

For a long time, VMware wanted to grow upward the stack but did not work out well. Instead, it took the horizontal strategy as I discussed in my blog article two years ago. So far, the new strategy has worked well.

Posted in Uncategorized | 4 Responses

Cisco UCS Director: Key Concepts Illustrated In Big Pictures

During the last few months, I worked a lot with Cisco UCS Director on daily basis. As I wrote before, UCS Director is a powerful platform for you to manage and orchestrate infrastructures from VMware, Hyper-V, KVM, to the public clouds like Amazon, Azure.

Just like any other management platform, it abstracts the underlying infrastructure and operations using its own concepts and workflows. By exploring its Flex GUI, one can gradually get familiar with these concepts. It takes time to master a product, and no exception for UCS Director. Understanding key concepts and their relationships can help speed up the process significantly.

Posted in Cloud Computing | Tagged , , , | 2 Responses

Java 8 New Features: JavaFX

The JavaFX is not really a new feature, but it’s the first time for it to make into a major Java release. JavaFX has a pretty long history as the next big thing for building cross platform GUI applications. Initially it has its own scripting language and hasn’t made its way in the Java community. The reason is simple: although the JavaFX has richer features on graphics, it does not seem worth learning a new language for it. For a long time, I was wonder why Sun didn’t use the investment to improve its Swing library which has much bigger audience than JavaFX.

Posted in Software Development | Tagged , , | Leave a comment

Java 8 New Features: Nashorn JavaScript Engine

When JavaScript was created, it had not much to do with Java. It’s named as such maybe due to the popularity of Java language at that time. But over the years, JavaScript has gained its own popularity and dominated the client side of Web applications. There are even some work for JavaScript to extend its reach to the server side, for example, Node.js.

Posted in Software Development | Tagged , , , | Leave a comment

Accessing Database in Java with JDO

I haven’t written Java code to access relational database for a while. Over the years there have been lots of progresses, especially with various Object Relational Mapping (ORM) frameworks. With these frameworks, accessing relational databases becomes pretty easy. In some cases, you don’t have to know SQL at all. Of course understanding SQL is always an advantage.

Posted in Software Development | Tagged , , , , | Leave a comment

Java 8 New Features: Map Reduce Made Easy With Stream APIs

In my article, I introduced the new Stream API. With the new stream APIs, you can apply many different operations on the stream, including the map-reduce functions.

One of the most famous framework to support map-reduce for large scale data processing, a.k.a. BigData, is Hadoop as I introduced almost two years ago here. Data processing wise, the Java 8 stream API can do pretty much the same. Here is a quick sample that shows how it count number of words in string. There are significant differences in how they are implemented and the cases in which they should be used. Let’s discuss them after the sample.

Posted in Big Data, Software Development | Tagged , , , | Leave a comment

Java 8 New Features: Stream API

Java Collections APIs consists of well designed classes and interfaces for managing all sorts of data structures. With Java 8, there is a new enhancement called Stream API related to the Collection APIs (see What’s New in JDK 8). I spent some time to study the new feature last week as part of my effort to bring myself up to date with Java 8.

Posted in Software Development | Tagged , , , | 1 Response

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 | Tagged , , , | 2 Responses

Java 8 New Features: Default Method

Following the last article about Lambda feature in Java 8, I spent some more time on other features and will blog about them along the way. It’s a good way to push me to really think through and thus deepen my understanding. This article is about default method which is in fact related to the lambda feature.

Posted in Software Development | Tagged , , | Leave a comment

Java 8 New Features: Lambda Expression

On last Tuesday (March 18, 2014), Oracle released the Java SE 8. Here is the official documentation from the company on the new features in Java SE 8, ranging from language itself, libraries, tool, and run-time.

Posted in Software Development | Tagged , , | 3 Responses

Setting Security Certificate: What VMware Did Not Tell You

In my last article, I discussed on the format requirement for Java APIs and how I found out the root cause and its solution. Even more mysterious is the format requirement of VMware vCenter as I discovered in another VMware related project, in which I needed to register an extension with vCenter and set up its certificate.

Posted in vSphere API | Tagged , , , | Leave a comment

Reading X.509 Certificate in Java: How to Handle Format Issue

I got into a very interesting problem while writing code to read a X.509 certificate. It’s a standard PEM encoded certificate (shown below) as you would find anywhere else.

-----BEGIN CERTIFICATE-----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qeew+Bp95+uKYTY4bnOixW/3X80t+2zMnJqPJ62UhHuKzw==-----END CERTIFICATE-----

The exception is as follows. It’s pretty clear, but also confusing because the certificate string has included both BEGIN and END. It seems to me very complete. Of course, the program does not lie and we have to trust it most of the time unless there is a bug.

Posted in Uncategorized | Tagged , , , | 1 Response

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 | Tagged , , , , | 5 Responses

Nginx: How to Fix Timeout Issues and More

If you’ve followed my blog, you’ve read several articles on Nginx. This is the last article of the series, and also an interesting one. While troubleshooting a system I helped to build, I found a very challenging problem that I think is worthwhile to share. The system consists of a client and a server, between which is a Nginx server as reversed proxy. This is a typical setting for flexibility and control. Somehow, the client got disconnected pretty consistently but the back end work went through successfully. It’s really a false alarm but not good for a product.

Posted in Applications & Tools | Tagged , , | Leave a comment
  • NEED HELP?


    My consulting helps clients with virtualization and cloud computing, including VMware infrastructure automation and orchestration, vSphere management APIs, and deep product integration with hypervisors. Current training offerings include vSphere APIs training, vCenter Orchestrator training, and etc. Should you, or someone you know, need these consulting services or training, 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.