---
myst:
html_meta:
"description lang=en": "Comprehensive guide to configuring Oracle Cloud (OCI) AutoScale for Kasm Workspaces. Learn how to set up OCI API keys, network resources, VM provider settings, and test autoscaling of agents for efficient compute resource management."
"keywords": "Kasm, Oracle Cloud, OCI, AutoScale, autoscaling, compute, VM, OCID, API key, cloud-init, startup script, availability domains, custom tags"
"property=og:locale": "en_US"
---
```{title} Oracle Cloud (OCI) AutoScale
```
# Oracle Cloud (OCI) AutoScale
```{contents} Table of Contents
:depth: 3
:local:
```
This guide will walk you through configuring autoscaling for Kasm Workspaces on Oracle Cloud. 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 Digital Ocean: Ensure you have the appropriate access to your Oracle 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
* Configure your OCI environment
### Setup your Oracle Cloud Environment
- **Create an API Key on OCI**: You need to create an API key so that Kasm can use it to talk to OCI on your behalf.
* Generate a key pair with OpenSSL
```
# create a directory for storing your key pair
mkdir -p ~/.oci
# create private key
openssl genrsa -out ~/.oci/oci_api_key.pem 2048
# create public key
openssl rsa -pubout -in ~/.oci/oci_api_key.pem -out ~/.oci/oci_api_key_public.pem
```
* Copy your public key
* Go your OCI dashboard -> Click on your Profile -> "User Settings" -> "API keys" -> "Add API Key"
* Select "Paste a public key" and paste your public key here and click "Add"
```{figure} /images/autoscaling/providers/oci/oci_add_api_key.png
:align: center
**Add API Key to OCI**
```
* This will generate the "Public Key Fingerprint". Make a note of it as this value needs to be fed into Kasm later.
```{figure} /images/autoscaling/providers/oci/oci_public_key_fingerprint.png
:align: center
**Public Key fingerprint**
```
## Configure your Oracle Cloud 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 Oracle Cloud
* Configure the following settings:
```
```{include} /guide/compute/vm_providers/gcp.md
```
* Submit the Provider Config
### OCI Config Override Examples
Below are some OCI autoscale configurations that utilize the OCI Config Override.
```{eval-rst}
.. dropdown:: Disable Legacy Instance Metadata Service
:animate: fade-in
Disables instance metadata service v2 for additional security.
.. code-block:: json
{
"launch_instance_details": {
"instance_options": {
"OCI_MODEL_NAME": "InstanceOptions",
"are_legacy_imds_endpoints_disabled": true
}
}
}
.. dropdown:: Enable Instance Agent Plugins
:animate: fade-in
A list of available plugins can be retrieved by navigating to an existing instance's "Oracle Cloud Agent" config page.
This example enables the "Vulnerability Scanning" plugin.
.. code-block:: json
{
"launch_instance_details": {
"agent_config": {
"OCI_MODEL_NAME": "LaunchInstanceAgentConfigDetails",
"is_monitoring_disabled": false,
"is_management_disabled": false,
"are_all_plugins_disabled": false,
"plugins_config": [{
"OCI_MODEL_NAME": "InstanceAgentPluginConfigDetails",
"name": "Vulnerability Scanning",
"desired_state": "ENABLED"
}]
}
}
}
```
## Test your Oracle Cloud 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