VMware vSphere AutoScale

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

Overview

Prerequisites

  • Access to VCenter: Ensure you have admin access to your VCenter environment

  • 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 Vcenter server details; target clusters, datastores, networks, etc.

    • Create template images for AutoScale to use

Setup your vSphere environment

  • Create an account: We recommend creating a dedicated VCenter user for use with Kasm AutoScale.

  • Create a Kasm AutoScale role: Create a new role to use with Kasm AutoScale. The following minimum permissions set is required:

    • Datastore

      • Allocate space

      • Browse datastore

    • Global

      • Cancel task

    • Network

      • Assign network

    • Resource

      • Assign virtual machine to resource pool

    • Virtual machine

      • Change Configuration

        • Change CPU count

        • Change Memory

        • Set annotation

      • Edit Inventory

        • Create from existing

        • Create new

        • Remove

        • Unregister

      • Guest operations

        • Guest operation modifications

        • Guest operation program execution

        • Guest operation queries

      • Interaction

        • Power off

        • Power on

      • Provisioning

        • Deploy template

    ../../../_images/vsphere_role_permissions.png

    Create AutoScale role in vSphere

  • Assign Role to User: Assign the created role to the Kasm AutoScale user account.

    ../../../_images/vsphere_assign_role_to_user.png

    Assign AutoScale role to user

  • Create a VM template: Create the appropriate VM template based on whether you are implementing Server AutoScaling or Docker AutoScaling on vSphere.

    • For Windows AutoScaling, follow the Windows Templating Guide.

    • For Docker Agent AutoScaling, create a Linux VM template using Ubuntu Jammy as the base OS.

Configure VM Provider Details on Kasm

../../../_images/vm_vsphere.webp

vSphere VM Provider

vSphere VM Provider Settings

Setting

Description

Name

An identifying name for this provider configuration.

vSphere vCenter Address

The IP or FQDN of the VMware vSphere vCenter server to use.

vSphere vCenter Port

The management port of your Vcenter instance (typically 443)

vSphere vCenter Username

The username to use when authenticating with the vSphere vCenter server.

vSphere vCenter Password

The password to use when authenticating with the vSphere vCenter server.

VM Template Name

The name of the template VM to use when cloning new autoscaled VMs.

Max Instances

The maximum number of vSphere VM instances to provision regardless of the need for available free slots.

Datacenter Name

The datacenter to use for cloning the new vSphere VM instances.

VM Folder

The VM folder to use for cloning the new vSphere VM instances. This field is optional, if left blank the VM folder of the template is used.

Datastore Name

The datastore to use for cloning the new vSphere VM instances. This field is optional, if left blank the datastore of the template is used.

Cluster Name

The cluster to use for cloning the new vSphere VM instances. This field is optional, if left blank the cluster of the template is used.

Resource Pool

The resource pool to use for cloning the new vSphere VM instances. This field is optional, if left blank the resource pool of the template is used.

Datastore Cluster Name

The datastore cluster to use for cloning the new vSphere VM instances. This field is optional, if left blank the datastore cluster of the template is used.

Guest VM Username

The username to use for running the startup script on the new vSphere VM instance. This account should have sufficient privileges to execute all commands in the startup script.

Guest VM Password

The password for the Guest VM Username account.

Number of Guest CPUs

The number of CPUs to configure on new vSphere VM instances. This option is not dependent on the number of CPUs configured on the template.

Amount of Guest Memory(GiB)

The amount of memory in GibiBytes to configure on new vSphere VM instances. This option is not dependent on the amount of memory configured on the template.

What family of OS is installed in the VM

Whether the template OS is Linux or Windows. This is needed to ensure proper execution of the startup script.

Startup Script

When instances are provisioned, this script is executed and is responsible for installing and configuring the Kasm Agent. Scripts are run as bash scripts on a Linux host and Powershell scripts on a Windows host. Additional troublshooting steps can be found in the Creating Templates For Use With The VMware vSphere Provider section of the server documentation.

  • Submit the Provider Config

Note

When configuring VMware vSphere with Kasm Workspaces, one important item to keep in mind is datastore storage. When clones are created VMware will attempt to satisfy the clone operation if the datastore runs out of space, any VMs that are running on that datastore will be paused until space is available. Kasm Workspaces recommends that critical management VMs such as the Vcenter server VM and cluster management VMs are on separate datastores that are not used for Kasm autoscaling.

Test your VMWare vSphere 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 Proxmox

  • Check Downscaling

    • Terminate sessions to reduce resource usage

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