---
myst:
html_meta:
"description lang=en": "Learn how to configure autoscaling for Kasm Workspaces on Nutanix. This guide covers prerequisites, KubeConfig setup, VM provider details, autoscaling testing, and optimization to ensure dynamic resource allocation."
"keywords": "Kasm, Nutanix, AutoScale, autoscaling, VM, cloud-init, Kubernetes, TPM, EFI, Secure Boot"
"property=og:locale": "en_US"
---
```{title} Nutanix AutoScale
```
# Nutanix AutoScale
```{contents} Table of Contents
:depth: 3
:local:
```
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](#required-permissions) corresponding to the Nutanix API version you plan to use, ensure that any related operations are also added.
6. Click **Save**.
```{figure} /images/autoscaling/providers/nutanix/nutanix_create_role.png
:align: center
**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).
```{figure} /images/autoscaling/providers/nutanix/nutanix_create_project.png
:align: center
**Create Project**
```
5. Select **Add Users** -> **Add/Edit Users & Groups**.
6. Click **Add User**.
7. Enter the name of a valid user in the **Name** field. This user will administer the project, create Virtual Machine templates, upload images, etc.
8. From the **Role** drop-down menu, select the default **Project Admin** role.
9. Click **Add User**.
10. 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.
11. From the **Role** drop-down menu, select the new role created above (e.g. kasm-role).
12. Ensure **Allow Collaboration** is enabled.
13. Click **Save Users and Project**.
```{figure} /images/autoscaling/providers/nutanix/nutanix_project_add_users.png
:align: center
**Add Users**
```
14. Select **Add Infrastructure** -> **Add Infrastructure**.
15. From the drop-down menu, select the **Infrastructure Endpoint** that will be used to provision Kasm autoscale resources.
16. Click **Configure Resources**.
17. From the drop-down menu, select the **Cluster**.
18. Click **Select VLANs**.
19. Click the checkbox next to the VLAN that will be used to provide network access for Kasm autoscale resources.
```{figure} /images/autoscaling/providers/nutanix/nutanix_project_configure_resources.png
:align: center
**Configure Resources**
```
20. Click **Confirm and Select Default**.
21. Click **Confirm**.
22. Click **Save**.
## Configure VM Provider Details on Kasm
```{eval-rst}
* Follow :ref:`autoscale_docker_config` or :ref:`autoscale_server_config` to create to create a new AutoScale config, or select **Create New** in **VM Provider Configs** if you already have one.
* Set Provider to Nutanix
* Configure the following settings:
```
```{include} /guide/compute/vm_providers/nutanix.md
```
* 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](https://releases.ubuntu.com/24.04.2/ubuntu-24.04.2-live-server-amd64.iso)).
6. Click **Add URL**.
```{figure} /images/autoscaling/providers/nutanix/nutanix_ubuntu_create_image.png
:align: center
**Create image**
```
7. Enter the name for the ISO in the **Name** field (e.g. kasm-ubuntu-iso).
8. Ensure that **ISO** is selected from the **Type** drop-down menu.
9. Click **Next**.
```{figure} /images/autoscaling/providers/nutanix/nutanix_ubuntu_select_image.png
:align: center
**Select Image**
```
10. Click **Save**.
```{figure} /images/autoscaling/providers/nutanix/nutanix_select_location.png
:align: center
**Select Location**
```
11. 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).
```{figure} /images/autoscaling/providers/nutanix/nutanix_ubuntu_vm_configure.png
:align: center
**VM Configure**
```
9. Click **Next**.
10. Click **Attach Disk**.
11. Ensure that **Disk** is selected from the **Type** drop-down menu.
12. Ensure that **Allocate from Storage Container** is selected from the **Operation** drop-down menu.
13. From the **Storage Container** drop-down menu, select the Nutanix Storage Container to use when provisioning this VM.
14. In the **Capacity** section, enter the amount of storage to provision for this VM (e.g. 150).
15. Ensure that **SCSI** is selected from the **Bus Type** drop-down menu.
16. Click **Save**.
17. Click **Attach Disk**.
18. Ensure that **CD-ROM** is selected from the **Type** drop-down menu.
19. Ensure that **Clone from Image** is selected from the **Operation** drop-down menu.
20. From the **Image** drop-down, select the Ubuntu installation image you uploaded previously.
21. Ensure that **SATA** is selected from the **Bus Type** drop-down menu.
22. Click **Save**.
23. Click **Attach to Subnet**.
24. From the **subnet** drop-down, select the Nutanix Subnet to use when provisioning this VM.
25. Ensure that **Connected** is selected from the **Network Connection State** drop-down menu.
26. Click **Save**.
```{figure} /images/autoscaling/providers/nutanix/nutanix_ubuntu_vm_resources.png
:align: center
**VM Resources**
```
27. Click **Next**.
28. Click **Next**.
29. Click **Create VM**.
30. From the list of VMs, right-click the newly created VM, select **Power Operations** and then select **Power On**.
31. Install the OS.
32. From the list of VMs, right-click the newly created VM, select **Update**.
33. Click **Next**.
34. In the list of **Disks**, click the **delete** icon next to the CD-ROM containing the installation ISO image.
35. Click **Save**.
36. SSH into the newly created VM with the credentials created during OS installation.
37. Run the following terminal commands:
```bash
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**.
```{figure} /images/autoscaling/providers/nutanix/nutanix_windows_create_image.png
:align: center
**Create image**
```
7. Enter the name for the ISO in the **Name** field (e.g. kasm-windows-iso).
8. Ensure that **ISO** is selected from the **Type** drop-down menu.
9. Click **Next**.
```{figure} /images/autoscaling/providers/nutanix/nutanix_windows_select_image.png
:align: center
**Select Image**
```
10. Click **Save**.
```{figure} /images/autoscaling/providers/nutanix/nutanix_select_location.png
:align: center
**Select Location**
```
11. 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](https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable)).
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).
```{figure} /images/autoscaling/providers/nutanix/nutanix_windows_vm_configure.png
:align: center
**VM Configure**
```
9. Click **Next**.
10. Click **Attach Disk**.
11. Ensure that **Disk** is selected from the **Type** drop-down menu.
12. Ensure that **Allocate from Storage Container** is selected from the **Operation** drop-down menu.
13. From the **Storage Container** drop-down menu, select the Nutanix Storage Container to use when provisioning this VM.
14. In the **Capacity** section, enter the amount of storage to provision for this VM (e.g. 150).
15. Ensure that **SCSI** is selected from the **Bus Type** drop-down menu.
16. Click **Save**.
17. Click **Attach Disk**.
18. Ensure that **CD-ROM** is selected from the **Type** drop-down menu.
19. Ensure that **Clone from Image** is selected from the **Operation** drop-down menu.
20. From the **Image** drop-down, select the Windows installation image you uploaded previously.
21. Ensure that **SATA** is selected from the **Bus Type** drop-down menu.
22. Click **Save**.
23. Click **Attach Disk**.
24. Ensure that **CD-ROM** is selected from the **Type** drop-down menu.
25. Ensure that **Clone from Image** is selected from the **Operation** drop-down menu.
26. From the **Image** drop-down, select the VirtIO driver image you uploaded previously.
27. Ensure that **SATA** is selected from the **Bus Type** drop-down menu.
28. Click **Save**.
29. Click **Attach to Subnet**.
30. From the **subnet** drop-down, select the Nutanix Subnet to use when provisioning this VM.
31. Ensure that **Connected** is selected from the **Network Connection State** drop-down menu.
32. Click **Save**.
33. Ensure that **Secure Boot** is enabled.
34. Ensure that **Attach vTPM** is enabled.
```{figure} /images/autoscaling/providers/nutanix/nutanix_windows_vm_resources.png
:align: center
**VM Resources**
```
35. Click **Next**.
36. Click **Next**.
37. Click **Create VM**.
38. From the list of VMs, right-click the newly created VM, select **Power Operations** and then select **Power On**.
39. From the list of VMs, right-click the newly created VM, select **Launch Console**.
40. Click a button to **Press any key to boot from CD or DVD**.
41. Click **Next**.
42. Click **Next**.
43. Click the checkbox that starts with **I agree**.
44. Click **Next**.
45. Select **Window Server 2025 Standard Evaluation (Desktop Experience)**.
46. Click **Next**.
47. Click **Accept** to agree to the Applicable notices and license terms.
48. Click **Load Driver**.
49. Click **Browse**.
50. Expand the CD Drive containing the VirtIO drivers.
51. Navigate to the **vioscsi/2k25/amd64** folder.
52. Click **Ok**.
53. Select **Red Hat VirtIO SCSI pass-through controller**.
54. Click **Install**.
55. Click **Load Driver**.
56. Click **Accept** to agree to the Applicable notices and license terms.
57. Click **Browse**.
58. Expand the CD Drive containing the VirtIO drivers.
59. Navigate to the **NetKVM/2k25/amd64** folder.
60. Click **Ok**.
61. Select **Red Hat VirtIO Ethernet Adapter**.
62. Click **Install**.
63. Click **Load Driver**.
64. Click **Accept** to agree to the Applicable notices and license terms.
65. Click **Browse**.
66. Expand the CD Drive containing the VirtIO drivers.
67. Navigate to the **Balloon/2k25/amd64** folder.
68. Click **Ok**.
69. Select **VirtIO Balloon Driver**.
70. Click **Install**.
71. Click **Next**.
72. Click **Install**.
73. Enter a valid password for the built-in Administrator.
74. Confirm the password.
75. Click **Finish**.
76. Click the Ctrl-Alt-Del icon in the console menu to **send Ctrl-Alt-Del**.
77. Enter the Administrator password.
78. Click **Accept**.
79. Launch **File Explorer**.
80. Navigate to the CD Drive containing the VirtIO drivers.
81. Launch the **virtio-win-gt-x64** installer.
82. Click **Next**.
83. Click the checkbox starting with **I accept**.
84. Click **Next**.
85. Click **Next**.
86. Click **Install**.
87. Click **Finish**.
88. Download a valid Windows Cloudinit installer ([ref](https://cloudbase.it/cloudbase-init/)).
89. Launch the installer.
90. Click **Next**.
91. Click the checkbox starting with **I accept**.
92. Click **Next**.
93. Click **Next**.
94. Ensure that **Run Cloudbase-init service as LocalSystem** is enabled.
95. Click **Next**.
96. Click **Install**
97. Allow any Windows User Account Control pop-ups that request changes to the system.
98. Click **Finish**.
99. Select **Local Server** from the **Server Manager**.
100. Click on the **Disabled** link next to **Remote Desktop**.
101. Click **Allow remote connections to this computer**.
102. Click **Ok**.
103. Click **Apply**.
104. Open the Start Menu
105. Enter the value **powershell** into the search field.
106. Click **Run as administrator** from the **Windows PowerShell** application menu.
107. Execute the following command in the PowerShell console:
```powershell
Set-ExecutionPolicy Unrestricted
```
108. Shut down Windows.
109. From the list of VMs, right-click the newly created VM, select **Update**.
110. Click **Next**.
111. In the list of **Disks**, click the **delete** icon next to the **CD-ROM** containing the Windows installation image.
112. In the list of **Disks**, click the **delete** icon next to the **CD-ROM** containing the VirtIO driver image.
113. 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