External databases and Turbonomic updates

If you deployed Turbonomic with an external database server, for some updates you might need to manually create a new database and user for that deployment. This is important if your external database server is multi-tenant, or if your deployment does not grant administrative privileges to Turbonomic.

Note:

If your external database server is multi-tenant, or if your database server does not grant administrative privileges to Turbonomic, then you must continue with this configuration requirement.

Azure database services are multi-tenant. If you deployed an external database on Azure, this configuration requirement applies to you.

If you deployed your database server in a way that grants Turbonomic privileges to create new databases and new users, then a product update automatically creates the database. This configuration requirement does not apply to you and you do not need to create the database.

For some Turbonomic updates, the updated version includes new databases on the historical database server. If you are updating to one of these versions, then you must create the new database and a user account with privileges to access that database.

New databases

This table lists the Turbonomic versions that require new databases. If you are updating from an earlier version, you must create the new databases. For example, if you are updating from version 8.0.0 to 8.2.0, then you must create the repository database and the market database.

Turbonomic Version New databases Notes
8.14.1 sustainability If you are updating from a version earlier than 8.14.1, you must create a new database that is named sustainability, and a user account named sustainability.
8.12.4 oauth2 If you are updating from a version earlier than 8.12.4, you must create a new database that is named oauth2, and a user account named oauth2.
8.2.5 api If you are updating from a version earlier than 8.2.5, you must create a new database that is named api, and a user account named api.
8.1.1 market If you are updating from a version earlier than 8.1.1, you must create a new database that is named market, and a user account named market.
8.0.1 repository If you are updating from a version earlier than 8.0.1, you must create a database that is named repository, and a user account named repository.

Creating new databases

To create the databases and users:

  • Manually create each required database.

    Create the database in your DB instance, create a user to access the database, and grant privileges to the user.

  • Manually add each required database to your custom resource (CR) yaml file.

    The CR yaml file declares entries for each component database. Each entry names the component, and gives the user and password that the component can use to access that database. Add an entry for each new database.

To create a new database:

  1. Connect to your external DB with a global account.

    The account must have privileges to create databases and users. If you have specified dbRootUsername in the CR yaml file, you can use that account.

  2. Create the database, where <New_Database> matches the database name in the previous table:

    create database <New_Database>;

    For example, to create a new api database, run:

    create database api;
  3. Create the account that Turbonomic uses to access the database where <New_Database> matches the database name in the previous table:

    create user '<New_Database>'@'%' identified by 'vmturbo';

    For example, to create a user for the api database, run:

    create user 'api'@'%' identified by 'vmturbo';
    Note:

    The value vmturbo is the default password that Turbonomic uses for all component database accounts. If you manually created accounts with different credentials, you can do so for this database as well.

  4. Set the user account privileges for the new user account, where <New_Database> matches the database name in the previous table:

    GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER ON <New_Database>.* TO '<New_Database>'@'%';

    For example, to set account privileges for the api user, run:

    GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER ON api.* TO 'api'@'%';
  5. Flush privileges to make the privileges take effect.

    flush privileges;

Now that the new database is created in your external DB service, you must declare access to it in the Turbonomic CR yaml resource.

  1. Open the CR file for editing.

    The location of the file depends on the type of Turbonomic installation that you are configuring.

    • VM Image installation of Turbonomic

      Log in to an SSH terminal session of your Turbonomic instance as the System Administrator that you set up when you installed Turbonomic.

      /opt/turbonomic/kubernetes/operator/deploy/crds/charts_v1alpha1_xl_cr.yaml
    • Turbonomic on a Kubernetes node or node cluster

      deploy/crds/charts_v1alpha1_xl_cr.yaml
  2. Add the credentials for the matching pod to access the new database.

    Add the entry to the properties: section of the CR yaml file, where <vmturbo> is the user account password, <yourDB> is the qualified name of your external DB or your multi-tenant DB partition, and <New_Database> is the name of your new database.

      <New_Database>:
        <New_Database>DbUsername: <New_Database>@<yourDB>
        <New_Database>DbPassword: <vmturbo>

    For example, if you added the api database, the resulting CR yaml file is similar to the following example:

    properties:
        global:
          enableSecureDBConnection: true
          sqlDialect: MYSQL
          dbRootPassword: yourAdminPassword
          dbRootUsername: xladmin@yourDB
          #dbUserPassword:
          #dbUsername:
        action-orchestrator:
          actionDbUsername: action@yourDB
          actionDbPassword: yourPassword
        auth:
          authDbUsername: auth@yourDB
          authDbPassword: yourPassword
        clustermgr:
          clustermgrDbUsername: clustermgr@yourDB
          clustermgrDbPassword: yourPassword
        cost:
          costDbUsername: cost@yourDB
          costDbPassword: yourPassword
        group:
          groupComponentDbUsername: group_component@yourDB
          groupComponentDbPassword: yourPassword
        history:
          historyDbUsername: history@yourDB
          historyDbPassword: yourPassword
        plan-orchestrator:
          planDbUsername: plan@yourDB
          planDbPassword: yourPassword
        topology-processor:
          topologyProcessorDbUsername: topology_processor@yourDB
          topologyProcessorDbPassword: yourPassword
        repository:
          repositoryDbUsername: repository@yourDB
          repositoryDbPassword: yourPassword
        market:
          marketDbUsername: market@yourDB
          marketDbPassword: yourPassword
        api:
          apiDbUsername: api@yourDB
          apiDbPassword: yourPassword
        actions-history:
          ahDbUsername: ah@yourDB
          ahDbPassword: yourPassword
        oauth2:
          oauth2DbUsername: oauth2@yourDB
          oauth2DbPassword: yourPassword
        sustainability:
          sustainabilityDbUsername: sustainability@yourDB
          sustainabilityDbPassword: yourPassword
        api:
          apiDbUsername: api@yourDB
          apiDbPassword: yourPassword

After you add the database, you can update to the latest version of Turbonomic.

Note:

Upgrading applies changes to the version information in this file.