Cleaning up deployment history files

You can clean up the deployment history files to reduce the database storage that HCL DevOps Deploy (Deploy) uses.

About this task

You can enable the deployment history cleanup and specify when the cleanup process begins, the duration of the cleanup, and the number of days to retain the deployment history. You can clean up the deployment history files in the following three ways:
Important: The deployment history cleanup process deletes all records in the database and the file system that are related to the deployments that you're deleting. The cleanup cannot be undone. It is important that you carefully choose the items that you delete.

For the cleanup process to start and run according to specifications, the cleanup process must be turned ON in by your administrator in System Settings and Use Deployment History Cleanup must be selected in environment settings. By default, the deployment history cleanup settings in both the administrator and environment settings are turned off.

The following table shows how the cleanup configuration works based on your selection:
Table 1. Enabling deployment history cleanup
Enable Deployment History Cleanup option in System Settings (administrator's setting) Use Deployment History Cleanup check box in environment settings Result
On Selected Cleanup starts as specified for deployments that are associated with this environment.
On Cleared Cleanup does not start for deployments that are associated for this environment.
Off Selected Cleanup does not start for deployments that are associated with this environment.
For example, you have two environments; environment A and environment B and your administrator has enabled deployment history cleanup settings in System Settings. In the environment B settings, the Use Deployment History Cleanup check box is cleared. The Use Deployment History Cleanup check box is selected for environment A. When the cleanup process starts, the deployments history associated with environment A will only be deleted per your configuration.

While the administrator has the Enable Deployment History Cleanup option turned off, even when a user selects Use Deployment History Cleanup for an environment, the deployment history cleanup process remains turned off.

An example usage of the cleanup configuration fields are explained in Example usage.
Note: Despite these settings, deployment history cleanup will not work when:
  • The deployments are associated with an active inventory of any type, such as deployed component version, resource, resource configuration, and environment properties.
  • The server is in an HA cluster and one of the instances is actively running a deployment history clean up job.

Configuring the system settings

Before you begin

Ensure that you have the following permissions to edit the system settings:
  • Web UI > Settings Tab
  • Server Configuration > Edit Basic System Settings

About this task

Procedure

  1. In Deploy, click the Settings tab, and then in the System column, click System Settings.
  2. Scroll to the Process History Cleanup area.
  3. Set Enable Deployment History Cleanup option to On.
  4. In Daily Cleanup Start Time, select the hour to start the daily cleanup process.
  5. In Daily Cleanup Duration (hours), specify the number of hours for the cleanup process to run.
  6. In Days to Retain Deployment History, specify the default number of days to keep the deployment history before the cleanup process removes the history.

Results

When cleanup begins, a progress indicator shows details about the cleanup process.

Configuring individual environment settings

Before you begin

Ensure that you have the following permissions to edit the deployment history files for individual environments:
  • Environment > Edit > Manage Environment Cleanup
  • Web UI > Applications Tab

About this task

Procedure

  1. Click Applications, click an application, click an environment, click Configuration, and then click Basic Settings.
  2. Select Use Deployment History Cleanup.
  3. Perform any one of the following steps:
    • Select Use Default Deployment History Retention to keep deployment history details for the number of days that the administrator specified.
    • Clear the Use Default Deployment History Retention option and specify the number of days to keep deployment history details in the Days to Retain Deployment History field.

Results

When cleanup begins, a progress indicator shows details about the cleanup process.

Example usage

About this task

This example helps you understand how cleanup works in Deploy.

If the date is 14 December 2016, and you have used the following settings:

  • Enable Deployment History Cleanup in System Settings: Enabled
  • Daily Cleanup Start Time in System Settings: 9:00 PM
  • Daily Cleanup Duration (hours) in System Settings: 3
  • Days to Retain Deployment History in System Settings: 15
  • Use Deployment History Cleanup in the environment settings: Enabled
  • Use Default Deployment History Retention in the environment settings: Enabled

At 9:00 PM on 14 December 2016, the deployment history begins to run for 3 hours. During the 3 hours, all records of the deployment that are 15 days old and older are deleted. The three hours might be insufficient to delete all records that meet the cleanup criteria. In this case, cleanup resumes operations the next day as scheduled. If you need to clear more disk space, increase the cleanup duration.

Notes:
  • If the cleanup settings are changed before 14 December 9:00 PM, then items that are deleted will not be the same as in this example.
  • You can make changes to the settings after this date and change it multiple times.
  • At any time, the administrator or users with privileges can change whether the cleanup process runs, what cleanup removes, when cleanup starts, and how long cleanup runs.
Tip: It is not recommended to cleanup all history at once. For example, if your goal is to keep certain data for 10 days before it is cleaned up, you should slowly reduce the number of days to keep, so that you do not attempt to cleanup the last 4 years all at the same time.