Understand CI deletion strategies for pattern-based Discovery<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } span { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } h2 { font-size: 24pt; font-family: Lato; color: var(--now-color--text-primary, black); } h3 { font-size: 18pt; font-family: Lato; color: var(--now-color--text-primary, black); } h4 { font-size: 14pt; font-family: Lato; color: var(--now-color--text-primary, black); } a { font-size: 12pt; font-family: Lato; color: var(--now-color--link-primary, #00718F); } a:hover { font-size: 12pt; color: var(--now-color--link-primary, #024F69); } a:target { font-size: 12pt; color: var(--now-color--link-primary, #032D42); } a:visited { font-size: 12pt; color: var(--now-color--link-primary, #00718f); } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } CI deletion strategies compare the previous Discovery result for a device with the current result. The strategy executes based on the delta between those two runs. For example, if a device appeared in the previous Discovery run but is missing in the current run, and the deletion strategy is set to Delete, the system deletes the device. If the strategy is set to Keep, the system retains the device in the configuration management database (CMDB). Deltas are calculated only between two consecutive Discovery runs. If a device was kept in the CMDB based on its deletion strategy, and you then change the strategy to Delete, the system will not delete the device on the next run. Because the device was already absent in the previous run, there is no new delta to trigger deletion. Ref: CI deletion strategies for pattern discovery FAQs Why does ServiceNow set a different deletion strategy for each pattern? Each pattern has its own default settings that ship with the base system. You can change the setting if the default does not fit your environment. Default strategies vary for several reasons: Some are set to Keep so you can decide whether to delete the CI or mark it as absent.Other strategies are set based on the environment where the pattern was developed, as most pattern development occurs in customer environments.Some pattern models ship with a deletion strategy based on a model request. How quickly does the deletion strategy run? Deletion runs every time the pattern runs. The strategy executes when the system processes the payload through HorizontalDiscoveryResultHandler, before passing the payload to the Identification and Reconciliation Engine (IRE). How do I manage the lifecycle of application CIs that have no defined deletion strategy? Several deletion strategies ship with the base system for Main CI classes, but these do not include classes like tomcat servers (cmdb_ci_app_server_tomcat). You can create a custom deletion strategy for this class by creating a record in the Related CI types table. Point the record to the Tomcat pattern and Tomcat class, set Is Main CI to true, and select either Mark as Retired or Mark as Absent for the deletion strategy. Note: The Main CI class is the CI Type defined in the horizontal pattern. The Tomcat horizontal pattern uses cmdb_ci_app_server_tomcat as its CI Type, so that class serves as the Main CI class in the Related CI types table. If creating a custom deletion strategy does not meet your needs, you have two additional options to mark Application Configuration Items either “Retired” or Delete them (may require custimization). Option 1: Use CMDB staleness and remediation rules Apply CMDB health staleness rules and remediation rules to specific tables such as cmdb_ci_app_server_tomcat or to the cmdb_ci_appl table: Create a CMDB Health staleness rule Create a CMDB remediation rule Option 2: Use a scheduled job Create a scheduled job that scans a table such as cmdb_ci_app_server_tomcat and marks records as Retired if they have not been discovered or updated recently. Combined with a table cleaner, this approach removes old records that are no longer being discovered. You can apply this method to specific tables or to the cmdb_ci_appl table.