Create a JDBC Virtual Service using Service Image Manager

Document ID : KB000073167
Last Modified Date : 03/04/2018
Show Technical Document Details
Question:
Currently, there is an option to create JDBC Virtual Services using the DevTest Portal. There is a requirement to build an automation framework for building VSMs.
How can we create JDBC Virtual Services using a command line tool?
Environment:
All DevTest supported releases.
Answer:
1. With DevTest Workstation, start the VSE Recorder, vse recorder and select Java as the Transport Protocol:
User-added image

2. If you are able to see the agents under the Available Online Agents field, select the agent and enter the classes you need to virtualize.

3. Continue with the agent recording in the Workstation and before you select the Finish button, save the VRS file. 
    You will need to have the VRS file to be used with the Service Image Manager to create a virtual service.
    More information regarding the VRS file can be found at the link below:
    What is a VRS file and how to create it using the DevTest Workstation? https://comm.support.ca.com/kb/what-is-a-vrs-file-and-how-to-create-it/KB000076416

4. Once you have the VRS file, you will need to configure the Service Image Manager to start listening for traffic in a specific port. 
    Here is the link to the documentation regarding the ServiceImageManager command: 
    https://docops.ca.com/devtest-solutions/10-1/en/using/using-ca-service-virtualization/vse-commands/serviceimagemanager-command-manage-service-images 
    Example below:
# ServiceImageManager.exe --vrs=<path to the VRS file> --si-file=<path to the VSI file> -d

5. In a distributed environment, the Broker might be running on a remote server and the Service Image Manager can have issues to connect to the Broker.
    To fix it, add or modify the existing $DEVTEST_HOME/rules.xml to contain the correct Broker address. Below an example:
<?xml version="1.0" encoding="UTF-8"?>
<rules> 
<console> 
<property comment="Broker url when run in embedded mode (i.e. in LW)" key="lisa.console.agent.broker.url" value="tcp://<BrokerServerAddress>:2009?daemon=true"/> 
</console> 
</rules>
 
    Here is a link to DevTest documentation regarding the rules.xml file: https://docops.ca.com/devtest-solutions/10-1/en/agents/devtest-java-agent/rules-xml-file