ServiceNow CMDB policy

Create, update, and delete ServiceNow CMDB policies in OneFuse

Setup overview

To use the ServiceNow CMDB module:

  1. Create a ServiceNow CMDB Module Credential.
  2. Create a ServiceNow Endpoint. If applicable, configure ServiceNow proxy support.
  3. Create a ServiceNow CMDB Policy and define ServiceNow IRE Templates.
  4. 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

  1. In OneFuse, select ServiceNow CMDB from Home. Or, select Modules > ServiceNow CMDB from the left navigation menu.
  2. Select Create, and fill out the ServiceNow CMDB Policy form under the General tab.
  3. 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.

  1. Access the ServiceNow CMDB policies dashboard.
  2. Find the Policy to update and select the edit button.
  3. Edit the information on the ServiceNow CMDB Policy form or IRE templates.
  4. 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.

  1. Access the ServiceNow CMDB Policies dashboard.
  2. Find the policy and select the delete button.
  3. 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.

  1. Create a new ServiceNow CMDB policy or select the edit icon on an existing policy.
  2. Select the second tab, Provision.
  3. 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.

  1. Go to the ServiceNow Policy to edit and select the edit icon.
  2. Select the Update tab.
  3. Define an Update template for the ServiceNow Identification and Reconciliation Engine (IRE). See example IRE templates below.
  4. 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.

  1. Go to the ServiceNow Policy to edit and select the edit icon.
  2. Select the Deprovision tab.
  3. Define a Deprovision template for the ServiceNow Identification and Reconciliation Engine (IRE). See example IRE templates below.
  4. 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.

Cloud agnostic machines

The following templates have minimal dependencies for Cloud Agnostic Machines. The templates support arrays of objects to deploy multiple items.

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:

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.

  1. Create a ServiceNow CMDB Policy.
  2. Define ServiceNow IRE templates. See the Example IRE templates for guidance.
  3. 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.