Nutanix AutoScale

This guide will walk you through configuring autoscaling for Kasm Workspaces on Nutanix. Autoscaling in Kasm Workspaces automatically provisions and destroys agents based on user demand, ensuring optimized resource utilization and cost efficiency.

Overview

Prerequisites

  • Access to Nutanix:

    • Ensure you have admin access to your Nutanix environment

    • Ensure you have a directory service or identity provider configured

    • Ensure you have two users, one to administer the project and create VMs, one to access the Nutanix APIs.

  • Kasm Workspaces Installed: A basic setup of Kasm Workspaces must already exist

  • Understand Key Concepts:

    • Zones: Logical groupings of Kasm services for geographical or organizational segmentation

    • Pools: Logical groupings of Kasm Docker Agents and Server Pools for load balancing

  • Plan Your Configuration:

    • Understand your deployment zone requirements

    • Have access to your Nutanix server details; target clusters, projects, storage, networks, etc.

    • Create VMs in the project you have designated for your autoscale VMs

Setup your Nutanix environment

Create a new Nutanix Role

  1. Log into your Nutanix Prism Central UI as an administrator.

  2. Navigate to the Admin Center dashboard.

  3. Select IAM -> Roles -> Create Role -> New role.

  4. Enter a value for the Role Name field (e.g. kasm-role).

  5. Add all the operations from the list of required permissions corresponding to the Nutanix API version you plan to use, ensure that any related operations are also added.

  6. Click Save.

../../../_images/nutanix_create_role.png

Create Role

Create a new Nutanix Project

  1. Log into your Nutanix Prism Central UI as an administrator.

  2. Navigate to the Admin Center dashboard.

  3. Select Projects -> Create Project.

  4. Enter a value for the Project Name field (e.g. kasm-autoscale).

../../../_images/nutanix_create_project.png

Create Project

  1. Select Add Users -> Add/Edit Users & Groups.

  2. Click Add User.

  3. Enter the name of a valid user in the Name field. This user will administer the project, create Virtual Machine templates, upload images, etc.

  4. From the Role drop-down menu, select the default Project Admin role.

  5. Click Add User.

  6. Enter the name of a valid user in the Name field. This user will be configured in the Kasm Provider to access the Nutanix APIs.

  7. From the Role drop-down menu, select the new role created above (e.g. kasm-role).

  8. Ensure Allow Collaboration is enabled.

  9. Click Save Users and Project.

../../../_images/nutanix_project_add_users.png

Add Users

  1. Select Add Infrastructure -> Add Infrastructure.

  2. From the drop-down menu, select the Infrastructure Endpoint that will be used to provision Kasm autoscale resources.

  3. Click Configure Resources.

  4. From the drop-down menu, select the Cluster.

  5. Click Select VLANs.

  6. Click the checkbox next to the VLAN that will be used to provide network access for Kasm autoscale resources.

../../../_images/nutanix_project_configure_resources.png

Configure Resources

  1. Click Confirm and Select Default.

  2. Click Confirm.

  3. Click Save.

Configure VM Provider Details on Kasm

Nutanix Settings

Setting

Description

Name

An identifying name for this provider configuration e.g. Nutanix Docker Agent Autoscale Provider

Max Instances

The maximum number of autoscale instances to be provisioned, regardless of other settings

Host

The IP or FQDN of the Nutanix Prism Central server (e.g. 192.168.100.40 or nutanix.example.com)

Port

The listening port to the Nutanix Prism Central server. This is usually 9440

Username

The name of the user that KASM will use to access the Nutanix Prism Central server

Password

The Password of the user that KASM will use to authenticate against the Nutanix Prism Central server

Verify SSL

Whether to validate SSL certificates. Set to False to enable self-signed certificates. Defaults to True

API Version

The API version used to communicate with Prism Central. v3 is recommended, v4 compatibility is currently in Preview

VM Candidate Name

The name of the VM used to clone new autoscaled VMs

VM Cores

The number of CPU cores to provision on the new autoscaled VMs

VM Memory

The amount of memory, in Gibibyte (GiB), to provision on the new autoscaled VMs

Startup Script

When VMs are provisioned, this script is executed and is responsible for installing and configuring the Kasm Agent for Docker Agent roles, or the Kasm Desktop Service for Windows VMs if desired. Bash scripts and cloud-config yaml formats are supported on a Linux host and Powershell scripts on Windows hosts Example scripts are available on our GitHub repository

  • Submit the Provider Config.

Note

Support for Nutanix API Version 4 is in Preview.

Test your Nutanix Autoscaling setup

If you have configured non-zero Standby/Minimum Available Session values agents should start provisioning immediately. Otherwise, try launching multiple workspaces to increase resource utilization, prompting Kasm to autoscale new agents.

  • Provision a Workspace

    • Go to Workspaces > Registry

    • Make multiple workspaces available

  • Go to the Workspaces dashboard and launch sufficient workspace sessions to exceed your resource standby thresholds

  • Monitor the provisioning of new agents by going to “Infrastructure” -> “Agents”

  • Verify new VM instances in Nutanix

  • Check Downscaling

    • Terminate sessions to reduce resource usage

    • Confirm that Kasm removes agents after the back-off period

How to create an Ubuntu 24LTS VM

Create Nutanix Ubuntu installation image

  1. Log into your Nutanix Prism Central UI as an administrator.

  2. Navigate to the Infrastructure Center dashboard.

  3. Select Images -> Add Image.

  4. From the Image Source options list, select the URL option.

  5. Enter the URL for a valid Ubuntu24 LTS ISO in the Image URL field (e.g. ref).

  6. Click Add URL.

../../../_images/nutanix_ubuntu_create_image.png

Create image

  1. Enter the name for the ISO in the Name field (e.g. kasm-ubuntu-iso).

  2. Ensure that ISO is selected from the Type drop-down menu.

  3. Click Next.

../../../_images/nutanix_ubuntu_select_image.png

Select Image

  1. Click Save.

../../../_images/nutanix_select_location.png

Select Location

  1. Wait for the upload to complete.

Create Nutanix Ubuntu VM

  1. Log into your Nutanix Prism Central UI as an administrator.

  2. Navigate to the Infrastructure Center dashboard.

  3. Select VMs -> Create VM.

  4. Enter a value for the Name field (e.g. kasm-ubuntu-template).

  5. From the Project drop-down menu, select the Nutanix Project that was just created (e.g. kasm-autoscale).

  6. From the Cluster drop-down menu, select the Nutanix Cluster that will be used to provision Kasm autoscale resources.

  7. In the Cores Per CPU section, enter the number of cores to provision for this VM (e.g. 4).

  8. In the Memory section, enter the amount of memory to provision for this VM (e.g. 4).

../../../_images/nutanix_ubuntu_vm_configure.png

VM Configure

  1. Click Next.

  2. Click Attach Disk.

  3. Ensure that Disk is selected from the Type drop-down menu.

  4. Ensure that Allocate from Storage Container is selected from the Operation drop-down menu.

  5. From the Storage Container drop-down menu, select the Nutanix Storage Container to use when provisioning this VM.

  6. In the Capacity section, enter the amount of storage to provision for this VM (e.g. 150).

  7. Ensure that SCSI is selected from the Bus Type drop-down menu.

  8. Click Save.

  9. Click Attach Disk.

  10. Ensure that CD-ROM is selected from the Type drop-down menu.

  11. Ensure that Clone from Image is selected from the Operation drop-down menu.

  12. From the Image drop-down, select the Ubuntu installation image you uploaded previously.

  13. Ensure that SATA is selected from the Bus Type drop-down menu.

  14. Click Save.

  15. Click Attach to Subnet.

  16. From the subnet drop-down, select the Nutanix Subnet to use when provisioning this VM.

  17. Ensure that Connected is selected from the Network Connection State drop-down menu.

  18. Click Save.

../../../_images/nutanix_ubuntu_vm_resources.png

VM Resources

  1. Click Next.

  2. Click Next.

  3. Click Create VM.

  4. From the list of VMs, right-click the newly created VM, select Power Operations and then select Power On.

  5. Install the OS.

  6. From the list of VMs, right-click the newly created VM, select Update.

  7. Click Next.

  8. In the list of Disks, click the delete icon next to the CD-ROM containing the installation ISO image.

  9. Click Save.

  10. SSH into the newly created VM with the credentials created during OS installation.

  11. Run the following terminal commands:

sudo truncate -s 0 /etc/machine-id
sudo truncate -s 0 /var/lib/dbus/machine-id

How to create a Windows 2025 Server VM

Create Nutanix Windows installation image

  1. Log into your Nutanix Prism Central UI as an administrator.

  2. Navigate to the Infrastructure Center dashboard.

  3. Select Images -> Add Image.

  4. Click Add File.

  5. Select a valid Windows 2025 Server ISO from the File Upload window.

  6. Click Open.

../../../_images/nutanix_windows_create_image.png

Create image

  1. Enter the name for the ISO in the Name field (e.g. kasm-windows-iso).

  2. Ensure that ISO is selected from the Type drop-down menu.

  3. Click Next.

../../../_images/nutanix_windows_select_image.png

Select Image

  1. Click Save.

../../../_images/nutanix_select_location.png

Select Location

  1. Wait for the upload to complete.

Create Nutanix VirtIO driver image

  1. Log into your Nutanix Prism Central UI as an administrator.

  2. Navigate to the Infrastructure Center dashboard.

  3. Select Images -> Add Image.

  4. From the Image Source options list, select the URL option.

  5. Enter the URL for a valid VirtIO Driver ISO in the Image URL field (e.g. ref).

  6. Click Add URL.

  7. Ensure that ISO is selected from the Type drop-down menu.

  8. Click Next.

  9. Click Save.

  10. Wait for the upload to complete.

Create Nutanix Windows VM

  1. Log into your Nutanix Prism Central UI as an administrator.

  2. Navigate to the Infrastructure Center dashboard.

  3. Select VMs -> Create VM.

  4. Enter a value for the Name field (e.g. kasm-windows-template).

  5. From the Project drop-down menu, select the Nutanix Project that was just created (e.g. kasm-autoscale).

  6. From the Cluster drop-down menu, select the Nutanix Cluster that will be used to provision Kasm autoscale resources.

  7. In the Cores Per CPU section, enter the number of cores to provision for this VM (e.g. 4).

  8. In the Memory section, enter the amount of memory to provision for this VM (e.g. 4).

../../../_images/nutanix_windows_vm_configure.png

VM Configure

  1. Click Next.

  2. Click Attach Disk.

  3. Ensure that Disk is selected from the Type drop-down menu.

  4. Ensure that Allocate from Storage Container is selected from the Operation drop-down menu.

  5. From the Storage Container drop-down menu, select the Nutanix Storage Container to use when provisioning this VM.

  6. In the Capacity section, enter the amount of storage to provision for this VM (e.g. 150).

  7. Ensure that SCSI is selected from the Bus Type drop-down menu.

  8. Click Save.

  9. Click Attach Disk.

  10. Ensure that CD-ROM is selected from the Type drop-down menu.

  11. Ensure that Clone from Image is selected from the Operation drop-down menu.

  12. From the Image drop-down, select the Windows installation image you uploaded previously.

  13. Ensure that SATA is selected from the Bus Type drop-down menu.

  14. Click Save.

  15. Click Attach Disk.

  16. Ensure that CD-ROM is selected from the Type drop-down menu.

  17. Ensure that Clone from Image is selected from the Operation drop-down menu.

  18. From the Image drop-down, select the VirtIO driver image you uploaded previously.

  19. Ensure that SATA is selected from the Bus Type drop-down menu.

  20. Click Save.

  21. Click Attach to Subnet.

  22. From the subnet drop-down, select the Nutanix Subnet to use when provisioning this VM.

  23. Ensure that Connected is selected from the Network Connection State drop-down menu.

  24. Click Save.

  25. Ensure that Secure Boot is enabled.

  26. Ensure that Attach vTPM is enabled.

../../../_images/nutanix_windows_vm_resources.png

VM Resources

  1. Click Next.

  2. Click Next.

  3. Click Create VM.

  4. From the list of VMs, right-click the newly created VM, select Power Operations and then select Power On.

  5. From the list of VMs, right-click the newly created VM, select Launch Console.

  6. Click a button to Press any key to boot from CD or DVD.

  7. Click Next.

  8. Click Next.

  9. Click the checkbox that starts with I agree.

  10. Click Next.

  11. Select Window Server 2025 Standard Evaluation (Desktop Experience).

  12. Click Next.

  13. Click Accept to agree to the Applicable notices and license terms.

  14. Click Load Driver.

  15. Click Browse.

  16. Expand the CD Drive containing the VirtIO drivers.

  17. Navigate to the vioscsi/2k25/amd64 folder.

  18. Click Ok.

  19. Select Red Hat VirtIO SCSI pass-through controller.

  20. Click Install.

  21. Click Load Driver.

  22. Click Accept to agree to the Applicable notices and license terms.

  23. Click Browse.

  24. Expand the CD Drive containing the VirtIO drivers.

  25. Navigate to the NetKVM/2k25/amd64 folder.

  26. Click Ok.

  27. Select Red Hat VirtIO Ethernet Adapter.

  28. Click Install.

  29. Click Load Driver.

  30. Click Accept to agree to the Applicable notices and license terms.

  31. Click Browse.

  32. Expand the CD Drive containing the VirtIO drivers.

  33. Navigate to the Balloon/2k25/amd64 folder.

  34. Click Ok.

  35. Select VirtIO Balloon Driver.

  36. Click Install.

  37. Click Next.

  38. Click Install.

  39. Enter a valid password for the built-in Administrator.

  40. Confirm the password.

  41. Click Finish.

  42. Click the Ctrl-Alt-Del icon in the console menu to send Ctrl-Alt-Del.

  43. Enter the Administrator password.

  44. Click Accept.

  45. Launch File Explorer.

  46. Navigate to the CD Drive containing the VirtIO drivers.

  47. Launch the virtio-win-gt-x64 installer.

  48. Click Next.

  49. Click the checkbox starting with I accept.

  50. Click Next.

  51. Click Next.

  52. Click Install.

  53. Click Finish.

  54. Download a valid Windows Cloudinit installer (ref).

  55. Launch the installer.

  56. Click Next.

  57. Click the checkbox starting with I accept.

  58. Click Next.

  59. Click Next.

  60. Ensure that Run Cloudbase-init service as LocalSystem is enabled.

  61. Click Next.

  62. Click Install

  63. Allow any Windows User Account Control pop-ups that request changes to the system.

  64. Click Finish.

  65. Select Local Server from the Server Manager.

  66. Click on the Disabled link next to Remote Desktop.

  67. Click Allow remote connections to this computer.

  68. Click Ok.

  69. Click Apply.

  70. Open the Start Menu

  71. Enter the value powershell into the search field.

  72. Click Run as administrator from the Windows PowerShell application menu.

  73. Execute the following command in the PowerShell console:

Set-ExecutionPolicy Unrestricted
  1. Shut down Windows.

  2. From the list of VMs, right-click the newly created VM, select Update.

  3. Click Next.

  4. In the list of Disks, click the delete icon next to the CD-ROM containing the Windows installation image.

  5. In the list of Disks, click the delete icon next to the CD-ROM containing the VirtIO driver image.

  6. Click Save.

Required Permissions

API v3

  • AHV VM

    • Clone Virtual Machine

    • Delete Virtual Machine

    • Update Virtual Machine Categories

    • Update Virtual Machine Power State

    • View Virtual Machine

  • Category

    • Create Or Update Name Category

    • Create Or Update Value Category

    • Delete Name Category

    • Delete Value Category

    • View Name Category

    • View Value Category

  • Cluster

    • View Cluster

  • Image

    • View Image

  • Marketplace Item

    • View Marketplace Item

  • Project

    • View Project

  • Subnet

    • View Subnet

  • VPC

    • View VPC

API v4

  • AHV VM

    • Associate Virtual Machine Categories

    • Clone Existing Virtual Machine

    • Delete Existing Virtual Machine

    • Power On Virtual Machine

    • View Existing Virtual Machine

    • View Virtual Machine Disk

  • Category

    • Create Category

    • Delete Category

    • View Category

  • Cluster

    • View Cluster

  • Image

    • View Image

  • Marketplace Item

    • View Marketplace Item

  • Project

    • View Project

  • Subnet

    • View Subnet

  • Storage Container

    • View Storage Container

  • Volume Group

    • Attach Volume Group To AHV VM

    • Detach Volume Group From AHV VM

  • VPC

    • View VPC