Architecture
CMDB-Driven Automation Failing: The IRE-First Diagnosis Senior Architects Demand
The Scenario
You've built sophisticated CMDB-driven automations—incident routing by service owner, change impact analysis via relationships, even Now Assist predictions feeding off CI attributes. But production is failing: tickets route to ghost owners, risk scores spike on retired servers, and your custom business rules glitch because duplicate CIs fragment relationships. As the senior architect, stakeholders demand a systematic fix, not finger-pointing at Discovery schedules.
Experts don't chase symptoms; they start with IRE diagnostics, then layer in health metrics and source precedence. This isn't basic config—it's the production pattern translating your data architecture instincts to ServiceNow's graph reality.
Key Questions Answered
Q: What's the root cause diagnosis approach?
A: Begin with IRE Audit logs and CMDB Health Dashboard scores—think database query plans meets graph traversal diagnostics. Query IRE reconciliation history for your failing CI class (e.g., cmdb_ci_server) to spot duplicate creation or authoritative source overrides. Cross-reference with Discovery pattern execution logs and third-party ingest failures. Rule of thumb: if Completeness falls below ~85% or duplicates exceed ~5% of a class population, expect CMDB-driven automation to misfire regularly.
Q: What are the key concepts I need to master?
A: CI Identification via IRE rules (payload patterns, exact match on serial+hostname); Reconciliation defines source hierarchy (Discovery trumps Import Sets); Discovery Patterns are your ETL jobs—horizontal for infra, top-down for apps; Data Quality Metrics via Health Dashboard: Completeness (mandatory fields filled), Correctness (validated against source), Compliance (class manager rules). Map your RDBMS normalization to this: IRE is unique constraints, patterns are CDC pipelines, metrics are data profiling scores.
Q: What's the step-by-step solution pattern?
A: 1) Scope critical CI classes via business impact (services > servers). 2) Enforce IRE on all sources with strict identification rules. 3) Schedule Discovery/Service Mapping + third-party ETL via IntegrationHub. 4) Activate CMDB Data Manager policies for auto-retire (90-day stale). 5) Certify quarterly with health rules generating tasks. 6) Integrate with Change Management for real-time reflection. This builds a self-healing loop, like Kubernetes controllers reconciling desired vs actual state.
Q: What are the common mistakes and anti-patterns?
A: Bypassing IRE on manual imports creates duplicates (80% of prod failures). Over-scoping CMDB to every asset bloats tables, killing query perf. Ignoring source precedence lets SCCM overwrite Discovery. No retirement policies orphan millions of CIs. Fix: IRE-first, scope to business-critical, automate validation.
Q: How do I prevent this in future development?
A: Embed IRE validation in dev pipelines—unit test identification payloads. Use CMDB Workspace for policy-as-code. Design automations with health score gates (e.g., flow aborts if class score <90%). Quarterly IRE rule reviews tied to release trains.
Q: How do I measure success?
A: Track CMDB Health KPIs: aim for 95%+ Completeness/Correctness/Compliance. Monitor duplicate ratio <1%, stale CI retirement rate >90-day policy compliance. Business proxy: incident MTTR drop 30%, change risk accuracy up 25%. Use dashboard widgets for CI class trends.
The Translation Map
Your architecture maps directly—here's the ServiceNow equivalent:
| Your World | ServiceNow CMDB | Key Diff/Tradeoff |
|---|---|---|
| Kubernetes StatefulSet + unique ID | IRE Identification Rules (serial/fqdn payload) | Graph-aware; multi-attribute match vs single selector |
| CDC Kafka Streams | Discovery Patterns + Service Graph Connectors | Push model; patterns parse CLI/API like regex extractors |
| DataDog Metrics + Great Expectations | CMDB Health Dashboard (C3 scores) | Out-of-box; auto-tasks vs custom alerts |
| AWS Lambda cleanup cron | CMDB Data Manager Policies | Cascading retire; dependents auto-follow |
| DB unique constraints + MERGE | IRE Reconciliation (source priority) | Authoritative wins; audit trail per field |
Hands-On: See It Work
// Before: Broken automation - duplicate servers break relationship queries
// Query shows duplicates in cmdb_ci_server
var gr = new GlideRecord('cmdb_ci_server');
gr.addQuery('name', 'CONTAINS', 'prod-web');
gr.query();
var dupCount = 0;
while(gr.next()) {
gs.info('Duplicate: ' + gr.getUniqueValue() + ' | Serial: ' + gr.serial_number);
dupCount++;
}
gs.info('Duplicates found: ' + dupCount); // Often 3-5 per real server
// AFTER: IRE Fix Script - Enforce identification + reconcile
// Run in background script or Fix Script for prod cleanup
// Step 1: Activate IRE rule for cmdb_ci_server (UI: cmdb_ci_service_ire > New)
// Payload: serial_number||name||ip_address (exact match)
// Sources: Discovery (highest), Import Set (medium)
// Step 2: Reconcile through the real IRE scripted API
// sn_cmdb.IdentificationEngine.createOrUpdateCI(source, jsonPayload) runs
// your identification rules and merges/updates instead of inserting blind.
var items = [];
var serverGR = new GlideRecord('cmdb_ci_server');
serverGR.addQuery('name', 'CONTAINS', 'prod-web');
serverGR.query();
while (serverGR.next()) {
items.push({
className: 'cmdb_ci_server',
values: {
name: serverGR.getValue('name'),
serial_number: serverGR.getValue('serial_number'),
ip_address: serverGR.getValue('ip_address')
}
});
}
var output = sn_cmdb.IdentificationEngine.createOrUpdateCI('ServiceNow',
JSON.stringify({ items: items }));
gs.info('IRE processed ' + items.length + ' payload items: ' + output);
// Step 3: Health gate. CMDB Health scores are computed by the CMDB Health
// Dashboard jobs - there is no public CMDBHealthScore scripting API.
// Gate your flows on the published health KPI instead: read your PA
// indicator for class completeness and abort the flow when it drops
// below your threshold (say 90%).
// Deploy: Schedule as job, trigger from Change/Incident workflowsThis script mirrors your bulk ETL jobs: query suspects, build identification payloads, and feed the Identification Engine for de-dup/merge. Post-run, duplicates collapse and relationships resolve. Extend for your classes—swap cmdb_ci_server for cmdb_ci_appl. Why it scales: IRE batch-processes payloads with an audit trail for compliance.
What Transfers vs What's Different
Transfers directly: Your data pipeline mindset (ETL, profiling, constraints) maps perfectly to patterns/IRE/health. Automation orchestration skills apply to scheduled jobs/Flow Designer. Graph thinking from cloud native directly aids relationships.
Requires new learning: IRE payload syntax (not SQL MATCH), class manager hierarchy (Common Services Data Model), horizontal discovery patterns (parsing behaviors). Steeper curve: CMDB Workspace policy engine—less code, more declarative. Tradeoff: Less YAML flexibility, but built-in ITSM integration accelerates ROI.
The Business Impact
Fixed CMDB slashes incident MTTR via accurate routing and impact analysis. Change success rates climb with real relationship graphs—fewer outages, faster releases. Now Assist predictions gain precision, unlocking gen AI value. Bottom line: material risk-reduction savings at enterprise scale; your automations become the single source of operational truth.
Common Traps to Avoid
- Trap: Manual CI creates bypassing IRE, spawning duplicates. Solution: Set UI policies to force IRE on create/edit; validate payloads in ATF tests.
- Trap: All sources equal precedence—SCCM nukes Discovery data. Solution: IRE source order: Discovery > Graph Connectors > Import Sets > Manual.
- Trap: No stale CI cleanup—tables bloat to 10M+ rows. Solution: Data Manager policy: retire if no update/discovery in 90 days, cascade to children.
- Trap: Ignoring class health—automation runs on bad data. Solution: Flow condition: if(cmdb_health_score < 90) abort.
- Trap: Over-customizing patterns without Service Graph. Solution: Start with OOB patterns + Connectors; custom only for exotic endpoints.
Your Next Steps
- Run IRE audit on your top 3 CI classes today—query ire_audit_log for duplicates.
- Deploy the script above as Fix Script; baseline vs post health scores.
- Schedule Discovery + activate one Data Manager policy this week.
- Book CMDB Workspace training; certify your critical services in 30 days.
Implement these, and your CMDB becomes the automation accelerator enterprises crave.