Installing the Infrastructure Manager REST API

This page includes the following:

Prerequisites

  • Operating System
    • Windows Server 2016 or higher
    • Unix
      • Ubuntu
      • Redhat
      • CentOS
  • Database Server

    • PostgreSQL v10 or higher

This video shows how to check the Java and database versions and install Terraform on Windows:

Installing the Database

  1. Create an empty PostgreSQL database with the following command:

    CREATE DATABASE databasename;

    Example:

    CREATE DATABASE provisioning_rest_api;

  2. Create an Infrastructure Manager database user with the following command:

    CREATE USER <username> WITH ENCRYPTED PASSWORD 'password';

    Example:

    CREATE USER im WITH ENCRYPTED PASSWORD 'P@ssw0rd';

  3. Grant this user all privileges on the new database.

    GRANT ALL PRIVILEGES ON DATABASE <database-name> TO <username>

    Example:

    GRANT ALL PRIVILEGES ON DATABASE provisioning_rest_api TO im;

Installing the Infrastructure Manager REST Server as a Service

This video shows how to install the database and the Infrastructure Manager as a service:

To Install the Service and Start the Application

  1. Get the Infrastructure Manager REST artifact.

    1. Download the Infrastructure Manager REST artifact zip file from https://downloads.automic.com/
    2. Extract the artifact to a folder.

      Examples:

      • Windows

        C:\Program Files\InfrastructureManager

      • Unix

        /usr/share/InfrastructureManager

    3. (Unix) Change the access permissions for the Infrastructure Manager installation directory (# chmod -R 754 /usr/share/InfrastructureManager)

  2. Install the service.

    You can use the http and https protocols to install the service (default: https)

    Important! (Unix) The installation has to be done by a user with sudo privileges, otherwise an error will be shown.

    • HTTPS protocol (default)

      1. A TLS/SSL certificate is required. You can use a Certifying Authority signed certificate or a self-signed certificate. During the installation, you will be asked to provide the keystore and keystore password generated for your certificate.

        To generate a self-signed certificate use the following command:

        keytool -genkey -alias [your alias] -storetype PKCS12 -keyalg RSA -keysize 2048 -keystore [your key store file].p12 -validity 3650 -noprompt -ext SAN=dns:[server name] -dname "CN=[server name], OU=[organizational unit], O=[organization], L=[city/locality], ST=[province/state], C=[code]" -storepass [password] -keypass [password]

        Example:

        C:\Users\my_user>keytool -genkey -alias im_keystore -storetype PKCS12 -keyalg RSA -keysize 2048 -keystore im_keystore.p12 -validity 3650 -noprompt -ext SAN=dns:vmvienna01 -dname "CN=vmvienna01, OU=ESD, O=ESD, L=Vienna, ST=Vienna, C=AT" -storepass p@ssw0rd -keypass p@ssw0rd

        Note:

        • "server name" is the hostname of the computer where the Infrastructure Manager is installed.
        • For more information about keytool click here.
      2. Run the install.bat (Windows) or install.sh (Unix) command from the bin folder

        • Windows batch

          > install.bat --java-installation "<absolute_java_path>" 
          Enter server.ssl.key-store: <absolute path to key-store file> 
          Enter server.ssl.key-store-password: <keystore-password>
          

        • UNIX bash

          $ sudo ./install.sh --java-installation "<absolute_java_path>"
          Enter server.ssl.key-store: <absolute path to key-store file>
          Enter server.ssl.key-store-password: <keystore-password>
          

        • Example:

          > install.bat --java-installation "C:\Program Files\Java\jdk 11.0.3"
          Enter server.ssl.key-store: C:\Program Files\InfrastructureManager\im_keystore.p12
          Enter server.ssl.key-store-password: P@ssw0rd
          

        • After running the install script, the key-store and key-store-password inputs are written into the [Installation Directory]/config/application.yml file. (key-store-password is encrypted)
    • HTTP protocol

      Use the --use-http option to install the service with the http ptotocol.

      • Windows batch

        > install.bat --use-http

      • UNIX bash

        # $ sudo ./install.sh --use-http

      Note: After running the script with the http option, two configuration properties related to the key-store and the key-store-password will be removed from the [Installation Directory]/config/application.yml file.

    Important!

    • Use the --java-installation option to point to a specific java installation. Otherwise, the system will search for the Java installation in the following order:
      • JAVA_HOME environment variable
      • PATH environment variable

      Examples:

      • Windows Batch

        > install.bat --java-installation "C:\Program Files\Java\jdk 11.0.3"

      • Unix Bash

        $ sudo ./install.sh --java-installation "C:\Program Files\Java\jdk 11.0.3"

  3. Configure the Infrastructure Manager Backend.

    To configure the Infrastructure Manager backend, you can update the application.yml file located in the [Installation Directory]/config/ folder or configure environment variables.

    Important!

    • The environment variables override the values specified in the application.yml (except the proxy settings).
    • The initial values in the application.yml serve just as an example. They must be updated with your configuration settings.

    You can edit the following parameters:

    • server.port

      Infrastructure Manager REST API port.

      Default: 9000

    • server.ssl.key-store

      The absolute path to the key store file.

      Note: This key is not needed for the http protocol and should be removed.

    • server.ssl.key-store-password

      The key store password.

      Note: This key is not needed for the http protocol and should be removed.

    • spring.datasource.username

      PostgreSQL database user created after the database installation.

      Default: postgres

    • spring.datasource.password

      PostgreSQL database password.

      Default: postgres

    • spring.datasource.url

      Connection string to the Infrastructure Manager PostgreSQL database.

      Default: jdbc:postgresql://localhost:5432/provisioning_rest_api

    • imPath

      The Infrastructure Manager working folder. It holds execution logs, templates and other resources required for its operation.

      Default:/tmp/.im

      Examples:

      • Windows

        [Installation Directory]\tmp (for example, C:\Infrastructure Manager\IM REST API\tmp)

      • Linux

        [Installation Directory]/tmp (for example, /usr/share/Infrastructure Manager/tmp)

    Environment Variables

    The following parameters can be exposed as environment variables:

    • IM_DB
    • POSTGRES_HOST
    • POSTGRES_PORT
    • IM_DB_USER
    • IM_DB_PASSWORD
    • IM_PATH

    Important! If these environment variables are defined, they will override the values specified in the application.yml

    Important! If the proxy settings are configured as both environment variables and in the application.yml, the environment variables will be ignored.

    Example: application.yml

To Start the Service

Run the start.bat (Windows) or start.sh (UNIX) command from the [Installation Directory]/bin folder

  • Windows batch

    > start.bat

  • UNIX bash

    $ sudo ./start.sh

Important!

  • Ensure that the Infrastructure Manager service is up. If the service is not running, check the InfrastructureManager.log in the [Installation Directory]/logs folder.
  • REST url structure: <protocol>://<host>:<port>/<context_path>

    Example:

    https://vvnfiboqa01:9000/provisioning

To Stop the Service

Run the stop.bat (Windows) or stop.sh (UNIX) command from the [Installation Directory]/bin folder:

  • Windows batch

    > stop.bat

  • UNIX bash

    $ sudo ./stop.sh

To Uninstall the Service

Run the uninstall.bat (Windows) or stop.sh (UNIX) command from the [Installation Directory]/bin folder

  • Windows batch

    > uninstall.bat

  • UNIX bash

    $ sudo ./uninstall.sh