vRealize Production test tool 1.6.0 fails license check for vRA 7.1 and up

Share on:

Recently at a customer site, whom heavily uses this tool to monitor his environment, since upgrading his vRA 7.0.1 Production system to vRA 7.1, Licensing checks were failing (as illustrated in the image)

Production tool error

Looking at the logs we did identify an error with licensing check :

INFO  2016-12-21 09:03:35.489 (LoggingTestListener .onTestStart    :  23) Executing test 63/76
ERROR 2016-12-21 09:03:40.349 (AMIClientServiceImpl.getLicenses    : 236) com.fasterxml.jackson.databind.JsonMappingException: Can not deserialize instance of com.vmware.vrealize.readiness.vra.model.vami.License[] out of VALUE_NUMBER_INT token
at [Source: 21 Dec 2016 09:03:39,005 [com.vmware.horizon.common.api.token.SuiteToken] (main) ()
ERROR: No keystore file or URL specified.
[{licenseInfo:{“@…

vRealize Production test tool is creating an SSH session to vRealize Automation appliance and runs a cli command to check license validation – /usr/sbin/vcac-config license-info

which after vRA 7.1 returns the following response

20 Dec 2016 19:41:49,028 [com.vmware.horizon.common.api.token.SuiteToken] (main) () ERROR: No keystore file or URL specified.
---BEGIN---
[LICENSING JSON STRING]
---END---

It was clear that when vRPT is parsing JSON license info, it is failing due to the addition of the first line. Until that is fixed, here is way to make it work

Now for the fix – Tools required

  1. vRealize Production Test tool jar file (1.6 / 1.7) – Download Link
  2. Java 8 JDK – Download From Oracle Site
  3. jd-gui (Java decompiler) - Site Link

Open the jar file with jd-gui and navigate to the affected code in com/vmware/vrealize.readiness/helper/VAMICommandReturnParser.java, we will modify extractPayload method.

extractPayload Method

save the file with File > Save option. as for the fix, we will skip all text returned from command, until after ‘—BEGIN—‘ token. the fixed method will look like this

public static String extractPayload(String paramString)
{
  int i = paramString.indexOf("---BEGIN---");
  String str1 = paramString.substring(i, paramString.length());
  str1 = str1.replace("---BEGIN---", "");
  String str2 = str1.replace("---END---", "");
  return str2.trim();
}

replace the method with the fix and save the file.

now we need to compile the file containing the fix. in a Command Line prompt, type

javac VAMICommandReturnParser.java

that should compile the file and create a .class file in the same directory

.class file

we need to copy the file into the jar – just open the JAR file with your favorite zip archiver and drop the .class file in the same directory – com/vmware/vrealize/readiness/helper/VAMICommandReturnParser.java replacing the original one.

You can download the final product from Here

Yaniv