Running configuration drift detection

Run the drift detection playbook to generate baseline snapshots, collect current configurations, and detect configuration drift in your IBM Storage Protect environment.

Before you begin

Before you begin, ensure that you completed the following tasks:

About this task

The drift detection process involves three main phases: generating a baseline snapshot, collecting current configuration snapshots, and comparing them to detect drift. The first run creates the baseline, and subsequent runs detect changes.

When you run the playbook after the initial baseline is created, you are prompted to select a baseline acceptance mode to control how drift changes are handled.

Procedure

To run drift detection, complete the following steps:

  1. Generate the baseline configuration snapshot by running the playbook for the first time:
    ansible-playbook -i inventory.ini \
      ibm.storage_protect.sp_server_facts_playbook.yml \
      -e @vars.yml
    The playbook collects the current configuration and saves it as the baseline. Baseline files are created in the reports directory with the naming pattern baseline_host.json.
  2. Wait for a period of time to allow configuration changes to occur, then run the playbook again to collect the current snapshot and detect drift:
    ansible-playbook -i inventory.ini \
      ibm.storage_protect.sp_server_facts_playbook.yml \
      -e @vars.yml
    The playbook collects the current configuration, compares it to the baseline, and generates drift reports.
  3. When prompted, select the baseline acceptance mode:
    Mode Description
    all Accept drift changes for all hosts in the play. The current configuration becomes the new baseline for all hosts.
    selected Accept drift changes for specific hosts only. You are prompted to enter comma-separated hostnames (for example, v1,v3).
    none Do not accept any drift changes. The baseline remains unchanged.
    Tip: Use the selected mode to accept drift changes for hosts where changes are expected while maintaining the baseline for other hosts.
  4. Review the generated drift reports in the reports directory:
    The following files are generated for each host:
    • current_host.json - Latest configuration snapshot
    • baseline_host.json - Approved baseline configuration
    • drift_report_host.json - Structured drift data in JSON format
    • drift_report_host.html - Human-readable drift report
    • drift_report_bundle_host.zip - Complete report bundle
    • sp_field_distribution_host.md - Coverage metrics
  5. Open the HTML drift report to review detected changes:
    open reports/drift_report_host.html

    Replace host with the actual hostname from your inventory.

Results

After completing these steps, drift reports are generated and available for review. The reports show all configuration changes detected between the baseline and current snapshots, classified by severity and change type.

What to do next

Schedule the drift detection playbook to run periodically (daily or weekly) to maintain continuous monitoring of configuration changes. If you encounter issues, see Resolving configuration drift detection problems.