DCImanager 6

Modifying containers on the location server

The platform uses the /opt/ispsystem/dci/etc/location.yaml configuration file to configure the docker containers on the location server. The Docker Compose format is used to describe the configuration.

You can edit the configuration by using the patch (modification) mechanism. Patches allow you to add files, environment variables and additional services to docker containers.

Example of creating a patch

This example shows how to change the IMPITOOL_PATH environment variable. After performing these actions in the eservice_handler docker container, the /usr/bin/ipmitool_1.8.19 file will be used to run the ipmitool utility.

  1. Connect to the location server via SSH.
  2. Create a patch.yaml file with the following content:

    patch.yaml
    version: "3.5"
    
    services:
      eservice_handler:
        environment:
          IPMITOOL_PATH: "/usr/bin/ipmitool_1.8.19"
  3. Encode the contents of patch.yaml as per Base64:

    echo -ne "patch.yaml" | base64

    Save the command response.

    Example of response
    cGF0Y2gueWFtbA==
  4. Get the authorization token:
    curl -k -X POST -H "accept: application/json" -H "Content-Type: application/json" 'https://domain.com/auth/v4/public/token' -d '{"email": "admin_email", "password": "admin_pass"}'
    Comments to the command

    In response, you will get the message in the form:

    Example of response in JSON
    {
      "confirmed": true,
      "expires_at": null,
      "id": "6",
      "token": "4-e9726dd9-61d9-2940-add3-914851d2cb8a"
    }

    Save the received token value.

  5. Execute the API request:

    curl -k -# -d '{"patches":[{"name":"<patch_name>","patch":"<patch_base64>"}]}' -H "Cookie: ses6=<token>" -H "x-xsrf-token: <token>" -o- "https://domain.com/dci/v3/location/<location_id>/setup"
    Comments to the command

    DCImanager 6 will start setting up the location, taking into account the created patch.

Managing patches

You can manage patches through API queries.

Add patches
curl -k -# -d '{"patches":[{"name":"<patch1_name>","patch":"<patch1_base64>"},{"name":"<patch2_name>","patch":"<patch2_base64>"},{"name":"<patch3_name>","patch":"<patch3_base64>"}]}' -H "Cookie: ses6=<token>" -H "x-xsrf-token: <token>" -o- "https://domain.com/dci/v3/location/<location_id>/setup"
If patches have already been applied to the location, specify them in the patches list. Patches not listed will be deleted from the location.
Get a list of patches used
curl -k -# -X GET -H "Cookie: ses6=<token>" -H "x-xsrf-token: <token>" -o- "https://domain.com/dci/v3/location/<location_id>"

The response of the command will contain the patches parameter with data about the patches.

Deleting all patches
curl -k -# -d '{"patches":[]}' -H "Cookie: ses6=<token>" -H "x-xsrf-token: <token>" -o- "https://domain.com/dci/v3/location/<location_id>/setup"
Comments to queries

Managing modified containers

Use the script /opt/ispsystem/dci/etc/location_compose.sh to start and stop the modified containers on the location server. The platform generates a script automatically and includes information about all the patches that need to be run on the location. If you do not use the script, the current patches will be deleted when you restart the containers.

Starting all services
/opt/ispsystem/dci/etc/location_compose.sh up -d
Stopping all services
/opt/ispsystem/dci/etc/location_compose.sh down