.. title:: Session Staging Session Staging =============== By default, when users create a new Kasm session, the container for that session is created on-demand. In some use-cases, administrators may wish to **Stage** (Pre-Provision) containers, so when a user requests a session, it pulls from a pool of staged containers that are already running. This may be useful to reduce the time it takes for a user to connect to a session, or if the Image has a lengthy run-time initialization routine. As part of the configuration, administrators must configure a set of default permissions (e.g **Allow Audio**) that will be enabled/disabled for the session. Because these settings must be configured at the invocation of the container, for enhanced security, user's who's group permissions do not match these will not be assigned a staged session and instead will trigger the system to create one on demand. Configuration ------------- * Log into the Kasm Web UI as an administrator. * Click **Staging**. * Click **Create New Config**. .. figure:: /images/staging/create_staging_config.png :width: 90% :align: center Staging Config .. table:: :widths: 100 +------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | **Property** | **Description** | +------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | **Zone** | The :doc:`Deployment Zone ` for the configuration | +------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | **Image** | The desired :doc:`Image ` to be staged. | +------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | **Desired Sessions** | The number of sessions the system will attempt to have staged at any given time. As users are assigned sessions from the pool, the system will automatically attempt to provision more to keep the pool at this number. | | | Reducing this number will cause the system to destroy excess staged sessions. | +------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | **Expiration (Hours)** | Staged sessions that have not been assigned to a user will expire after this amount of time. The system will destroy the staged sessions and re-created them. | +------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | **Allow Audio** | When enabled, the staged session will support streaming audio from the session to the user. | +------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | **Allow Clipboard Down** | When enabled, the staged session will allow copying data from the session to the users local computer via the clipboard | +------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | **Allow Clipboard Up** | When enabled, the staged session will allow copying data from the user's local computer to the session. | +------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | **Allow Downloads** | When enabled, the staged session will allow download files from the session to their local computer via the control panel download widget. | +------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | **Allow Microphone** | When enabled, the staged session will allow the user to pass their local microphone into the session. | +------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | **Allow Uploads** | When enabled, the staged session will allow the user to upload files from their local computer to the session via the upload widget in the control panel. | +------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ * Fill out the form then click **Submit**. * Click **Zones**. * Click **Edit** next to the desired Zone. * Update the **Allow Origin Domain** and the **Upstream Auth Address** settings to be the appropriate domain. The default :code:`$request_host$` variable cannot be used for staged sessions. Desired Sessions ---------------- The system will begin creating the staged sessions a few moments after the configuration is applied. If the **Current Sessions** does not match the **Desired Sessions** after a few minutes , consult the logs for warning or error messages. It is likely the system doesn't have enough resources (Agent Capacity) to fulfill the request, or an Image is disabled or unavailable .. figure:: /images/staging/staging_list.png :width: 90% :align: center Staging Configs Session List ------------ Staged sessions will appear without a User assigned in the **Sessions** list. Once the sessions are **assigned** to a user, the username will appear. .. figure:: /images/staging/staged_sessions.png :width: 90% :align: center Staged Sessions Incompatible Settings --------------------- Certain Group and Image level settings are not compatible with Staged Sessions as they require the container to be originally created with the settings applied. If a user requests a Kasm session but has an incompatible setting applied, the violation will be logged, and the system will provision a container on-demand. * **(Image) - Persistent Profile** * **(Image) - Volume Mappings*** That use :code:`{username}` or :code:`{user_id}` tokens * **(Group) - expose_user_environment_vars** * **(Group) - inject_ssh_keys** * **(Group) - run_config** * **(Group) - volume_mapping** * **(Group) - web_filter_policy** Administrators can apply a filter policy to the Image instead. .. figure:: /images/staging/incompatible_settings.png :width: 90% :align: center Logged settings violation Multi-Zone Behavior ------------------- When a user makes a request to launch a session the system will prefer to assign a staged session in all applicable Zones prior to attempting to create an on-demand container. The process is as follows: 1. Attempt to assign a staged session in the current Zone. 2. Attempt to assign a staged session in other Zones if **Search Alternate Zones** is configured on the current Zone. 3. Attempt to create a new on-demand session in the existing Zone. 4. Attempt to create a new on-demand session in other Zones if **Search Alternate Zones** is configured on the current Zone. Docker Exec ----------- The Docker Exec Config supports a top level key named :code:`assign`. This command is executed when the user is assigned a staged session. For more information please see :doc:`Docker Exec Config `