ServiceNow CMDB policy
9 minute read
Setup overview
To use the ServiceNow CMDB module:
- Create a ServiceNow CMDB Module Credential.
- Create a ServiceNow Endpoint. If applicable, configure ServiceNow proxy support.
- Create a ServiceNow CMDB Policy and define ServiceNow IRE Templates.
- Provision with ServiceNow CMDB.
The user setting up the ServiceNow Policy must have the credentials to log in to the ServiceNow instance.
Create a ServiceNow CMDB policy
Create a Module Credential and Endpoint for the selected technology.
- In OneFuse, select ServiceNow CMDB from Home. Or, select Modules > ServiceNow CMDB from the left navigation menu.
- Select Create, and fill out the ServiceNow CMDB Policy form under the General tab.
- Select Next, and enter a provisioning template for the ServiceNow Identification and Reconciliation Engine (IRE).
Update a ServiceNow CMDB policy
Update the ServiceNow CMDB Policy to change the name, description, Endpoint, and IRE templates.
- Access the ServiceNow CMDB policies dashboard.
- Find the Policy to update and select the edit button.
- Edit the information on the ServiceNow CMDB Policy form or IRE templates.
- Select Update.
Delete a ServiceNow CMDB policy
A ServiceNow CMDB Policy cannot be deleted if it is associated to an existing ServiceNow Deployment. Remove or unregister any deployments attached to this policy before deleting.
- Access the ServiceNow CMDB Policies dashboard.
- Find the policy and select the delete button.
- Select Delete to confirm.
ServiceNow CMDB policy form
| Field | Description |
|---|---|
| Policy Name - Required | Enter a name for the ServiceNow CMDB Policy. |
| Description - Optional | Optional description for the ServiceNow CMDB Policy. |
| ServiceNow Endpoint - Required | Select the ServiceNow Endpoint for this policy. Begin typing to filter. |
| Provision Template - Required | Enter an IRE template or pre-populate a default template to Provision. |
| Update Template - Required | Enter an IRE template or pre-populate a default template to Update. |
| Deprovision Template - Required | Enter an IRE template or pre-populate a default template to Deprovision. |
Provisioning IRE template
This template passes values to the API or upstream providers to create specified Configuration Items in ServiceNow.
- Create a new ServiceNow CMDB policy or select the edit icon on an existing policy.
- Select the second tab, Provision.
- Enter a provision template for the ServiceNow Identification and Reconciliation Engine (IRE). See example IRE templates below.
Update IRE template
This template passes values to the API or upstream providers to update specified Configuration Items in ServiceNow.
- Go to the ServiceNow Policy to edit and select the edit icon.
- Select the Update tab.
- Define an Update template for the ServiceNow Identification and Reconciliation Engine (IRE). See example IRE templates below.
- Select Update at the bottom to save the changes, or Next to continue creation in the Deprovision tab.
Deprovisioning IRE template
This template passes values to the API or upstream providers to deprovision specified Configuration Items in ServiceNow.
- Go to the ServiceNow Policy to edit and select the edit icon.
- Select the Deprovision tab.
- Define a Deprovision template for the ServiceNow Identification and Reconciliation Engine (IRE). See example IRE templates below.
- Select Create/Update to save the changes.
Example IRE templates
The following templates are a good place to start to pre-populate the OneFuse SNOW IRE templates (for provision, update, and deprovision).
In the examples below, notice discovery_source. This is a list of “system identifiers” in ServiceNow, which can populate the CMDB. We recommend adding an entry to the Discovery Source list with “onefuse”, “OneFuse”, or something distinguishable. In the example below, the value of “Manual Entry” is inserted as this is a known discovery source in ServiceNow Development instances.
The value is required and needs to be an actual ServiceNow Discovery Source. The value can be templated if passed during execution. In the examples below, it is hardcoded to “Manual Entry”.
Cloud agnostic machines
The following templates have minimal dependencies for Cloud Agnostic Machines. The templates support arrays of objects to deploy multiple items.
A CI will be created/updated in Virtual Machine Instances and in corresponding Servers: Linux or Windows.
serial_number or name is required in the templates below.
Linux VM: provision
{
"items": [
{
"className": "cmdb_ci_linux_server",
"values": {
"discovery_source": "Manual Entry",
"os": "GNU/Linux",
"name": "{{ OneFuse_VmNic0.hostname }}",
"dns_domain": "{{ OneFuse_VmNic0.dnsSuffix }}",
"host_name": "{{ OneFuse_VmNic0.hostname }}",
"fqdn": "{{ OneFuse_VmNic0.fqdn }}",
"ip_address": "{{ OneFuse_VmNic0.ipAddress }}",
"serial_number": "machine-{{ OneFuse_VmHardware.platformUuid }}",
"cpu_count": "{{ OneFuse_VmHardware.cpuCount }}",
"disk_space": "{{ OneFuse_VmHardware.totalStorageGB }}",
"ram": "{{ OneFuse_VmHardware.memoryMB }}",
"virtual": "true",
"hardware_status": "installed",
"state": "{{ OneFuse_VmHardware.powerState }}"
}
}
]
}
Linux VM: update
{
"items": [
{
"className": "cmdb_ci_linux_server",
"values": {
"discovery_source": "Manual Entry",
"os": "GNU/Linux",
"name": "{{ OneFuse_VmNic0.hostname }}",
"dns_domain": "{{ OneFuse_VmNic0.dnsSuffix }}",
"host_name": "{{ OneFuse_VmNic0.hostname }}",
"fqdn": "{{ OneFuse_VmNic0.fqdn }}",
"ip_address": "{{ OneFuse_VmNic0.ipAddress }}",
"serial_number": "vmware-{{ OneFuse_VmHardware.platformUuid }}",
"cpu_count": "{{ OneFuse_VmHardware.cpuCount }}",
"disk_space": "{{ OneFuse_VmHardware.totalStorageGB }}",
"ram": "{{ OneFuse_VmHardware.memoryMB }}",
"virtual": "true",
"hardware_status": "installed",
"state": "{{ OneFuse_VmHardware.powerState }}"
}
}
]
}
Linux VM: deprovision
{
"items": [
{
"className": "cmdb_ci_linux_server",
"values": {
"name": "{{ OneFuse_VmNic0.hostname }}",
"hardware_status": "retired",
"serial_number": "machine-{{ OneFuse_VmHardware.platformUuid }}",
"state": "Terminated"
}
}
]
}
Windows VM: provision
{
"items": [
{
"className": "cmdb_ci_win_server",
"values": {
"discovery_source": "Manual Entry",
"os": "Windows",
"name": "{{ OneFuse_VmNic0.hostname }}",
"dns_domain": "{{ OneFuse_VmNic0.dnsSuffix }}",
"host_name": "{{ OneFuse_VmNic0.hostname }}",
"fqdn": "{{ OneFuse_VmNic0.fqdn }}",
"ip_address": "{{ OneFuse_VmNic0.ipAddress }}",
"serial_number": "machine-{{ OneFuse_VmHardware.platformUuid }}",
"cpu_count": "{{ OneFuse_VmHardware.cpuCount }}",
"disk_space": "{{ OneFuse_VmHardware.totalStorageGB }}",
"ram": "{{ OneFuse_VmHardware.memoryMB }}",
"virtual": "true",
"hardware_status": "installed",
"state": "{{ OneFuse_VmHardware.powerState }}"
}
}
]
}
Windows VM: update
{
"items": [
{
"className": "cmdb_ci_win_server",
"values": {
"discovery_source": "Manual Entry",
"os": "Windows",
"name": "{{ OneFuse_VmNic0.hostname }}",
"dns_domain": "{{ OneFuse_VmNic0.dnsSuffix }}",
"host_name": "{{ OneFuse_VmNic0.hostname }}",
"fqdn": "{{ OneFuse_VmNic0.fqdn }}",
"ip_address": "{{ OneFuse_VmNic0.ipAddress }}",
"serial_number": "vmware-{{ OneFuse_VmHardware.platformUuid }}",
"cpu_count": "{{ OneFuse_VmHardware.cpuCount }}",
"disk_space": "{{ OneFuse_VmHardware.totalStorageGB }}",
"ram": "{{ OneFuse_VmHardware.memoryMB }}",
"virtual": "true",
"hardware_status": "installed",
"state": "{{ OneFuse_VmHardware.powerState }}"
}
}
]
}
Windows VM: deprovision
{
"items": [
{
"className": "cmdb_ci_win_server",
"values": {
"name": "{{ OneFuse_VmNic0.hostname }}",
"hardware_status": "retired",
"serial_number": "machine-{{ OneFuse_VmHardware.platformUuid }}",
"state": "Terminated"
}
}
]
}
vRealize Automation 7/8 VMs
The following templates have minimal dependencies for vRealize Automation 7/8 VMs, including Aria Automation Cloud. The templates support arrays of objects to deploy multiple items.
Prerequisites:
- vRealize Orchestrator Package 1.4.0 Build: 11362313 or newer for vRealize Automation 7.6 or Aria Automation 8x/Cloud
- ServiceNow VMware Discovery
- The templates below have minimal dependencies required. To resolve a
Partialstate for the CI in Class:cmdb_ci_vm_instance, perform a ServiceNow Discovery for VMware vCenter.
- The templates below have minimal dependencies required. To resolve a
A CI will be created/updated in Virtual Machine Instances and in corresponding Servers: Linux or Windows
- Class:
cmdb_ci_vm_instance:object_idis required for this class - Classes:
cmdb_ci_linux_serverandcmdb_ci_win_server:serial_numberornameis required for these classes
Linux VM: provision
{
"items": [
{
"className": "cmdb_ci_vmware_instance",
"lookup": [],
"values": {
"discovery_source": "Manual Entry",
"name": "{{ OneFuse_VmNic0.hostname }}",
"state": "{{ OneFuse_VmHardware.powerState }}",
"cpus": "{{ OneFuse_VmHardware.cpuCount }}",
"memory": "{{ OneFuse_VmHardware.memoryMB }}",
"disks_size": "{{ OneFuse_VmHardware.totalStorageGB }}",
"dns_domain": "{{ OneFuse_VmNic0.dnsSuffix }}",
"fqdn": "{{ OneFuse_VmNic0.fqdn }}",
"ip_address": "{{ OneFuse_VmNic0.ipAddress }}",
"vm_instance_uuid": "{{ instanceUUID }}",
"u_vcenter_folder": "{{ folderName }}",
"object_id": "{{ vcVmMoRefId | required("vcVmMoRefId is required") }}"
}
},
{
"className": "cmdb_ci_linux_server",
"lookup": [],
"values": {
"discovery_source": "Manual Entry",
"os": "GNU/Linux",
"name": "{{ OneFuse_VmNic0.hostname }}",
"dns_domain": "{{ OneFuse_VmNic0.dnsSuffix }}",
"host_name": "{{ OneFuse_VmNic0.hostname }}",
"fqdn": "{{ OneFuse_VmNic0.fqdn }}",
"ip_address": "{{ OneFuse_VmNic0.ipAddress }}",
"cpu_count": "{{ OneFuse_VmHardware.cpuCount }}",
"disk_space": "{{ OneFuse_VmHardware.totalStorageGB }}",
"ram": "{{ OneFuse_VmHardware.memoryMB }}",
"serial_number": "vmware-{{ instanceUUID }}",
"virtual": "true",
"hardware_status": "installed",
"state": "{{ OneFuse_VmHardware.powerState }}"
}
}
],
"relations": [
{
"type": "Runs on::Runs",
"parent": 1,
"child": 0
}
]
}
Linux VM: update
{
"items": [
{
"className": "cmdb_ci_vmware_instance",
"lookup": [],
"values": {
"discovery_source": "Manual Entry",
"name": "{{ OneFuse_VmNic0.hostname }}",
"state": "{{ OneFuse_VmHardware.powerState }}",
"cpus": "{{ OneFuse_VmHardware.cpuCount }}",
"memory": "{{ OneFuse_VmHardware.memoryMB }}",
"disks_size": "{{ OneFuse_VmHardware.totalStorageGB }}",
"dns_domain": "{{ OneFuse_VmNic0.dnsSuffix }}",
"fqdn": "{{ OneFuse_VmNic0.fqdn }}",
"ip_address": "{{ OneFuse_VmNic0.ipAddress }}",
"vm_instance_uuid": "{{ instanceUUID }}",
"u_vcenter_folder": "{{ folderName }}",
"object_id": "{{ vcVmMoRefId | required("vcVmMoRefId is required") }}"
}
},
{
"className": "cmdb_ci_linux_server",
"lookup": [],
"values": {
"discovery_source": "Manual Entry",
"os": "GNU/Linux",
"name": "{{ OneFuse_VmNic0.hostname }}",
"dns_domain": "{{ OneFuse_VmNic0.dnsSuffix }}",
"host_name": "{{ OneFuse_VmNic0.hostname }}",
"fqdn": "{{ OneFuse_VmNic0.fqdn }}",
"ip_address": "{{ OneFuse_VmNic0.ipAddress }}",
"cpu_count": "{{ OneFuse_VmHardware.cpuCount }}",
"disk_space": "{{ OneFuse_VmHardware.totalStorageGB }}",
"ram": "{{ OneFuse_VmHardware.memoryMB }}",
"serial_number": "vmware-{{ instanceUUID }}",
"virtual": "true",
"hardware_status": "installed",
"state": "{{ OneFuse_VmHardware.powerState }}"
}
}
],
"relations": [
{
"type": "Runs on::Runs",
"parent": 1,
"child": 0
}
]
}
Linux VM: deprovision
{
"items": [
{
"className": "cmdb_ci_vmware_instance",
"lookup": [],
"values": {
"discovery_source": "Manual Entry",
"object_id": "{{ vcVmMoRefId | required("vcVmMoRefId is required") }}",
"name": "{{ OneFuse_VmNic0.hostname }}",
"vm_instance_uuid": "{{ instanceUUID }}",
"state": "Terminated"
}
},
{
"className": "cmdb_ci_linux_server",
"lookup": [],
"values": {
"discovery_source": "Manual Entry",
"name": "{{ OneFuse_VmNic0.hostname }}",
"serial_number": "vmware-{{ instanceUUID }}",
"hardware_status": "retired",
"state": "Terminated"
}
}
],
"relations": [
{
"type": "Runs on::Runs",
"parent": 1,
"child": 0
}
]
}
Windows VM: provision
{
"items": [
{
"className": "cmdb_ci_vmware_instance",
"lookup": [],
"values": {
"discovery_source": "Manual Entry",
"name": "{{ OneFuse_VmNic0.hostname }}",
"state": "{{ OneFuse_VmHardware.powerState }}",
"cpus": "{{ OneFuse_VmHardware.cpuCount }}",
"memory": "{{ OneFuse_VmHardware.memoryMB }}",
"disks_size": "{{ OneFuse_VmHardware.totalStorageGB }}",
"dns_domain": "{{ OneFuse_VmNic0.dnsSuffix }}",
"fqdn": "{{ OneFuse_VmNic0.fqdn }}",
"ip_address": "{{ OneFuse_VmNic0.ipAddress }}",
"vm_instance_uuid": "{{ instanceUUID }}",
"u_vcenter_folder": "{{ folderName }}",
"object_id": "{{ vcVmMoRefId | required("vcVmMoRefId is required") }}"
}
},
{
"className": "cmdb_ci_win_server",
"lookup": [],
"values": {
"discovery_source": "Manual Entry",
"os": "Windows",
"name": "{{ OneFuse_VmNic0.hostname }}",
"dns_domain": "{{ OneFuse_VmNic0.dnsSuffix }}",
"host_name": "{{ OneFuse_VmNic0.hostname }}",
"fqdn": "{{ OneFuse_VmNic0.fqdn }}",
"ip_address": "{{ OneFuse_VmNic0.ipAddress }}",
"cpu_count": "{{ OneFuse_VmHardware.cpuCount }}",
"disk_space": "{{ OneFuse_VmHardware.totalStorageGB }}",
"ram": "{{ OneFuse_VmHardware.memoryMB }}",
"serial_number": "vmware-{{ instanceUUID }}",
"virtual": "true",
"hardware_status": "installed",
"state": "{{ OneFuse_VmHardware.powerState }}"
}
}
],
"relations": [
{
"type": "Runs on::Runs",
"parent": 1,
"child": 0
}
]
}
Windows VM: update
{
"items": [
{
"className": "cmdb_ci_vmware_instance",
"lookup": [],
"values": {
"discovery_source": "Manual Entry",
"name": "{{ OneFuse_VmNic0.hostname }}",
"state": "{{ OneFuse_VmHardware.powerState }}",
"cpus": "{{ OneFuse_VmHardware.cpuCount }}",
"memory": "{{ OneFuse_VmHardware.memoryMB }}",
"disks_size": "{{ OneFuse_VmHardware.totalStorageGB }}",
"dns_domain": "{{ OneFuse_VmNic0.dnsSuffix }}",
"fqdn": "{{ OneFuse_VmNic0.fqdn }}",
"ip_address": "{{ OneFuse_VmNic0.ipAddress }}",
"vm_instance_uuid": "{{ instanceUUID }}",
"u_vcenter_folder": "{{ folderName }}",
"object_id": "{{ vcVmMoRefId | required("vcVmMoRefId is required") }}"
}
},
{
"className": "cmdb_ci_linux_server",
"lookup": [],
"values": {
"discovery_source": "Manual Entry",
"os": "Windows",
"name": "{{ OneFuse_VmNic0.hostname }}",
"dns_domain": "{{ OneFuse_VmNic0.dnsSuffix }}",
"host_name": "{{ OneFuse_VmNic0.hostname }}",
"fqdn": "{{ OneFuse_VmNic0.fqdn }}",
"ip_address": "{{ OneFuse_VmNic0.ipAddress }}",
"cpu_count": "{{ OneFuse_VmHardware.cpuCount }}",
"disk_space": "{{ OneFuse_VmHardware.totalStorageGB }}",
"ram": "{{ OneFuse_VmHardware.memoryMB }}",
"serial_number": "vmware-{{ instanceUUID }}",
"virtual": "true",
"hardware_status": "installed",
"state": "{{ OneFuse_VmHardware.powerState }}"
}
}
],
"relations": [
{
"type": "Runs on::Runs",
"parent": 1,
"child": 0
}
]
}
Windows VM: deprovision
{
"items": [
{
"className": "cmdb_ci_vmware_instance",
"lookup": [],
"values": {
"discovery_source": "Manual Entry",
"object_id": "{{ vcVmMoRefId | required("vcVmMoRefId is required") }}",
"name": "{{ OneFuse_VmNic0.hostname }}",
"vm_instance_uuid": "{{ instanceUUID }}",
"state": "Terminated"
}
},
{
"className": "cmdb_ci_win_server",
"lookup": [],
"values": {
"discovery_source": "Manual Entry",
"name": "{{ OneFuse_VmNic0.hostname }}",
"serial_number": "vmware-{{ instanceUUID }}",
"hardware_status": "retired",
"state": "Terminated"
}
}
],
"relations": [
{
"type": "Runs on::Runs",
"parent": 1,
"child": 0
}
]
}
Update an existing CI using sysId
To update an existing ServiceNow CI during deployment using the sysId, use the OneFuse property OneFuse_ServiceNowCmdbSysId in the upstream provider syntax as follows:
| Parameter Name Format | Property Value Format |
|---|---|
| OneFuse_ServiceNowCmdbSysId | “<The existing sysId>” |
Provision with ServiceNow CMDB
Use the defined IRE Templates in the ServiceNow CMDB OneFuse Policy to provision, update, and deprovision Configuration Items in your ServiceNow CMDB instance.
- Create a ServiceNow CMDB Policy.
- Define ServiceNow IRE templates. See the Example IRE templates for guidance.
- Execute your ServiceNow Policy using the OneFuse API or an Upstream Provider.
Now that you have executed a ServiceNow Policy using the API or an Upstream Provider, track your deployments in OneFuse.