Skip to main content
Version: Developer

Configure Kasm Workspaces AutoScale on Nutanix AHV

Overview

Workspace demand on Nutanix AHV rises and falls through the day, and paying for idle virtual machines during quiet periods wastes cluster capacity. This guide configures Kasm Workspaces AutoScale to provision and destroy agents on Nutanix AHV automatically in response to demand. The result is elastic capacity that meets peak load and reclaims compute between sessions. AutoScale on Nutanix keeps on-premises infrastructure efficient without manual provisioning of each agent.

Prerequisites

Confirm the following before you begin:

  • Administrator access to your Nutanix Prism Central environment, including permission to create roles, projects, images, and virtual machines.
  • A directory service or identity provider configured in Nutanix.
  • Two Nutanix users: one to administer the project and build virtual machines, and one for Kasm to authenticate against the Nutanix APIs.
  • A working Kasm Workspaces deployment. See the single-server installation guide if you need to deploy Kasm first.
  • Knowledge of the deployment zone and pool that the AutoScaled agents will join. A deployment zone is a logical grouping of Kasm infrastructure components, and a pool groups Docker Agents and Server Pools for load balancing.
  • Your Nutanix infrastructure details, including the target cluster, project, storage container, and subnet for the provisioned virtual machines.

Solution approach

This guide progresses through the following phases:

  1. Prepare the Nutanix role and project.
  2. Build a virtual machine template for the agents.
  3. Configure the Nutanix VM provider in Kasm.
  4. Validate that provisioning and downscaling work.

Detailed steps

Prepare the Nutanix role and project

Create a dedicated role and project in Prism Central so Kasm authenticates with least privilege and provisions resources into an isolated boundary.

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, for example kasm-role.
  5. Add all the operations from the list of required permissions that correspond to the Nutanix API version you plan to use, and ensure that any related operations are also added.
  6. Select Save.
Create Role
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, for example kasm-autoscale.
Create Project
Create Project
  1. Select Add Users > Add/Edit Users & Groups.
  2. Select Add User.
  3. Enter the name of a valid user in the Name field. This user administers the project, builds virtual machine templates, and uploads images.
  4. From the Role drop-down menu, select the default Project Admin role.
  5. Select Add User.
  6. Enter the name of a valid user in the Name field. Kasm uses this user in the provider configuration to authenticate against the Nutanix APIs.
  7. From the Role drop-down menu, select the role you created above, for example kasm-role.
  8. Ensure Allow Collaboration is enabled.
  9. Select Save Users and Project.
Add Users
Add Users
  1. Select Add Infrastructure > Add Infrastructure.
  2. From the drop-down menu, select the Infrastructure Endpoint that will provision Kasm AutoScale resources.
  3. Select Configure Resources.
  4. From the drop-down menu, select the Cluster.
  5. Select Select VLANs.
  6. Select the checkbox next to the VLAN that will provide network access for Kasm AutoScale resources.
Configure Resources
Configure Resources
  1. Select Confirm and Select Default.
  2. Select Confirm.
  3. Select Save.

Build a virtual machine template for the agents

AutoScale clones a prepared template each time it provisions an agent. Build an Ubuntu template, a Windows template, or both, depending on the workspaces you intend to run.

Create an Ubuntu 24.04 LTS template

First, upload the Ubuntu installation image to Prism Central.

  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 Ubuntu 24.04 LTS ISO in the Image URL field, for example the Ubuntu 24.04.2 live server image.
  6. Select Add URL.
Create image
Create image
  1. Enter the name for the ISO in the Name field, for example kasm-ubuntu-iso.
  2. Ensure that ISO is selected from the Type drop-down menu.
  3. Select Next.
Select Image
Select Image
  1. Select Save.
Select Location
Select Location
  1. Wait for the upload to complete.

Next, build the virtual machine that becomes the template.

  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, for example kasm-ubuntu-template.
  5. From the Project drop-down menu, select the Nutanix project you created, for example kasm-autoscale.
  6. From the Cluster drop-down menu, select the Nutanix cluster that will provision Kasm AutoScale resources.
  7. In the Cores Per CPU section, enter the number of cores to provision for this VM, for example 4.
  8. In the Memory section, enter the amount of memory to provision for this VM, for example 4.
VM Configure
VM Configure
  1. Select Next.
  2. Select 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, for example 150.
  7. Ensure that SCSI is selected from the Bus Type drop-down menu.
  8. Select Save.
  9. Select 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. Select Save.
  15. Select 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. Select Save.
VM Resources
VM Resources
  1. Select Next.
  2. Select Next.
  3. Select Create VM.
  4. From the list of VMs, right-click the new VM, select Power Operations, and then select Power On.
  5. Install the operating system.
  6. From the list of VMs, right-click the new VM and select Update.
  7. Select Next.
  8. In the list of Disks, select the delete icon next to the CD-ROM that contains the installation ISO image.
  9. Select Save.
  10. Connect to the new VM over SSH with the credentials created during operating system installation.
  11. Run the following cleanup commands to prepare this VM as a reusable template:
sudo truncate -s 0 /etc/machine-id
sudo truncate -s 0 /var/lib/dbus/machine-id
sudo cloud-init clean --logs
  1. Shut down the VM:
sudo shutdown -P now

Create a Windows Server 2025 template

First, upload the Windows installation image to Prism Central.

  1. Log into your Nutanix Prism Central UI as an administrator.
  2. Navigate to the Infrastructure Center dashboard.
  3. Select Images > Add Image.
  4. Select Add File.
  5. Select a valid Windows Server 2025 ISO from the File Upload window.
  6. Select Open.
Create image
Create image
  1. Enter the name for the ISO in the Name field, for example kasm-windows-iso.
  2. Ensure that ISO is selected from the Type drop-down menu.
  3. Select Next.
Select Image
Select Image
  1. Select Save.
Select Location
Select Location
  1. Wait for the upload to complete.

Next, upload the VirtIO driver image that Windows needs to detect the SCSI disk.

  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, for example the stable VirtIO Windows drivers.
  6. Select Add URL.
  7. Ensure that ISO is selected from the Type drop-down menu.
  8. Select Next.
  9. Select Save.
  10. Wait for the upload to complete.

Finally, build the virtual machine that becomes the Windows template.

  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, for example kasm-windows-template.
  5. From the Project drop-down menu, select the Nutanix project you created, for example kasm-autoscale.
  6. From the Cluster drop-down menu, select the Nutanix cluster that will provision Kasm AutoScale resources.
  7. In the Cores Per CPU section, enter the number of cores to provision for this VM, for example 4.
  8. In the Memory section, enter the amount of memory to provision for this VM, for example 4.
VM Configure
VM Configure
  1. Select Next.
  2. Select 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, for example 150.
  7. Ensure that SCSI is selected from the Bus Type drop-down menu.
  8. Select Save.
  9. Select 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. Select Save.
  15. Select 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. Select Save.
  21. Select 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. Select Save.
  25. Ensure that Secure Boot is enabled.
  26. Ensure that Attach vTPM is enabled.
VM Resources
VM Resources
  1. Select Next.
  2. Select Next.
  3. Select Create VM.
  4. From the list of VMs, right-click the new VM, select Power Operations, and then select Power On.
  5. From the list of VMs, right-click the new VM and select Launch Console.
  6. When prompted, press any key to boot from CD or DVD.
  7. Select Next.
Windows 2025 Language Selection
Windows 2025 Language Selection
  1. Select Next.
Windows 2025 Keyboard Selection
Windows 2025 Keyboard Selection
  1. Select the checkbox that starts with I agree.
  2. Select Next.
Windows 2025 Setup Options
Windows 2025 Setup Options
  1. Select Windows Server 2025 Standard Evaluation (Desktop Experience).
  2. Select Next.
Windows 2025 Image Selection
Windows 2025 Image Selection
  1. Select Accept to agree to the applicable notices and license terms.
Windows 2025 Accept License
Windows 2025 Accept License
  1. Select Load Driver.
Windows 2025 Load Driver
Windows 2025 Load Driver
  1. Select Browse.
Windows 2025 Browse Driver
Windows 2025 Browse Driver
  1. Expand the CD drive that contains the VirtIO drivers.
  2. Navigate to the vioscsi/2k25/amd64 folder.
  3. Select Ok.
Windows 2025 Driver Folder
Windows 2025 Driver Folder
  1. Select Red Hat VirtIO SCSI pass-through controller.
  2. Select Install.
Windows 2025 Select Driver
Windows 2025 Select Driver
  1. Select Next.
Windows 2025 Location Selection
Windows 2025 Location Selection
  1. Select Install.
Windows 2025 Install Ready
Windows 2025 Install Ready
  1. Enter a valid password for the built-in Administrator.
  2. Confirm the password.
  3. Select Finish.
Windows 2025 Create Password
Windows 2025 Create Password
  1. Select the Ctrl-Alt-Del icon in the console menu to send Ctrl-Alt-Del.
  2. Enter the Administrator password.
  3. Select Accept.
Windows 2025 Accept Privacy
Windows 2025 Accept Privacy
  1. Launch File Explorer.
  2. Navigate to the CD drive that contains the VirtIO drivers.
  3. Launch the virtio-win-gt-x64 installer.
Windows 2025 Browse VirtIO Drivers
Windows 2025 Browse VirtIO Drivers
  1. Select Next.
  2. Select the checkbox that starts with I accept.
  3. Select Next.
  4. Select Next.
  5. Select Install.
  6. Select Finish.
Windows 2025 Install VirtIO Drivers
Windows 2025 Install VirtIO Drivers
  1. Download a valid Windows Cloudbase-Init installer from the Cloudbase-Init project.
  2. Launch the installer.
Windows 2025 Download Cloudinit
Windows 2025 Download Cloudinit
  1. Select Next.
  2. Select the checkbox that starts with I accept.
  3. Select Next.
  4. Select Next.
  5. Ensure that Run Cloudbase-init service as LocalSystem is enabled.
  6. Select Next.
  7. Select Install.
  8. Allow any Windows User Account Control prompts that request changes to the system.
  9. Select Finish.
Windows 2025 Install Cloudinit
Windows 2025 Install Cloudinit
  1. Select Local Server from the Server Manager.
  2. Select the Disabled link next to Remote Desktop.
  3. Select Allow remote connections to this computer.
  4. Select Ok.
  5. Select Ok.
Windows 2025 Remote Desktop
Windows 2025 Remote Desktop
  1. Open the Start menu.
  2. Enter the value powershell into the search field.
  3. Select Run as administrator from the Windows PowerShell application menu.
  4. Run the following command in the PowerShell console:
Set-ExecutionPolicy Unrestricted
Windows 2025 Powershell Command
Windows 2025 Powershell Command
  1. Shut down Windows.
  2. From the list of VMs, right-click the new VM and select Update.
  3. Select Next.
  4. In the list of Disks, select the delete icon next to the CD-ROM that contains the Windows installation image.
  5. In the list of Disks, select the delete icon next to the CD-ROM that contains the VirtIO driver image.
  6. Select Save.

Configure the Nutanix VM provider in Kasm

Add a Nutanix provider in Kasm so AutoScale clones the template and provisions agents on demand.

  1. Follow AutoScale settings for an Agent Pool or AutoScale settings for a Server Pool to create a new AutoScale config. Select Create New under VM Provider Configs if you already have one.
  2. Set the provider to Nutanix.
  3. Configure the following settings:
SettingDescription
NameAn identifying name for this provider configuration e.g. Nutanix Docker Agent AutoScale Provider
Max InstancesThe maximum number of autoscale instances to be provisioned, regardless of other settings
HostThe IP or FQDN of the Nutanix Prism Central server (e.g. 192.168.100.40 or nutanix.example.com)
PortThe listening port to the Nutanix Prism Central server. This is usually 9440
UsernameThe name of the user that Kasm will use to access the Nutanix Prism Central server
PasswordThe Password of the user that Kasm will use to authenticate against the Nutanix Prism Central server
Verify SSLWhether to validate SSL certificates. Set to False to enable self-signed certificates. Defaults to True
API VersionThe API version used to communicate with Prism Central. v3 is recommended, v4 compatibility is currently in Preview
VM Candidate NameThe name of the VM used to clone new autoscaled VMs
VM CoresThe number of CPU cores to provision on the new autoscaled VMs
VM MemoryThe amount of memory to provision on the new autoscaled VMs. The admin console accepts Bytes/MiB/GiB and stores the value as bytes (memory_bytes). API integrations must submit the number of bytes.
Startup ScriptWhen 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
  1. Submit the provider configuration.
note

Support for Nutanix API version 4 is in preview.

Validate provisioning and downscaling

  1. If you configured non-zero standby or minimum available session values, agents begin provisioning immediately. Otherwise, generate demand with the following steps.
  2. Make one or more workspaces available. Open Workspaces > Registry and set the target workspaces to available.
  3. Open the Workspaces dashboard and launch enough sessions to exceed your standby thresholds.
  4. Monitor the new agents under Infrastructure > Agents as Kasm provisions them.
  5. Confirm that matching VM instances appear in Nutanix.
  6. Validate downscaling. Terminate the sessions to reduce resource usage, then confirm that Kasm removes the agents after the configured back-off period.

Required Permissions

Assign the operations below to the Nutanix role from the first phase. Add only the set that matches the API version you plan to use, and include any related operations that Nutanix prompts for.

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

Common troubleshooting steps

  • Virtual machines fail to provision. Confirm that the Kasm API user holds the role you created and that the role includes every required permission for your API version. Verify that the cluster, project, storage container, and subnet referenced in the provider configuration are valid.
  • Provisioning fails with a permission error. Review the required permissions for your API version and confirm that related operations Nutanix prompted for were also added to the role.
  • Agents provision but never register. Confirm that the template was cleaned correctly and that the provisioned agent can reach the Kasm Manager on the required ports. Review the AutoScale startup scripts for reference.
  • Windows VMs fail to detect the disk during setup. Confirm that the VirtIO SCSI pass-through driver loaded during installation and that the VirtIO driver image was attached to the template.
  • Agents do not downscale. Confirm that sessions have ended and that the configured back-off period has elapsed before Kasm removes the agents.