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 How to use this 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. For more information, see the Docker hub documentation.

  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

How to use this 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.

Note: SV_USER, SV_PASSWORD, and SV_GROUPS must always be specified together.

Default: “admin”

SV_PASSWORD

The password of the user above.

Note: SV_USER, SV_PASSWORD, and SV_GROUPS must always be specified together.

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

Note: SV_USER, SV_PASSWORD, and SV_GROUPS must always be specified together.

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

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.

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

Default: “;Host=sv-db;Database=postgres”

SV_DB_USERNAME

The database username.

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

Default: “postgresql”

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: ""

SV_DB_NAME

A database name.

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

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.
WAIT_FOR_DB The database host and port (for example, sv-db:5432). If set, the SV server starts only when the port becomes available for connection.
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: ""

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: