To make basic configuration changes to a running cluster, it is recommended to
edit and redeploy the blueprint. This method of reconfiguring a live cluster
must only be used for the following cases:

- To add or remove a partition from the cluster
- To resize an existing partition

## Set up environment to allow for reconfiguration

To set up the environment to allow for reconfiguration, complete the following steps:

1. Set top level variables to allow for cluster reconfiguration. Placing
   these settings in the `vars` block ensures that they are applied to any
   module that accepts them as inputs.

   ```
   # Slurm v6
   vars:
     ...
     enable_cleanup_compute: true
   ```
2. To use the settings in the previous step, install local python dependencies.
   Python dependencies must be installed on the deployment machine where the
   [`gcluster` command](https://docs.cloud.google.com/cluster-toolkit/docs/reference/gcluster) is run from.
   For installation instructions, review the Slurm v6
   [`schedmd-slurm-gcp-v6-controller`
   documentation](https://github.com/GoogleCloudPlatform/cluster-toolkit/blob/main/community/modules/scheduler/schedmd-slurm-gcp-v6-controller/README.md#description).

## Reconfigure partitions on running cluster

To reconfigure a running cluster, complete the following steps:

> [!WARNING]
> **Warning:** Take caution when performing this task, as manual changes to the cluster might be overwritten by redeploying the blueprint.

1. To enable cluster reconfiguration, ensure that you [Set up environment to allow for reconfiguration](https://docs.cloud.google.com/cluster-toolkit/docs/slurm/reconfigure-cluster#setup-environment).
2. Ensure that redeployment happens with the same version of `gcluster` as the
   original deployment. Graceful redeployment across versions of the
   Cluster Toolkit isn't assured.

   You can check the version of `gcluster` by using the `gcluster --version` command.
   Also, `gcluster` prints a warning if you are using a different version on the
   redeploy.
3. Redeploy the blueprint as follows:

   1. Edit the blueprint file. For example, you can increase the `node_count_static` on a node set.
   2. Recreate the deployment by running the [`gcluster create`
      command](https://docs.cloud.google.com/cluster-toolkit/docs/reference/gcluster-create). The `-w` flag
      is required for the previous deployment to be overwritten.

      ```
      gcluster create BLUEPRINT_NAME -w
      ```
   3. Redeploy the deployment by running the [`gcluster deploy`
      command](https://docs.cloud.google.com/cluster-toolkit/docs/reference/gcluster-deploy):

      ```
      gcluster deploy DEPLOYMENT_FOLDER_NAME
      ```

      Carefully evaluate the terraform plan to make sure that no
      unexpected resources are replaced or deleted.

## What's next

- Learn how to [Manage static compute node](https://docs.cloud.google.com/cluster-toolkit/docs/slurm/manage-static-nodes).