Menu Close

Red Hat Training

A Red Hat training course is available for Red Hat CloudForms

Integration with ServiceNow

Red Hat CloudForms 4.7

Integrating ServiceNow CMDB with Red Hat CloudForms

Red Hat CloudForms Documentation Team


This guide provides instructions for using the CloudForms Management Engine features relevant to non-administrative users. It establishes basic system and operational concepts through task-based scenarios and examples.
If you have a suggestion for improving this guide or have found an error, please submit a Bugzilla report at against Red Hat CloudForms Management Engine for the Documentation component. Please provide specific details, such as the section number, guide name, and CloudForms version so we can easily locate the content.
Integration with ServiceNow CMDB is available as a technology preview in this release of Red Hat CloudForms. For more information on the support scope for features marked as technology previews, see Technology Preview Features Support Scope.

Chapter 1. Overview

Red Hat CloudForms integration with ServiceNow enables authentication with an existing ServiceNow database and add/amend items in the ServiceNow database during state machine processing, such as the virtual machine provisioning state machine. Note that information in this guide assumes you have credentials and access to a ServiceNow database instance.

The following new namespace and class delivers support for the management of ServiceNow Configuration Management Database (CMDB) records using ServiceNow’s RESTful web service.


You can manage records in the CMDB_CI_SERVER table, including create, update, and/or delete. The following methods are included:



Create record in specified ServiceNow table.


Delete record in specified ServiceNow table.


Get record from specified ServiceNow table and list its attributes.


Get all records in ServiceNow and list attributes.


Get specified record, update required attributes and post updated record.


Post required attributes to specified record.


Configuration item (CI) and record are used interchangeably and refer to items in a ServiceNow database table.

Chapter 2. Configuring ServiceNow Connection

Configure the connection to the ServiceNow database by specifying the credentials in the CMDB schema or instances within.

The following methods are included:


ServiceNow database IP address or resolvable hostname.


ServiceNow user account with the necessary permissions.


Associated user account password.

The table name cannot be changed unless there is a specific requirement to manage records elsewhere. Entries in this table appear in the ConfigurationBase ItemsServers menu in the ServiceNow web user interface.


ServiceNow cmdb_ci_server database table.

Chapter 3. Managing Record Attributes

You can specify any attribute via the URI or CMDB class instance. If neither exists, the value is determined from the Red Hat CloudForms VM or miq_provision objects.

The attributes can be reduced or extended as required by amending the Ruby methods.


Some attributes are not free-text (variable) fields, that is, they must be specific values. For example, the vendor value must already exist in the ServiceNow Vendor table beforehand.

3.1. Create and Update (_patch) Record

You can use the following attributes when creating and/or updating a record.

3.1.1. Attribute




Boolean true or false, set to true.

name VMs

Virtual infrastructure name.


Red Hat CloudForms virtual machine GUID.


The virtual machine’s operating system hostname.


The virtual machine’s CPU count.


The virtual machine’s memory.


The virtual machine’s hardware vendor (provider).

sys_id [a]

ServiceNow record unique system ID.

[a] sys_id attribute is not required during create. Its value is returned from the create request and the Red Hat CloudForms object custom attribute servicenow_sys_id is created and updated.

3.2. Get and Delete Record

You can use the following attribute for getting or deleting a record.




ServiceNow record unique system ID.

3.3. Get All Records

There are no attributes required to get all records. This method gets all records in the specified ServiceNow table and writes their attributes to automation.log.

Chapter 4. Use Cases

The following examples show how ServiceNow can be integrated with automation workflows.

4.1. Provisioning a Virtual Machine from a Template

The Cloud and Infrastructure Provision VM from Template State Machines contain RegisterCMDB and ActivateCMDB states.

To create a new ServiceNow record during virtual machine provisioning, amend the ActiveCMDB state to call the create method, for example:



4.2. Virtual Machine Retirement

The Cloud and Infrastructure default Retirement State Machines contain the DeactivateCMDB state.

To update a virtual machine’s ServiceNow record during virtual machine retirement, amend the DeactivateCMDB state to call the update_patch method, for example:



4.3. Virtual Machine Reconfiguration (VMware Only)

Create a new System Event instance to update the ServiceNow record after a virtual machine reconfiguration request has been approved and completed.

Create a new /System/Event/ReconfigVM_Task_Complete instance with a relationship value: