---
myst:
html_meta:
"description lang=en": "Kasm Workspaces has the ability to automatically provision and destroy Servers and Docker Agents based on user demand. The AutoScale configuration differs slightly between Servers and Agents."
"keywords": "Kasm, Pooling, Pool, autoscale, autoscaling, auto, scale, VM"
"property=og:locale": "en_US"
---
```{title} GCP Autoscaling
```
# Google Cloud (GCP) AutoScale
This guide will walk you through configuring autoscaling for Kasm Workspaces on Google Cloud (GCP). Autoscaling in Kasm Workspaces automatically provisions and destroys agents based on user demand, ensuring optimized resource utilization and cost efficiency.
```{raw} html
```
## Overview
### Prerequisites
* Access to Google Cloud (GCP): Ensure you have admin access to your Google Cloud (GCP) 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 Google Cloud (GCP) details; target regions, networks, etc.
* Create template images for your autoscale agents, if you require customisations baked into the images
### Setup your GCP environment
- **Create service account**: Go to "IAM" -> "Service Accounts" and create a new service account for use with Kasm AutoScaling. Also, make sure to give it the **Compute Admin** role.
```{figure} /images/autoscaling/providers/gcp/gcp_service_account.png
:align: center
**Create Service Account in GCP**
```
- **Create Key**: Click on the created service account, and go to "Keys". Click "Add Key" -> Select key type as JSON -> "Create". This will generate a JSON file for you to download that contains all the authentication information required to configure AutoScaling on Kasm.
```{figure} /images/autoscaling/providers/gcp/gcp_create_key.png
:align: center
**Create Key in GCP**
```
## Configure VM Provider Details on Kasm
```{include} /guide/compute/vm_providers/gcp.md
```
* Submit the Provider Config
## Test Autoscaling
* If you have configured non-zero Standby/Minimum Available Session values agents should start provisioning immediately, otherwise...
* 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 in the Docker Agents section
* Verify new VM instances in Google Cloud (GCP)
* Check Downscaling
* Terminate sessions to reduce resource usage
* Confirm that Kasm removes agents after the back-off period