ServiceNow CMDB
Complete Expert Guide + Interview Q&A
CI Classes, Relationships, IRE, Discovery, Service Mapping, Health
governance, CMDB scripting, reconciliation, and 15+ expert Q&A.
For ServiceNow Professionals with 6+ Years Experience
ServiceNow CMDB — Complete Expert Guide + 15 Interview Q&A Page 2
PART 1 — CMDB Complete Guide
1. What is the CMDB and why it matters
The Configuration Management Database is ServiceNow's single source of truth for all IT assets (Configuration Items / CIs)
and their relationships. A healthy CMDB enables: accurate impact analysis during P1 incidents, change risk assessment
before deployments, SLA routing to correct support groups, and compliance reporting. A poorly maintained CMDB is worse
than no CMDB — stale data causes wrong impact assessments and misdirected work.
CMDB Table CI type stored Key fields
cmdb_ci Base class — all CIs inherit name, sys_class_name, install_status, support_group
cmdb_ci_server Physical/virtual servers host_name, ip_address, os, serial_number, cpu_count, ram
cmdb_ci_appl Business applications version, install_dir, running_on, business_criticality
cmdb_ci_service Business services support_group, business_criticality, used_for
cmdb_ci_computer Workstations/laptops os, assigned_to, location, asset_tag
cmdb_ci_network_switch Network switches ip_address, mac_address, location, firmware
cmdb_ci_cloud_service_accou Cloud accounts provider, account_id, region, owner
nt
cmdb_ci_db_instance Database instances type (MySQL/Oracle), host_name, port, schema
cmdb_rel_ci CI relationships (graph parent, child, type (cmdb_rel_type ref)
edges)
2. CI Class hierarchy — extension and inheritance
Every CI class extends cmdb_ci, inheriting ALL parent fields. Incident, Change, and other modules all use INSTANCEOF
queries to match against entire class hierarchies, not just exact table matches. This is why a search for 'all servers' returns
Windows servers, Linux servers, and virtual servers — they all share the cmdb_ci_server ancestor.
// Query ALL servers (including subclasses: Windows, Linux, cloud VMs)
var gr = new GlideRecord('cmdb_ci');
[Link]('sys_class_name', 'INSTANCEOF', 'cmdb_ci_server');
[Link]('install_status', '1'); // Installed only
[Link]();
[Link]('Total active servers: ' + [Link]());
// Create a custom CI subclass (for specialized equipment)
// Navigate: System Definition > Tables > New
// Name: cmdb_ci_industrial_robot | Extends: cmdb_ci_hardware
// Add fields: manufacturer, model_number, arm_reach_cm, payload_kg
// Get a CI's full class hierarchy
var classHier = [Link]()
.getTableExtensions('cmdb_ci_win_server');
// Returns: cmdb_ci, cmdb_ci_hardware, cmdb_ci_server, cmdb_ci_win_server
[Link]([Link](' > '));
3. Relationships — the CMDB graph layer
[Link] | [Link] | [Link] CMDB Expert Reference
ServiceNow CMDB — Complete Expert Guide + 15 Interview Q&A Page 3
Relationship type Direction Real example
Runs on::Runs App sits on Server OrdersApp runs on APP-PROD-02
Depends on::Used by Critical dependency PaymentsApp depends on DB-PROD-01
Hosted on::Hosts VM on hypervisor VM-001 hosted on ESX-HOST-04
Connected to::Connected by Network adjacency SWITCH-A connected to ROUTER-B
Contained by::Contains Physical containment SERVER-01 contained by RACK-A3
Provided by::Provides Vendor/service chain Monitoring provided by Datadog
Members::Member of Cluster grouping DB-PROD-01 is member of DB Cluster
Uses::Used by Software license MS-OFFICE uses License Pool 001
// Create a CI relationship
var rel = new GlideRecord('cmdb_rel_ci');
[Link]();
[Link] = appCISysId; // the 'from' CI
[Link] = serverCISysId; // the 'to' CI
[Link]('Runs on::Runs');
[Link]();
// Query all CIs a server supports (upstream dependencies)
var upstream = new GlideRecord('cmdb_rel_ci');
[Link]('child', serverSysId); // server is the target
[Link]('[Link]', 'Runs on::Runs');
[Link]();
while ([Link]()) {
[Link]('Depends on this server: ' + [Link]());
// Impact analysis: get ALL CIs affected if a CI goes down
function getImpactedCIs(ciSysId, depth) {
if (depth > 5) return []; // prevent infinite loops
var impacted = [];
var rel = new GlideRecord('cmdb_rel_ci');
[Link]('child', ciSysId);
[Link]();
while ([Link]()) {
[Link]([Link]('parent'));
impacted = [Link](getImpactedCIs([Link]('parent'), depth + 1));
return impacted;
4. IRE — Identification & Reconciliation Engine (deep dive)
IRE is the intelligence layer that prevents duplicate CIs when data arrives from multiple sources. Without IRE, every
Discovery scan and every SCCM import would create duplicate records. IRE matches incoming data to existing CIs using
configurable identifier rules before deciding to create, update, or reject a record.
[Link] | [Link] | [Link] CMDB Expert Reference
ServiceNow CMDB — Complete Expert Guide + 15 Interview Q&A Page 4
IRE concept Explanation
Identifier Per-CI-class rule set defining which fields uniquely identify a CI
Identifier Entry Priority-ordered match keys: 1st try serial_number, 2nd try IP+hostname
Reconciliation Rule For matched CIs: which source's data wins on conflict — Discovery > SCCM > Manual
Authoritative Source The highest-trust data source for a CI class — its values override others
Multi-Source A CI populated by 2+ sources — IRE tracks which source owns which field
Reclassification IRE can change a CI's class if a higher-priority source defines it differently
Tombstone Flag preventing lower-priority sources from overwriting a CI's authoritative data
Most common IRE failure: weak identifier rules
Problem: Discovery creates duplicate server CIs after hostname changes.
Root cause: Identifier rule matches on hostname only. Hostnames can change
or be reused (decommissioned server name re-assigned to new VM).
Fix: Change primary identifier to serial_number (globally unique, hardware-bound).
Secondary identifier: MAC address. Tertiary: IP + hostname (least reliable).
Test: run Discovery against 3 known servers, verify 0 duplicates created.
After fix: run deduplication job to merge existing dupes.
5. CMDB Health governance — measuring and maintaining quality
KPI Formula Target Consequence if missed
Completeness % of CIs with mandatory fields > 95% Incomplete CIs break auto-assignment rules
populated
Correctness % of CIs matching real-world state > 98% Incorrect data causes wrong impact analysis
Staleness % of CIs not updated in 90+ days < 5% Stale CIs = false 'all clear' on decommissioned
gear
Orphan rate CIs with zero relationships < 1% Orphans never appear in impact analysis
Duplicate rate Multiple CIs = same physical asset < 1% Duplicate alerts, wrong incident routing
Compliance % following naming/classification 100% Breaks automation and search/filter logic
standards
// Scheduled Job: weekly CMDB health report
var report = { stale: 0, orphan: 0, incomplete: 0 };
// 1. Stale CIs
var stale = new GlideAggregate('cmdb_ci_server');
[Link]('install_status', '1');
[Link]('sys_updated_on', '<', [Link](90));
[Link]('COUNT');
[Link]();
[Link] = [Link]() ? parseInt([Link]('COUNT')) : 0;
// 2. Incomplete CIs (missing support group)
var incomplete = new GlideAggregate('cmdb_ci_server');
[Link]('install_status', '1');
[Link] | [Link] | [Link] CMDB Expert Reference
ServiceNow CMDB — Complete Expert Guide + 15 Interview Q&A Page 5
[Link]('support_group');
[Link]('COUNT');
[Link]();
[Link] = [Link]() ?
parseInt([Link]('COUNT')) : 0;
[Link]('CMDB Health: ' + [Link](report));
// Fire event to send email report to CMDB Manager
[Link]('[Link]', null,
[Link](report), [Link]());
6. Service Mapping deep dive
Concept Explanation
Top-Down Discovery Starts from known entry point (URL/IP), traces downstream CI dependencies
Traffic-Based Analyzes actual TCP connections to map what talks to what in real time
Service Candidate Suggested business service from traffic patterns — requires human confirmation
Horizontal + Top-Down Use Horizontal first to populate CMDB, then Top-Down to build service maps
Map Refresh Service Mapping runs on schedule to detect topology changes automatically
Health Rollup Service health = worst CI health in the map — one CI down = service degraded
Dependency View Visual graph accessible from any CI or business service record
[Link] | [Link] | [Link] CMDB Expert Reference
ServiceNow CMDB — Complete Expert Guide + 15 Interview Q&A Page 6
PART 2 — CMDB Interview Q&A (15 Questions)
What is a Configuration Item and what are the most common CI classes in
Q1 Fresher
ServiceNow?
A CI (Configuration Item) is any component of your IT infrastructure that
needs to be managed and tracked — servers, applications, databases, network
devices, cloud services, certificates, even business services. The most
common CI classes: cmdb_ci_server (physical and virtual servers),
cmdb_ci_appl (applications), cmdb_ci_service (business services),
cmdb_ci_computer (workstations/laptops), cmdb_ci_network_switch/router
(network infrastructure), and cmdb_ci_db_instance (databases).
Q2 What is IRE and why is it critical for multi-source CMDB environments? Mid
IRE (Identification & Reconciliation Engine) prevents duplicate CI creation
when multiple data sources (Discovery, SCCM, ServiceNow Agent, JAMF, manual
imports) all send data about the same physical device. Without IRE, the same
server would get 3 separate CI records — one per data source. IRE uses
configurable Identifier Rules to match incoming data to existing CIs before
creating anything new. In multi-source environments, IRE also enforces
Reconciliation Rules — defining which source's values win when there's a
conflict (e.g. Discovery overwrites SCCM for OS version, but SCCM wins for
installed software list since Discovery may not see all installed apps).
Your CMDB has a 35% duplicate CI rate for servers. Walk me through a complete
Q3 Senior
remediation plan.
Step 1 — Diagnose root cause: check IRE logs for the cmdb_ci_server class.
Most likely the identifier rule is matching on hostname alone — which breaks
when hostnames change or get reused after decommission. Also check if SCCM
and Discovery are both active without a reconciliation rule between them.
Step 2 — Fix identifier rules: change primary key to serial_number, secondary
to MAC address, tertiary to hostname+IP. Never rely on hostname alone.
Step 3 — Deduplicate existing records: run a script that groups server CIs
by serial_number, picks the most recently updated as the 'survivor', merges
all relationships and incident references from duplicates onto the survivor,
[Link] | [Link] | [Link] CMDB Expert Reference
ServiceNow CMDB — Complete Expert Guide + 15 Interview Q&A Page 7
then marks duplicates as 'Retired' (don't delete — preserve audit history).
Step 4 — Prevent recurrence: run Discovery against 10 test servers, verify
zero duplicates created. Set up weekly duplicate detection report.
Step 5 — Process governance: document who is the authoritative source per
CI class and enforce via Reconciliation Rules.
Q4 Explain the difference between 'Runs on' and 'Depends on' relationships. Mid
'Runs on' is a HOSTING relationship — it means a software component
executes on a hardware/platform CI. OrdersApp RUNS ON APP-PROD-02.
It describes WHERE something physically/logically executes.
'Depends on' is a FUNCTIONAL dependency — it means one CI requires
another CI to function correctly. OrdersApp DEPENDS ON DB-PROD-01.
It describes WHAT a CI needs to work. A CI can both run on a server AND
depend on a database — these are different, coexisting relationships.
For impact analysis: 'Depends on' is critical because if DB-PROD-01
fails, everything that depends on it fails too, regardless of where it runs.
CODING: Write a script to find all Business Services affected if a specific server CI
Q5 Coding
goes offline.
function getAffectedServices(serverSysId) {
var affected = [];
var visited = {};
var queue = [serverSysId];
while ([Link] > 0) {
var currentId = [Link]();
if (visited[currentId]) continue;
visited[currentId] = true;
var rel = new GlideRecord('cmdb_rel_ci');
[Link]('child', currentId);
[Link]();
while ([Link]()) {
var parentId = [Link]('parent');
var parentClass = [Link]().getValue('sys_class_name');
[Link] | [Link] | [Link] CMDB Expert Reference
ServiceNow CMDB — Complete Expert Guide + 15 Interview Q&A Page 8
if (parentClass == 'cmdb_ci_service') {
[Link]([Link]());
} else {
[Link](parentId); // traverse up the graph
return affected;
var services = getAffectedServices('server_sys_id_here');
[Link]('Affected services: ' + [Link](', '));
What is a Known Error in the context of CMDB and how does it relate to Problem
Q6 Mid
Management?
A Known Error isn't directly a CMDB concept — it belongs to Problem Management.
However, CMDB and Known Errors intersect powerfully: a Known Error on a
Problem record should always reference the specific CMDB CI that has the
underlying defect (via the 'Configuration item' field on the Problem record).
This linkage means: when any new Incident references the same CI, ServiceNow
can auto-suggest the Known Error's workaround to the helpdesk agent,
dramatically reducing repeat investigation time. The CI is the pivot that
connects the Problem's root cause to future related Incidents.
How do you ensure CMDB data quality for cloud infrastructure that scales
Q7 Senior
dynamically?
Static Discovery schedules don't work for cloud — an EC2 instance spun up
at 2pm won't appear in CMDB until the next nightly scan. The solution:
event-driven CMDB updates. Configure AWS CloudTrail / Azure Activity Log
to send EC2 create/terminate events to ServiceNow via webhook. A Scripted
REST API endpoint receives the event, creates or retires the CI immediately.
For tagging: enforce mandatory tags (Owner, CostCenter, Environment) in
cloud policy (AWS SCPs / Azure Policy), then map those tags to CMDB CI
fields via the cloud spoke import. For dynamic resources (Lambda, containers):
decide consciously whether they should be CIs at all — track at the
application service level, not individual function level.
[Link] | [Link] | [Link] CMDB Expert Reference
ServiceNow CMDB — Complete Expert Guide + 15 Interview Q&A Page 9
CODING: Write a Business Rule that auto-populates the 'Support Group' field on
Q8 Coding
new CIs based on CI class.
// Table: cmdb_ci | When: Before | Insert: true
(function executeRule(current, previous) {
if () return; // already set
// Map CI class to default support group
var classToGroup = {
'cmdb_ci_server': 'Server Operations',
'cmdb_ci_network_switch': 'Network Operations',
'cmdb_ci_appl': 'Application Support',
'cmdb_ci_database': 'DBA Team',
'cmdb_ci_computer': 'Desktop Support'
};
var ciClass = [Link]('sys_class_name');
var groupName = classToGroup[ciClass];
if (groupName) {
var grp = new GlideRecord('sys_user_group');
if ([Link]('name', groupName)) {
current.support_group = [Link]();
})(current, previous);
[Link] | [Link] | [Link] CMDB Expert Reference