Introduction
Nutanix Intelligent Operations allows the generation of detailed reports. These reports can be configured to include a number of fields or data points, resulting in timely information being sent to the people that need it. When combined with NCM Self-Service Playbooks and NCM Self-Service Runbooks, a powerful, automated reporting system can be created, reducing the need for manual interaction or report creation. In today’s quick demo we’ll use NCM Self-Service Playbooks to react to a specific event and, when that event occurs, execute an NCM Self-Service Runbook that will generate an Intelligent Operations report. To demonstrate how an automated environment could integrate this approach into custom applications, the runbook will generate the report using the Nutanix v4 APIs.
Let’s get started. Note: All images throughout this article can be clicked to view full size.
Playbooks vs Runbooks
Before looking at the demo, let’s take a quick look at the difference between an NCM Intelligent Operations Playbook and an NCM Self-Service Runbook.
Runbooks
An NCM Self-Service Runbook is a collection of tasks and procedures that be run across various endpoints. For example, this demo’s runbook runs on two different endpoints:
A Linux virtual machine that has been configured specifically for the purposes of running Python scripts
Prism Central, as the endpoint for Nutanix v4 API requests
Runbooks are intended to be run either via the Prism Central UI or through some other intentional mechanism. Runbooks cannot be run on a scheduled basis unless combined with an NCM Intelligent Operations playbook. Runbook task types at the time of writing are available on the Runbooks in Self-Service portal page.
Playbooks
NCM Intelligent Operations Playbooks, whilst they can be run manually, enable powerful, event-triggered automations. Triggers can include events such as a VM being created, a cluster event such a host entering maintenance mode or an alert.
The playbook used in this demo reacts to the “Created VM” event trigger and will execute every time a new VM is created.
Playbook actions at the time of writing are available on the Task Automation – Playbooks portal page.
Scenario
Our demo environment has an existing Intelligent Operations report configuration named cr-report-config . The specific report configuration won’t impact the outcome of this demo, although you can download the demo’s report configuration from the NutanixDev GitHub .
Required Outcomes
At the end of this demo, we will have an NCM Self-Service Playbook that responds to the creation of a VM. The playbook will execute an NCM Self-Service runbook which, in turn, generates an Intelligent Operations report using the Nutanix v4 opsmgmt APIs.
Prerequisites
To follow along with this demo in your own environment, the following assumptions will be made.
You have already created a Nutanix Prism Central Intelligent Operations report configuration
However, because this demo is intended to demonstrate the execution of a report configuration using NCM Self-Service, Intelligent Ops and REST APIs, the report configuration shown is for demo purposes only.
The report configuration used in this demo can be downloaded from the NutanixDev GitHub .
You have deployed a Linux-based VM that has been configured as an NCM Self-Service Python endpoint. For detailed instructions on creating a Python endpoint, see the NCM Self-Service Administration and Operations Guide .
The Python endpoint will need the requests and urllib3 modules available in the virtual environment.
An example endpoint is shown in the following screenshot:
</svg>
</button>Example NCM Self-Service endpoint for running Python scripts </figure>
</div>
You have created an NCM Self-Service HTTP endpoint for your Prism Central instance
An example endpoint is shown in the following screenshot:
</svg>
</button>Example NCM Self-Service endpoint for Prism Central </figure>
</div>
You have downloaded the cr-generate-report runbook used throughout this demo and imported it into your Prism Central instance.
Optionally, you can also download the cr-demo-playbook playbook used in the final section of this demo.
Demo Environment
The demo environment used throughout this article is as follows:
Prism Central 7.5
AOS 7.5
NCM Self-Service 4.3.0
v4 API opsmgmt namespace v4.0
API Requests
In order for this demo to succeed, we’ll need to send various requests using the Nutanix v4 APIs. Specifically, the opsmgmt (Ops Management) v4.0 namespace will handle all the demo requests, including requesting existing configuration details and generating the final report.
Before getting started, let’s take a look at how a Prism Central Intelligent Operations report can be generated using a manual API request. We’ll use Postman here, but the request itself will be identical regardless of the API prototyping tool used.
Obtain Report Configuration extId
Since we already know the report configuration is named cr-report-config , we can use Odata filters with our v4 API request. The filter will request only those report configurations matching the required name.
Request URL: https://{ {pc_ip} }:9440/api/opsmgmt/v4.0/config/report-configs?$filter=name eq ‘cr-report-config’
Method: GET
Headers: Content-Type: application/json
Payload: None required
Looking at the response, we can see the report is available in the report configuration list. For the following steps, the report’s extId must be noted down. In an automated environment, this extId would be saved as a variable. This example shows the report configuration is 127b2178-2af5-4c27-51ec-6ebde983eebe .
Note: The full response has been trimmed for readability.
{
...
"data": [
{
...
"extId": "127b2178-2af5-4c27-51ec-6ebde983eebe",
...
"name": "cr-report-config",
"sections": [
...
]
}
],
"metadata": {
...
"totalAvailableResults": 1
}
}
Generate Report
With the report configuration’s extId available and noted down, the generate report request will be built as follows.
Request URL: https://{ {pc_ip} }:9440/api/opsmgmt/v4.0/config/reports
Method: POST
Headers:
Content-Type: application/json
Ntnx-Request-Id: <UUID>
Payload:
{
"name": "ncm_selfservice_generated_report",
"configExtId": "127b2178-2af5-4c27-51ec-6ebde983eebe",
"isPersistent": false,
"startTime": "2025-10-01T00:00:00Z",
"endTime": "2025-10-02T00:00:00Z",
"recipientFormats": [
"PDF"
],
"recipients": [
{
"emailAddress": "no****** @** me.com ",
"recipientName": "Demo Recipient"
}
]
}
When this request is sent, the report configuration cr-report-config will be used as the basis for a report sent to no****** @** me.com . The recipient details need to be changed to match appropriate settings for your environment.
NCM Self-Service Runbook
Since the requirement for this demo is to manage this entire process with a NCM Self-Service, let’s look at the runbook that will handle the report generation.
To simplify this demo, the runbook has been made available for download. If you have not already done so, download the runbook now and import it into your Prism Central instance.
Runbook Flow
The final runbook will look like this:
</svg>
</button>Final runbook flow showing all steps </figure>
</div>
Here are the steps the runbook will follows:
Request a matching report configuration. If a matching config is not found, enter the False branch and run a simple Python script indicating the negative result. If a matching runbook is found, enter the True branch.
Send an API request that returns the report config’s extId . This could potentially be collapsed into the main decision branch but is split here for demo purposes. The report config’s extId is returned from the response key’s $.data[0].extId field and saved in a variable named REPORT_CONFIG_EXTID . This step also returns HTTP 200 (success) or 400/409 for failure/request not found.
Generates a random UUID using the Python standard library’s uuid module and saves it in a variable named REQUEST_ID .
Converts the report start and end dates into usable and formatted ISO-8601 that will work with the Nutanix v4 APIs. These are returned as variables named REPORT_START_ISO8601 and REPORT_END_ISO8601 , respectively.
Lastly, sends a Nutanix v4 API request using the opsmgmt namespace. This namespace provides report management functionality and is the same namespace used in previous steps. The variables collected in previous steps are used as the various fields within the request’s POST payload.
Runbook Credentials
The runbook requires two distinct credentials:
Prism Central login with permissions to work with Intelligent Operations reports
Python endpoint credentials with permission to execute Python scripts within your endpoint
</svg>
</button>Runbook credentials required for successful execution. Note: Credentials can be basic authentication (username and password) or SSH key pair. This demo uses an SSH key pair credential. </figure>
</div>
Runbook Input Variables
To make this runbook as configurable as possible, a number of input variables have been specified. This allows the user to supply input variables at runtime, if required:
Report name: REPORT_NAME
Recipient email address: RECIPIENT_EMAIL
Recipient name: RECIPIENT_NAME
Report configuration name: REPORT_CONFIG_NAME
Report start and end times: REPORT_START and REPORT_END
Prism Central IP address or FQDN: PC_IP
After uploading the sample runbook, make sure you edit these variables to match values appropriate for your environment.
Important Note
The runbook’s Python scripts use NCM Self-Service placeholders that are replaced by input variables at runtime. For example, the downloadable sample runbook uses a Prism Central credential named “Prism Central Admin”. Within the decision step, the script contains this step:
username = "@@{Prism Central Admin.username}@@"
This Python code creates a variable named username and sets that variable to the “Prism Central Admin” credential’s username field.
If you name your credentials and input variables something other than those used in the downloadable runbook, make sure you edit the placeholders in each runbook step.
Runbook Output Variables
Because this script contains return variables, we have also specified a number of Runbook Output Variables:
Report end, formatted as ISO-8601: REPORT_END_ISO8601
Report start, formatted as ISO-8601: REPORT_START_ISO8601
Request ID, used for request idempotency: REQUEST_ID
Report configuration extId : REPORT_CONFIG_EXTID
</svg>
</button>Runbook output variables </figure>
</div>
Intelligent Operations Playbook
So far, we’ve got an NCM Self-Service runbook that takes pre-entered input from the user, checks for the existence of a specific report configuration and, if that configuration exists, generates an Intelligent Operations report based on that configuration. This runbook can be executed at any time.
However, this demo requires the runbook to be executed when an event is triggered: VM creation. In a production environment the report would likely generate different specific details, although the downloadable examples will be sufficient for this demo.
Let’s take a look at our playbook.
Playbook Creation
Our demo has been configured as an Event triggered playbook during the playbook creation step. This enables the playbook to run when a specific event is triggered; in this case, whenever a VM is created.
</svg>
</button>Selecting “Event” trigger during playbook creation </figure>
</div>
The type of event can be specified after the event trigger is selected. Nutanix Intelligent Operations provides over 40 different triggers, from cluster and node activity to failover and maintenance events. Our demo playbook will only be triggered when a VM is created. As you can see in the following screenshot, the VM creation trigger has been left intentionally broad but could also be configured to only trigger when VMs are created within a specific category.
</svg>
</button>Selecting “Created VM” as the playbook event trigger </figure>
</div>
Playbook Actions
With the event trigger specified, it is now time to select what will happen when the event is triggered. Nutanix Intelligent Operations provides a large selection of actions, from alert and warning acknowledgment through to virtual hardware actions such as eject CD-ROM or power off VM. In our demo, we want to execute an existing NCM Self-Service Runbook. After clicking the Add Action option, we can select Execute a Self Service Runbook from the list of available actions:
</svg>
</button>Selecting “Execute a Self Service Runbook” as the playbook action </figure>
</div>
Our demo uses a non-marketplace runbook, so after selecting our project, we must change the Runbook Type from Marketplace to Non-Marketplace before selecting the existing runbook.
</svg>
</button>Project and runbook selection for the playbook action </figure>
</div>
Although we won’t use the option in this demo, the runbook can be set to Stop if action fails.
Scrolling down within the action settings, the previously specified runbook Input Variables can be set. Under normal circumstances these would be set once here and used during subsequent runbook executions. If you are following this demo in your own environment, make sure you set this appropriately before continuing.
</svg>
</button>Option to specify input variables for runbook executions </figure>
</div>
When all settings have been specified, the playbook can be Saved and Closed .
Note: Intelligent Operations playbooks are DISABLED by default, unless they are explicitly enabled when being saved.
<button
class="lightbox-trigger"
type="button"
aria-haspopup="dialog"
aria-label="Enlarge"0
data-wp-init="callbacks.initTriggerButton"
data-wp-on--click="actions.showLightbox"
data-wp-style--right="state.imageButtonRight"
data-wp-style--top="state.imageButtonTop"
>
</button>Clicking “Save & Close” and setting the playbook status to “Enabled”
Testing the Automation
Before continuing with our first test, let’s take a quick look at what we’ve accomplished so far.
Uploaded a sample runbook that looks for a specific Intelligent Operations report configuration, gets the report configuration’s unique extId , generates a UUID for use in the upcoming POST request and generates a report using the configuration, ONLY if the configuration was found.
Created a Nutanix Intelligent Operations playbook that watches for VMs to be created and, when the VM Created event is triggered, executes our NCM Self-Service runbook using previously-populated input variables.
Now, if we create a VM using any supported method – Prism UI, API, SDK etc – the cr-demo-playbook will trigger the Created VM event and execute the NCM Self-Service cr-generate-report runbook.
The following screenshot confirms that when a VM called v was created, NCM Intelligent Operations triggered the event and executed the runbook.
<button
class="lightbox-trigger"
type="button"
aria-haspopup="dialog"
aria-label="Enlarge"1
data-wp-init="callbacks.initTriggerButton"
data-wp-on--click="actions.showLightbox"
data-wp-style--right="state.imageButtonRight"
data-wp-style--top="state.imageButtonTop"
>
</button>Confirmation of successful runbook execution from playbook event trigger
Conclusion
In this demo, we have seen how various Nutanix products and features can be cleanly integrated, resulting in a highly configurable, automated reporting setup:
A Nutanix Intelligent Operations report configuration containing VM performance data
An NCM Self-Service runbook to generate a report based on the report configuration
A Nutanix Intelligent Operations playbook to watch for VM creation events which then executes the playbook
Related Resources