<br />

<br />


**Managed Airflow (Gen 3)** \| Managed Airflow (Gen 2) \| Managed Airflow (Legacy Gen 1)

<br />

<br />

<br />

<br />

<br />

<br />

This page explains how to hibernate and resume a development mode environment.

For instructions about creating a development mode environment, see
[Create environments](https://docs.cloud.google.com/composer/docs/composer-3/create-environments.md.txt#development-mode).

If you want to run an Airflow environment for development purposes locally
instead, see [Run a local Airflow environment](https://docs.cloud.google.com/composer/docs/composer-3/run-local-airflow-environments.md.txt).

## About development mode environments

A development mode environment is a type of environment that can be used for
development purposes. You can hibernate a development mode environment when
you're not using it and resume it later.

Development mode environments have the following constraints:

- Only Managed Airflow (Gen 3) environments with Airflow 3, Airflow 2.11.1 and Airflow 2.10.5.
- Only [standard resilience mode](https://docs.cloud.google.com/composer/docs/composer-3/set-up-highly-resilient-environments.md.txt).
- Small environment size and default resource limits provided by the [Small environment preset](https://docs.cloud.google.com/composer/docs/composer-3/scale-environments.md.txt#presets). It's not possible to change the number of Airflow components or resource limits of a development mode environment.

> [!IMPORTANT]
> **Important:** Development mode environments are intended **only for development purposes**. Don't use development mode environments in production.

You can save and load [snapshots](https://docs.cloud.google.com/composer/docs/composer-3/save-load-snapshots.md.txt) of development mode
environments. In this way, you can transfer your DAGs and other data from
and to a development mode environment.

## About environment hibernation

An environment in hibernation works in the following way:

- Airflow components of your environment aren't running. DAG runs won't be
  created, queued, or scheduled for execution while the environment is
  hibernated. DAGs won't be parsed or synchronized from the environment's
  bucket.

  > [!IMPORTANT]
  > **Important:** Make sure that schedule and catch up configuration of your DAGs takes the hibernation period into account. For example, if you configure catch up, Airflow can start creating DAG runs for the hibernation period after you resume the environment.

- Pods in the `composer-user-workloads` namespace don't run while the
  environment is hibernated.

- The environment [consumes DCUs](https://cloud.google.com/products/managed-service-for-apache-airflow/pricing#managed-service-for-apache-airflow-gen-3)
  only for storing the hibernated environment components. Most of the
  environment costs are reduced to zero.

- Automatic upgrades within [maintenance windows](https://docs.cloud.google.com/composer/docs/composer-3/specify-maintenance-windows.md.txt) might
  still occur.

- It's not possible to [update](https://docs.cloud.google.com/composer/docs/composer-3/update-environments.md.txt) or [upgrade](https://docs.cloud.google.com/composer/docs/composer-3/upgrade-environments.md.txt) a
  hibernated environment.

## Before you begin

- Make sure that your environment is [created in the development mode](https://docs.cloud.google.com/composer/docs/composer-3/create-environments.md.txt#development-mode). It's not possible to switch an existing environment to the development mode.
- Your Google Account must have a role that [can trigger environment update operations](https://docs.cloud.google.com/composer/docs/composer-3/access-control.md.txt#user-account).

## Hibernate a development mode environment

### Console

To hibernate an environment:

1. In Google Cloud console, go to the **Environments** page.

   [Go to Environments](https://console.cloud.google.com/composer/environments)
2. In the list of environments, click the name of your environment.
   The **Environment details** page opens.

3. Click **Hibernate**.

4. Wait until the environment is hibernated.

### gcloud

The `gcloud beta composer environments hibernate` command hibernates
your environment:

```bash
gcloud beta composer environments hibernate \
  ENVIRONMENT_NAME \
  --location LOCATION
```

Replace:

- `ENVIRONMENT_NAME` with the name of the environment.
- `LOCATION` with the region where the environment is located.

Example:

```bash
gcloud beta composer environments hibernate \
  example-environment \
  --location us-central1
```

### API

Construct an
[`environments.hibernate`](https://docs.cloud.google.com/composer/docs/reference/rest/v1beta1/projects.locations.environments/hibernate)
API request:

Example:

```json
// POST https://composer.googleapis.com/v1beta1/projects/example-project/
// locations/us-central1/environments/example-environment:hibernate
```

## Resume a development mode environment

### Console

To resume a hibernated environment:

1. In Google Cloud console, go to the **Environments** page.

   [Go to Environments](https://console.cloud.google.com/composer/environments)
2. In the list of environments, click the name of your environment.
   The **Environment details** page opens.

3. Click **Resume**.

4. Wait until the environment is resumed.

### gcloud

The `gcloud beta composer environments resume` command resumes your
environment:

```bash
gcloud beta composer environments resume \
  ENVIRONMENT_NAME \
  --location LOCATION
```

Replace:

- `ENVIRONMENT_NAME` with the name of the environment.
- `LOCATION` with the region where the environment is located.

Example:

```bash
gcloud beta composer environments resume \
  example-environment \
  --location us-central1
```

### API

Construct an
[`environments.resume`](https://docs.cloud.google.com/composer/docs/reference/rest/v1beta1/projects.locations.environments/resume)
API request:

Example:

```json
// POST https://composer.googleapis.com/v1beta1/projects/example-project/
// locations/us-central1/environments/example-environment:resume
```

## What's next

- [Create an environment in development mode](https://docs.cloud.google.com/composer/docs/composer-3/create-environments.md.txt#development-mode)