Clean up an OpenStack database

Clean up an OpenStack databaseΒΆ

Note

This feature is available starting from the MCP 2019.2.12 maintenance update. Before using the feature, follow the steps described in Apply maintenance updates.

Using the Deploy - Openstack Database Cleanup Jenkins pipeline job, you can automatically clean up stale records from the Nova, Cinder, Heat, or Glance database to make it smaller. This is helpful before any update or upgrade activity. You can execute the Deploy - Openstack Database Cleanup Jenkins pipeline job without a maintenance window, just as for an online dbsync.

To clean up an OpenStack database:

  1. Open your Git project repository with the Reclass model on the cluster level.

  2. In <cluster_name>/openstack/control.yml, specify the pillars below with the following parameters:

    • Set db_purge to True.
    • Set days as required. If you skip setting the days parameter:
      • For Nova and Heat, all stale records will be archived or purged.
      • For Cinder on OpenStack Pike, records older than 1 day will be deleted. For Cinder on OpenStack Queens, all entries will be deleted.
      • For Glance, all entries will be deleted.
    • For Nova, set max_rows to limit the rows for deletion. It is safe to specify 500-1000 rows. Unlimited cleanup may cause the database being inaccessible and, as a result, OpenStack being inoperable.

    For example:

    • For Nova:

      nova:
        controller:
          db_purge:
            enabled: True
            max_rows: 1000
            days: 45
      
    • For Cinder:

      cinder:
        controller:
          db_purge:
            enabled: True
            days: 45
      
    • For Heat:

      heat:
        server:
          db_purge:
            enabled: True
            days: 45
      
    • For Glance Available since 2019.2.17 maintenance update:

      glance:
        server:
          db_purge:
            enabled: True
            days: 45
      
  3. Log in to the Jenkins web UI.

  4. Open the Deploy - Openstack Database Cleanup Jenkins pipeline job.

  5. Specify the following parameters:

    Parameter Description and values
    SALT_MASTER_CREDENTIALS The Salt Master credentials to use for connection, defaults to salt.
    SALT_MASTER_URL The Salt Master node host URL with the salt-api port, defaults to the jenkins_salt_api_url parameter. For example, http://172.18.170.27:6969.
  6. Click Deploy.

The Jenkins pipeline job workflow:

  1. For Nova, move the deleted rows from the production tables to shadow tables. Data from shadow tables is purged to save disk space.
  2. For Cinder, purge the database entries that are marked as deleted.
  3. For Heat, purge the database entries that are marked as deleted.
  4. For Glance, purge the database entries that are marked as deleted.