CMDB Data Model & Relationships

SandeepKSingh
Kilo Sage

can anyone Explain the difference between cmdb_ci and cmdb_rel_ci tables. How would you customize relationships to allow non-standard connections (e.g., a VM to a Business Service)?

2 ACCEPTED SOLUTIONS

Ravi Gaurav
Giga Sage
Giga Sage

Hi @SandeepKSingh 

 

The below answer is from ServiceNow community :-

 

 

In ServiceNow, both the cmdb_ci and cmdb_rel_ci tables play essential roles in managing configuration items (CIs) and their relationships, but they serve different functions:

  1. cmdb_ci table: This is the core Configuration Item (CI) table, which stores records for individual CIs, such as computers, applications, business services, etc. Each CI in your environment, like a server or a business service, is represented as a record in this table or in its extended tables (e.g., cmdb_ci_computer, cmdb_ci_vm_instance, cmdb_ci_business_service, etc.).

  2. cmdb_rel_ci table: This table defines the relationships between CIs stored in the cmdb_ci table. Each record in cmdb_rel_ci represents a relationship between two CIs, indicating, for example, that a specific server "hosts" a specific application. It includes fields like parent (the source CI), child (the target CI), and type (the relationship type, e.g., "Runs on" or "Depends on").

--------------------------------------------------------------------------------------------------------------------------


If you found my response helpful, I would greatly appreciate it if you could mark it as "Accepted Solution" and "Helpful."
Your support not only benefits the community but also encourages me to continue assisting. Thank you so much!

Thanks and Regards
Ravi Gaurav | ServiceNow MVP 2025,2024 | ServiceNow Practice Lead | Solution Architect
CGI
M.Tech in Data Science & AI

ï”— YouTube: https://www.youtube.com/@learnservicenowwithravi
ï”— LinkedIn: https://www.linkedin.com/in/ravi-gaurav-a67542aa/

View solution in original post

Moin Kazi
Kilo Sage
Kilo Sage

Hi @SandeepKSingh ,

 

Difference between cmdb_ci and cmdb_rel_ci:

  1. cmdb_ci:

    • This table stores all configuration items (CIs) in the CMDB. A CI can be anything that is essential to the operation of IT services, such as servers, applications, databases, and networks.
    • Each record in cmdb_ci represents a distinct CI with various attributes (like name, type, status, etc.).
  2. cmdb_rel_ci:

    • This table is used to define relationships between the CIs stored in cmdb_ci. It captures how different CIs are interconnected.
    • Each record in cmdb_rel_ci includes fields that reference two CIs (parent and child) and specifies the type of relationship (like "depends on," "runs on," etc.).

Customizing Relationships for Non-Standard Connections:

To allow non-standard connections (e.g., a Virtual Machine (VM) to a Business Service), follow these steps:

  1. Create Custom Relationship Types:

    • In the cmdb_rel_ci table, you can add new relationship types that are relevant to your business needs. Go to the Relationship Types module in ServiceNow and create a new type, such as "hosts" or "supports," that indicates the nature of the relationship between the VM and the Business Service.
  2. Modify CI Class Hierarchy:

    • Ensure that both the VM and Business Service are appropriately defined in the cmdb_ci table. You may need to adjust the class hierarchy to ensure that they can relate to each other.
  3. Add Relationship Records:

    • Once your relationship type is established, create records in the cmdb_rel_ci table. Set the parent CI as the Business Service and the child CI as the VM, selecting your newly created relationship type.
  4. Use Service Mapping (if applicable):

    • If your organization uses Service Mapping, you can define service maps that explicitly show how different CIs, including VMs and Business Services, are related.
  5. Adjust Forms and UI:

    • Customize the forms and UI to facilitate the creation of these relationships, ensuring that users can easily link VMs to Business Services without confusion.

 

By implementing these steps, you can create a flexible and comprehensive CMDB that accurately reflects the relationships between various configuration items, including non-standard connections.

 

 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

If you found my response **helpful**, I’d appreciate it if you could take a moment to select **"Accept as Solution"** and **"Helpful"** Your support not only benefits me but also enriches the community.

 

Thank you!
Moin Kazi

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View solution in original post

2 REPLIES 2

Ravi Gaurav
Giga Sage
Giga Sage

Hi @SandeepKSingh 

 

The below answer is from ServiceNow community :-

 

 

In ServiceNow, both the cmdb_ci and cmdb_rel_ci tables play essential roles in managing configuration items (CIs) and their relationships, but they serve different functions:

  1. cmdb_ci table: This is the core Configuration Item (CI) table, which stores records for individual CIs, such as computers, applications, business services, etc. Each CI in your environment, like a server or a business service, is represented as a record in this table or in its extended tables (e.g., cmdb_ci_computer, cmdb_ci_vm_instance, cmdb_ci_business_service, etc.).

  2. cmdb_rel_ci table: This table defines the relationships between CIs stored in the cmdb_ci table. Each record in cmdb_rel_ci represents a relationship between two CIs, indicating, for example, that a specific server "hosts" a specific application. It includes fields like parent (the source CI), child (the target CI), and type (the relationship type, e.g., "Runs on" or "Depends on").

--------------------------------------------------------------------------------------------------------------------------


If you found my response helpful, I would greatly appreciate it if you could mark it as "Accepted Solution" and "Helpful."
Your support not only benefits the community but also encourages me to continue assisting. Thank you so much!

Thanks and Regards
Ravi Gaurav | ServiceNow MVP 2025,2024 | ServiceNow Practice Lead | Solution Architect
CGI
M.Tech in Data Science & AI

ï”— YouTube: https://www.youtube.com/@learnservicenowwithravi
ï”— LinkedIn: https://www.linkedin.com/in/ravi-gaurav-a67542aa/

Moin Kazi
Kilo Sage
Kilo Sage

Hi @SandeepKSingh ,

 

Difference between cmdb_ci and cmdb_rel_ci:

  1. cmdb_ci:

    • This table stores all configuration items (CIs) in the CMDB. A CI can be anything that is essential to the operation of IT services, such as servers, applications, databases, and networks.
    • Each record in cmdb_ci represents a distinct CI with various attributes (like name, type, status, etc.).
  2. cmdb_rel_ci:

    • This table is used to define relationships between the CIs stored in cmdb_ci. It captures how different CIs are interconnected.
    • Each record in cmdb_rel_ci includes fields that reference two CIs (parent and child) and specifies the type of relationship (like "depends on," "runs on," etc.).

Customizing Relationships for Non-Standard Connections:

To allow non-standard connections (e.g., a Virtual Machine (VM) to a Business Service), follow these steps:

  1. Create Custom Relationship Types:

    • In the cmdb_rel_ci table, you can add new relationship types that are relevant to your business needs. Go to the Relationship Types module in ServiceNow and create a new type, such as "hosts" or "supports," that indicates the nature of the relationship between the VM and the Business Service.
  2. Modify CI Class Hierarchy:

    • Ensure that both the VM and Business Service are appropriately defined in the cmdb_ci table. You may need to adjust the class hierarchy to ensure that they can relate to each other.
  3. Add Relationship Records:

    • Once your relationship type is established, create records in the cmdb_rel_ci table. Set the parent CI as the Business Service and the child CI as the VM, selecting your newly created relationship type.
  4. Use Service Mapping (if applicable):

    • If your organization uses Service Mapping, you can define service maps that explicitly show how different CIs, including VMs and Business Services, are related.
  5. Adjust Forms and UI:

    • Customize the forms and UI to facilitate the creation of these relationships, ensuring that users can easily link VMs to Business Services without confusion.

 

By implementing these steps, you can create a flexible and comprehensive CMDB that accurately reflects the relationships between various configuration items, including non-standard connections.

 

 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

If you found my response **helpful**, I’d appreciate it if you could take a moment to select **"Accept as Solution"** and **"Helpful"** Your support not only benefits me but also enriches the community.

 

Thank you!
Moin Kazi

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~