Skip to main content
Question

Dynamic GPU(pass , vgpu) Selection in Calm Runbook Input Forms

  • November 28, 2025
  • 2 replies
  • 21 views

Hello Nutanix Community,

I am developing a self-service runbook (python scripts) in Prism Central to implement a time-based GPU billing model, allowing administrators to attach a GPU to a VM for a specific duration.

The Core Question

Is there a supported or known method (API-driven or otherwise) to dynamically populate a Runbook Input Variable (specifically a List of Values/Dropdown) at runtime, based on a query to the Prism API?

For example:

  • Could a pre-run script execute a gpus/list query to determine available vGPU profiles and format that output to populate the options list for the gpu_profile_selection variable before the form is presented to the user?

2 replies

Avico
  • Trailblazer
  • December 1, 2025

Hello ​@MedAmine 

Yes you can query any DB/API and populate the results into a drop-down control in your runbook.

The way to do it is to create an Input variable with eScript or PowerShell as a type. See the image below.


On the code (black) section, you write your query and print out the result as a series of strings separated by commas. For example (eScript):

print("{0},{1},{2},{3},{4}".format("RHEL 8.8","RHEL 9.2","RHEL 9.5","Ubuntu 22.04","Ubuntu 24.04"))

The result will be a drop-down list of your query results.

🚩eScript is a constrained version of Python. Most of the common Python modules are not usable.
See Nutanix’ documentation for the way to program in eScript.

🚩If you want more than one selection to be accepted, make sure you tick the “Multiple Input” checkbox.


Good luck!
 


  • Author
  • Voyager
  • December 2, 2025

@Avico i see thanks for your help