Linux Docker image - SV Server

This topic describes how to install the Service Virtualization server on Linux using a Docker image.

Example usage

The following is an example of how to start the SV Server container with all dependencies and a typical configuration. For more configuration details, see Use the SV Server for Linux image below.

  1. Create a Docker network so that the SV Server can access its dependent containers:

    docker network create sv
  2. Start the database container (in this example, using a PostgreSQL database).

    docker run -d --name sv-db --network sv \
    -e POSTGRES_PASSWORD=password \
    -v /var/lib/postgresql/data \
    postgres
  3. Provide a license.

    To use the SV Server, you need to provide a license. This is done using the AutoPass License Server, which can be started as a Docker container as well.

    docker run -d --name apls --network sv \
    --privileged=true -p 5814:5814 \
    -v "/logs:/logs/" \
    -v "/config:/config/" \
    -v "/data/:/var/opt/autopass/apls/licenseserver/data/" \
    -e EULA="true" \
    mfsharedtech/apls:11.5.0-2020032022
  4. Log in to the AutoPass License Server.

    1. Open your web browser, and type the AutoPass License Server URL in the following format: https://localhost:5814/autopass.

    2. Enter the default user name and password (admin/password) and provide a license.

  5. Start the SV Server container using the following standard configuration:

    docker run -d --name sv-server --network sv \
    --tty --memory 2g --hostname $(hostname) \
    -e SV_LICENSE_SERVER_URL="https://apls:5814" \
    -e SV_SERVER_AGENT_PORTS=6060-6079 \ -e SV_DB_TYPE=postgresql \ -e SV_DB_DATASOURCE=";Host=sv-db;Database=postgres" \ -e SV_DB_USERNAME=postgres \ -e SV_DB_PASSWORD=password \
    -p 6085:6085 -p 6060-6079:6060-6079 \
    -v /opt/microfocus/sv-server/work \
    -v /opt/microfocus/sv-server/logs \
    -v /opt/microfocus/sv-server/app.config \
    virtualization/sv-server

Back to top

Use the SV Server for Linux image

You can configure the following:

Environment variables

The SV Server accepts the following environment variables (mandatory environment variables are indicated):

Environment Variable Description
SV_USER

The username of the account which is created or updated before the server is started.

Default: “admin”

SV_PASSWORD

The password of the user above.

Default: “password”

SV_GROUPS

Comma-separated list of groups for the user.

Built-in groups:

  • SVM Users

  • SV Operators

  • SV Publishers

  • SV Runtime Administrators

  • SV Server Administrators

Default: “SVM Users,SV Operators,SV Publishers,SV Runtime Administrators,SV Server Administrators”

SV_HOSTNAME

Should be set to a host hostname (not a container hostname), so externally exposed endpoints like virtual service endpoints or SSL certificate Common Name match the host (from where they are consumed).

Default: container hostname

SV_SSL_CERTIFICATE_GENERATE

Can be set to true or false. If set to true, a self-signed SSL certificate is generated during startup. Setting this to false is useful, for example, if you want to share the SSL certificate between SV Server and SV Management containers by mapping the work folder to the same volume. In this case, the certificate should be generated only by one container and reused by the other.

Default: true

SV_SERVER_AGENT_PORTS

(mandatory)

The port range which the server uses for agent ports (such as 6060-6079). This port range should match the ports you exposed from the container to the host machine using the -p parameter.
SV_DB_TYPE

The type of database used by the SV Server. Either "postgresql", "oracle", or “mssql”.

Note: To change the database configuration, you must always specify at least SV_DB_TYPE and SV_DB_DATASOURCE.

Default: “postgresql”

SV_DB_DATASOURCE

A database connection string.

Default:

  • If SV_DB_TYPE is "postgresql", the default is ";Host=sv-db;Database=postgres"

  • If SV_DB_TYPE is "mssql", the default is "sv-db"

  • If SV_DB_TYPE is "oracle", the default is "sv-db:1521/xe;Self Tuning=false;Statement Cache Size=10"

SV_DB_USERNAME

The database username.

Default:

  • If SV_DB_TYPE is "postgresql", the default is "postgres"

  • If SV_DB_TYPE is "mssql", the default is "sa"

  • If SV_DB_TYPE is "oracle", the default is "system"

SV_DB_PASSWORD

The database password.

A database name. Note: To change DB configuration, you must always specify at least SV_DB_TYPE and SV_DB_DATASOURCE. Default: “”

Default: "password"

SV_DB_NAME

A database name.

Default: ""

SV_DB_RECREATE

When set to true, the database schema will be recreated before the server starts. This clears all the data and allows this SV Server instance to claim the database.

Default: false

SV_DB_PROPERTIES Additional database properties.
SV_DB_WAIT_FOR

The database host and port (for example, sv-db:5432). If set, the SV Server starts only when the port becomes available for connection.

Default:

  • If SV_DB_TYPE is "postgresql", the default is "sv-db:5432"

  • If SV_DB_TYPE is "mssql", the default is "sv-db:1433"

  • If SV_DB_TYPE is "oracle", the default is "sv-db:1521"

SV_LICENSE_SERVER_URL The AutoPass License Server URL. The correct URL must be specified in order to switch any Virtual Service to Simulation state.
SV_SERVER_PARAMS

Additional SV Server parameters.

Default: ""

SV_SIMULATION_DATA_PROVIDER

Sets the data provider for simulation.

Possible values:

  • "inDatabase" - fetches all data from the database.

  • "inMemory" - pre-loads simulation data to the memory which can increase throughput by ~20-40%, but consumes more memory. Note that some DB queries still happen even in this mode.

Default: inDatabase

Ports

The SV Server uses these ports:

  • 6085 - secure server management REST API

  • Agent ports – see the SV_SERVER_AGENT_PORTS variable above.

Directories

  • /opt/microfocus/sv-server/logs - server logs

  • /opt/microfocus/sv-server/app.config - server configuration files

  • /opt/microfocus/sv-server/work - certificates, credentials, users, etc.

  • /opt/microfocus/sv-server/work/Agents - agent configuration files

  • /opt/microfocus/sv-server/tmp – temporary and cache files

Use your own SSL certificate

The SV Server (and SV Management) create a self-signed certificate/key on the first run, where the container hostname is used as a common name. To keep it across restarts, you should create a docker volume. To use your own certificate/key, perform the following procedure:

  1. Prepare the following files in the $(pwd)/certificates folder:

    • server-cert.p12 - server certificate and private key in PKCS12 format.
    • server-key.pass - password in plain text for the server private key.
  2. Import these files into the SV Server certificates directory in the /opt/microfocus/sv-server/work volume using the sv-ImportCertificates script. To do this, run the following command:

    docker run --volumes-from sv-server --rm --memory 2g \
    -v $(pwd)/certificates/:/opt/microfocus/sv-server/my-certificates/ \
    virtualization/sv-server \
    ./sv-ImportCertificates /opt/microfocus/sv-server/my-certificates/

  3. Restart the SV Server container:

    docker restart sv-server

Configure LDAP authentication

To enable LDAP authentication, edit HP.SV.StandaloneServer.dll.config and change the membershipProvider to Ldap. Edit the config file in the following way:

docker run -it --volumes-from sv-server --rm --memory 2g \
-u root \
virtualization/sv-server \
vi /opt/microfocus/sv-server/app.config/HP.SV.StandaloneServer.dll.config

Then you need to edit HP.SV.StandaloneServer.ldap.config with your LDAP configuration:

docker run -it --volumes-from sv-server --rm --memory 2g \
-u root
virtualization/sv-server \
vi /opt/microfocus/sv-server/app.config/HP.SV.StandaloneServer.ldap.config

Back to top

Run various SV tools

You can use the following command to run SV tools which are part of the SV Server distribution, for example running the SVConfigurator tool:

Use the following command to run the SVConfigurator tool:

docker run --rm --memory 2g \
virtualization/sv-server \
/opt/microfocus/sv-server/Tools/SVConfigurator/bin/SVConfigurator.sh <command>

Back to top

Examples of database configurations

You can see example database configurations for the following images:

PostgreSQL Docker image

To run the container:

docker run -d --name sv-db \
--network sv \ -e POSTGRES_PASSWORD=password \
-v /var/lib/postgresql/data \
postgres

SV Server configuration:

SV Server Environment Variable Value
SV_DB_TYPE postgres
SV_DB_DATASOURCE ;Host=sv-db;Database=postgres
SV_DB_USERNAME postgres
SV_DB_PASSWORD  

Oracle XE Docker image

To run the container:

docker run -d --name sv-db \
--network sv \
-v /u01/app/oracle/ \
wnameless/oracle-xe-11g

SV Server configuration:

SV Server Environment Variable Value
SV_DB_TYPE oracle
SV_DB_DATASOURCE sv-db:1521/xe
SV_DB_USERNAME system
SV_DB_PASSWORD oracle

Microsoft SQL Docker Image

To run the container:

docker run -d --name sv-db --network sv -p 1433:1433 \
-e ACCEPT_EULA=Y -e SA_PASSWORD=Changeit123 \
microsoft/mssql-server-linux

SV Server configuration:

SV Server Environment Variable Value
SV_DB_TYPE mssql
SV_DB_DATASOURCE sv-db
SV_DB_USERNAME sa
SV_DB_PASSWORD Changeit123

Back to top

See also: