Perhaps, the simplest way to do this is as follows:
1) Start Workstation and perform a VS Recording from R/R pairs using an existing set of R/R pairs.
2) Follow the wizard and enter all of the various configurations for your service including any protocol, Listen and host ports, DPHs, etc.
3) On the last screen, where the Finish button is located, notice the blue folder icon (right above Finish).
4) CLICK on the icon and save your VRS file. This action will provide a well-formed skeleton that you can use as a template.
Now that you have a VRS containing properly formatted XML, you can edit it according to your requirements.
As far as the command line goes, you will then build a command that specifies the name of the service model, image, and location of the VRS file containing the instructions you want processed. An example command line looks similar to this.
ServiceImageManager.exe --vrs=D:\[LISA_PROJ_ROOT]\<proj_file_name>\Data\recording-session\<YourVRSFileName>.vrs -d -s D:\[LISA_PROJ_ROOT]\<proj_file_name>\VServices\Images\<yourVSIFileName>.vsi -m D:\[LISA_PROJ_ROOT]\<proj_file_name>\VServices\<yourVSMFilename>.vsm –G
Replace the various PATH locations above as necessary to point to where files will be located...
Examples of the command structure can be found in the documentation at: ServiceImageManager Command - Manage Service Images - DevTest Solutions - 9.5 - CA Technologies Documentation
You can set this up to run from a .bat or .sh script depending on your environment.
With regard to creating the VSM, I would simply delete / remove it once the image is created. I am not certain that you can create the VSI without having a VSM file.
Hope this helps.