# Automatic Deployment

Opposite the [manual deployment process](/game-hosting/processes/deployment-process.md#manual-deployments) is the automatic deployment process whereby our platform takes care of deploying game servers and utilities (side cars) for you. This is done according to the [Deployment Configuration](/game-hosting/processes/deployment-configuration.md) you have setup for a [Fleet](/game-hosting/elements/deploymentenvironment/fleet.md).

## Prerequisites

For automatic deployment to be possible, you must first create the following elements:

* a [Deployment Environment](/game-hosting/elements/deploymentenvironment.md)
* a [Fleet](/game-hosting/elements/deploymentenvironment/fleet.md) with:
  * at least a [GameDeploymentTemplate](/game-hosting/elements/deploymentenvironment/index/gamedeploymenttemplate.md)
  * optionally a [UtilityDeploymentTemplate](/game-hosting/elements/deploymentenvironment/index/utilitydeploymenttemplate.md)
  * a [DeploymentProfile](/game-hosting/elements/deploymentenvironment/deploymentprofile.md) with at least one [DeploymentRegion](/game-hosting/elements/deploymentenvironment/deploymentregion.md)

Of course you must also have created at least [one Application element](/game-hosting/processes/application-management.md) and [one ApplicationBuild element](/game-hosting/processes/application-build-management.md), otherwise you have nothing to deploy.

## Fleet operational status

There are two modes of automatic deployment, which are defined by the [operational status](https://www.i3d.net/docs/api/v3/game-publisher#/Fleet/updateFleetOperationalStatus) of a [Fleet](/game-hosting/elements/deploymentenvironment/fleet.md):

* Automatic deployment
* Automatic scaling

These two modes are explained in the following chapters:

### Automatic deployment

In this mode, the amount of instances defined by [DeploymentProfile.minimumCapacity](/game-hosting/elements/deploymentenvironment/deploymentprofile.md#element-structure) will be (statically) deployed, per region. So if you want to deploy a certain, static amount of application instances, you can use this option.

You can adjust the number of deployed instances at any time by changing the [DeploymentProfile.minimumCapacity](/game-hosting/elements/deploymentenvironment/deploymentprofile.md#element-structure) value. The system will then create or destroy the amount of instances necessary to match the new value. Note that minimumCapacity can be [overridden per region](/game-hosting/elements/deploymentenvironment/deploymentregion.md#element-structure) as well.

For more information, refer to the [Minimum capacity deployments](#minimum-capacity-deployments) chapter.

### Automatic scaling

In this mode, at least the amount of instances defined by [DeploymentProfile.minimumCapacity](/game-hosting/elements/deploymentenvironment/deploymentprofile.md#element-structure) will be deployed, per region, as described in the previous paragraph. When additional capacity is required due to game servers becoming [allocated](/game-hosting/game-integration/matchmaker-allocation.md) or occupied, more game servers will automatically be deployed, first on your bare metal servers, or when these have been saturated, on cloud VMs as defined in the [DeploymentContainerLocation](/game-hosting/elements/deploymentenvironment/deploymentcontainerlocation.md)s of each [DeploymentRegion](/game-hosting/elements/deploymentenvironment/deploymentregion.md).

The same is valid for downscaling. If there are too many (empty) instances, the platform will remove any unused instances (on a per region basis).

For a full explanation on how automatic scaling works, please refer to the [Automatic Scaling](/game-hosting/processes/automatic-scaling.md) chapter.

## Minimum capacity deployments

When you enable [automatic deployment](#automatic-deployment_1) or [automatic scaling](#automatic-scaling) on a Fleet, our scaling mechanism will start by deploying the number of Application Instances defined by the [DeploymentProfile.minimumCapacity](/game-hosting/elements/deploymentenvironment/deploymentprofile.md#element-structure) value. The number of deployed instances will never drop below this value, even if there are no players at all. The minimumCapacity value as such can be used in preparation for a new release, to ensure you have enough game servers to begin with upon release of your game. Coincidentally, minimumCapacity could also be used by you to manually scale game servers, by changing this value whenever you need more or less game servers.

If the DeploymentProfile.minimumCapacity value exceeds your bare metal capacity, the scaler will continue to deploy in the cloud, provided cloud locations have been defined for the relevant regions.

The DeploymentProfile.minimumCapacity value defines minimumCapacity for each individual region. You can [override](/game-hosting/elements/deploymentenvironment/deploymentregion.md#element-structure) this value per region in case you would like more instances deployed in a region where you expect more players. But keep in mind, minimumCapacity is mainly meant for the initial deployment of instances. Our scaling mechanism will of course start scaling instances if more players are needed \[in a certain region].

## The bufferValue

The bufferValue only applies to the automatic scaling mode of a Fleet.

Besides the minimumCapacity setting, there is the bufferValue setting which determines the size of the pool of ApplicationInstances that must be available at all times. The purpose of this buffer is to catch sudden increases in the number of players and as such, to attempt (to ensure) there are always sufficient free game servers for your clients to join. In other words, the bufferValue is there to compensate for the time it takes to deploy game servers. The longer that takes (related to the size of your build files), the larger the buffer should be. The larger the buffer, the less risc there is of running out of available game servers. It is therefore important not to set this value too low.

The bufferValue can be defined in [DeploymentProfile.bufferValue](/game-hosting/elements/deploymentenvironment/deploymentprofile.md#element-structure) and can be [overriden](/game-hosting/elements/deploymentenvironment/deploymentregion.md#element-structure) per region, just like the minimumCapacity from the previous paragraph.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.i3d.net/game-hosting/processes/automatic-deployment.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
