AIOps & Automation Test Drive: Additional Playbook Ideas - Increase Memory of a VM Automatically

  • 4 June 2021
  • 0 replies
AIOps & Automation Test Drive: Additional Playbook Ideas - Increase Memory of a VM Automatically
Userlevel 7
Badge +35

The Nutanix® Test Drive for AIOps & Automation simulator  allows you to explore the Nutanix X-Play tool and configure playbooks to perform automated tasks based on alerts and events. This blog series will walk you through more playbook ideas and actions that can be performed on your Nutanix Test Drive or on your own Nutanix platform.

If you haven’t signed up for Test Drive yet, navigate to the AIOps & Automation tab on the Nutanix Test Drive landing page. Test Drive gives you a hands-on experience with a real Nutanix cluster running in your web browser with no software or hardware required. Once you’re signed up, you can follow along to create this playbook in your Test Drive environment.

Let’s get started!

What is X-Play?

X-Play is a simple low-code/no-code automation tool built into the Nutanix Prism management controller  that helps you automate routine operations and tasks, and provides the ability to auto-remediate issues that may occur.

Playbooks allow you to define a set of actions or a series of actions based on a trigger, such as an event, alert, or an incoming webhook. The actions you can configure allow you to perform actions on your infrastructure, such as adding resources or running scripts. You can also integrate with APIs and 3rd party tools. In this blog post we’ll walk through creating a playbook to increase the memory of a VM, using pre-built actions.

In the AIOps & Automation Test Drive, you will learn more about X-Play and these playbooks via a guided tour that will walk you through setting up a playbook from start to finish. This blog is meant to supplement the Test Drive by providing more playbook ideas. To find out more about the AIOps & Automation Test Drive, check out this recent blog post!


Before starting, you will need two things:

The URL of your environment

  • Sign up for a Test Drive here to get access to your own Nutanix instance to try out in your browser.
  • Once you have logged into your instance, make a note of the URL of the Test Drive instance. It will begin with td2 and look something like
  • Note: Your exact URL will be different as it is specific to your environment.

A VM created on the cluster

  • You will also need at least 1 VM created to generate alerts against. The steps are outlined below, or you can also be guided through the creation of a VM from the Test Drive instance by selecting Quick Links > Create VMs from your AIOps Test Drive instance. Optionally, you can also use a VM that already exists in the environment, for example one of the UbuntuDesktop VMs.

Create Sample VM

First, let’s create a sample VM that will be used as the target for these playbooks.

From Prism Central, navigate to the VMs page.

Click on the blue Create VM button.

Select the AOSonGCP cluster and click OK.

Give your VM a name, for example SampleVM. Assign it 1 vCPU and 1GB of RAM. No disks or networking are required in this instance.

Click Save.

Playbook - Increase VM Memory

In this playbook, we will use X-Play to automatically add memory to a VM when a memory constraint is detected. We’ll also do the following as part of the playbook:

  • Take a snapshot of the VM
  • Have an email sent to inform that the playbook was triggered
  • Acknowledge the Memory Constraint alert

Use the search bar to navigate to the Playbooks page. You can also use the menu to navigate to Operations > Playbooks.

Click Get Started if prompted.

Click Create Playbook at the top of the table view.

Select Alert as a trigger.

Search and select VM {vm_name} Memory Constrained as the alert policy, since this is the issue we are looking to take automated steps to remediate.

Select the Specify VMs radio button and choose the VM you created earlier. This will make it so only alerts raised on your VM will trigger this Playbook.

We will first snapshot the VM. Click Add Action on the left side and select the VM Snapshot action.

The Target VM is auto filled with the source entity from the Alert trigger. You can optionally specify a Time To Live value, to specify how long the snapshot should be kept in days. Click Add Action on the left when you are ready.

Next, we would like to remediate the constrained memory by adding more memory to the VM. Select the VM Add Memory action as our second action.

Set the empty fields according to the screen below. This will add 1GB of memory to the VM every time the playbook is triggered, up to a maximum of 20GB.

Click Add Action a third time to add the Email action.

Fill in the fields for the email action. For example:

Recipient: Fill in your email address.

Subject: Playbook {{playbook.playbook_name}} addressed alert {{trigger[0]}}

Message: Prism Pro X-FIT detected  {{trigger[0]}} in {{trigger[0]}}.  Prism Pro X-Play has run the playbook of "{{playbook.playbook_name}}". As a result, Prism Pro increased 1GB memory in {{trigger[0]}}.

You are welcome to compose your own subject message. The above is just an example. You can use the “parameters” to enrich the message.

Finally, we’ll add a fourth action, to acknowledge the alert. Click on Add Action and select the Acknowledge Alert action.

Click the Save & Close button and save it with a name such as “Auto Increase Constrained VM Memory”. Be sure to use the ‘Enabled’ toggle.

Click Save.

You should see a new playbook in the “Playbooks” list page.

Search for your VM and record the current memory capacity. You can scroll down in the properties widget to see the configured memory.

Now we will simulate an alert for ‘VM Memory Constrained’ which will trigger the Playbook we just created. Take a note of the URL of your Test Drive instance as described in the Setup section, and open a new browser tab to https://<your_test_drive_url>/alerts to open the Alert Generation UI.

Select the VM Memory Constrained radio button and select your VM from the drop-down list, and click Simulate Alert.

Go back to the Prism tab and check your VMs page again, you should now see the memory capacity is increased by 1GB. If the memory does not show it is updated you can refresh your browser page to speed up the process.

You should also receive an email. Check your email to see that its subject and email body have filled the real value for the parameters you set up.

Go back to the Playbook page (Operations > Playbooks), and click on the playbook you just created.

Click the Plays tab, you should see that a play has just completed.

Click on the name of the “Play” to examine the details. You can expand the details on each of the actions to get more information.

As you can see, it’s simple to set up a playbook to automate tasks in your environment based on an alert or trigger. This is a useful playbook to temporarily alleviate an application’s memory constraints until an administrator has time to investigate, instead of the administrator having to address the issue immediately.
To learn more about Nutanix’s AIOps & Automation solutions, please check out the following resources:

This post was authored by Laura Jordana, Principal Technical Marketing Engineer at Nutanix

© 2021 Nutanix, Inc.  All rights reserved. Nutanix, the Nutanix logo and all Nutanix product, feature and service names mentioned herein are registered trademarks or trademarks of Nutanix, Inc. in the United States and other countries. Other brand names mentioned herein are for identification purposes only and may be the trademarks of their respective holder(s). This post may contain links to external websites that are not part of Nutanix does not control these sites and disclaims all responsibility for the content or accuracy of any external site. Our decision to link to an external site should not be considered an endorsement of any content on such a site. This post may contain express and implied forward-looking statements, which are not historical facts and are instead based on our current expectations, estimates and beliefs. The accuracy of such statements involves risks and uncertainties and depends upon future events, including those that may be beyond our control, and actual results may differ materially and adversely from those anticipated or implied by such statements. Any forward-looking statements included herein speak only as of the date hereof and, except as required by law, we assume no obligation to update or otherwise revise any of such forward-looking statements to reflect subsequent events or circumstances.

This topic has been closed for comments