*Maintenance policies* allow you to control when
[automated maintenance events](https://docs.cloud.google.com/managed-lustre/docs/maintenance.md.txt)
occur on your Google Cloud Managed Lustre instances. You can configure a maintenance
policy for each instance to define preferred weekly windows for updates and
periods where maintenance should be excluded. If no maintenance policy is
configured on an instance, automated maintenance can occur at any time.

If a scheduled maintenance event conflicts with your workload needs, you can
also [reschedule the maintenance event](https://docs.cloud.google.com/managed-lustre/docs/maintenance-policies.md.txt#reschedule).

## About maintenance policies

You can configure a maintenance policy on each Managed Lustre
instance. A maintenance policy includes the following:

- **Weekly maintenance window**: A recurring one-hour window during the week when it is acceptable for Managed Lustre to start a maintenance event.
- **Maintenance exclusion window**: A period during which Managed Lustre is not allowed to start a maintenance event. You can define one exclusion window per instance, with a maximum duration of two weeks. An exclusion window can recur annually.

An exclusion window overrides your weekly maintenance window. Google Cloud does
not perform automated maintenance during an exclusion window, and will only
schedule updates during a weekly maintenance window outside the exclusion
period. If an exclusion window extends past the release cycle, Google Cloud
skips that update, and the instance is updated during a future maintenance
release cycle. You can still apply available updates at any time using
[self-service maintenance](https://docs.cloud.google.com/managed-lustre/docs/self-service-maintenance.md.txt).

## Configure a maintenance window

A maintenance window requires a day of the week and a UTC start time for the
one-hour window.

### Google Cloud console

To configure a maintenance window when creating an instance, see
[Create an instance](https://docs.cloud.google.com/managed-lustre/docs/create-instance.md.txt).

### gcloud

Create an instance with a maintenance window by specifying the
`--maintenance-policy-weekly-windows` flag:

```bash
gcloud lustre instances create INSTANCE_ID \
  --per-unit-storage-throughput=PER_UNIT_STORAGE_THROUGHPUT \
  --capacity-gib=CAPACITY_GIB \
  --filesystem=FS_NAME \
  --location=LOCATION \
  --network=NETWORK_PATH \
  --maintenance-policy-weekly-windows='dayOfWeek=DAY,startTime=START_TIME'
```

Replace the following:

- <var translate="no">INSTANCE_ID</var>: The ID of your Managed Lustre instance.
- <var translate="no">PER_UNIT_STORAGE_THROUGHPUT</var> is the [performance tier](https://docs.cloud.google.com/managed-lustre/docs/performance-tiers.md.txt) in MBps per TiB. Valid values are `0`, `125`, `250`, `500`, and `1000`. To specify the [Dynamic tier](https://docs.cloud.google.com/managed-lustre/docs/performance-tiers.md.txt#dynamic_tier), set this to `0` and include the `--dynamic-tier-options-mode=DEFAULT_CACHE` flag.
- <var translate="no">CAPACITY_GIB</var>: The capacity of your instance in GiB.
- <var translate="no">FS_NAME</var>: The name of your file system.
- <var translate="no">LOCATION</var>: The location of your Managed Lustre instance.
- <var translate="no">NETWORK_PATH</var>: The full path of the VPC network to which the instance belongs, in the format `projects/PROJECT_ID/global/networks/NETWORK`. See [Configure a VPC network](https://docs.cloud.google.com/managed-lustre/docs/vpc.md.txt).
- <var translate="no">DAY</var>: The day of the week for the maintenance window, such as `TUESDAY`.
- <var translate="no">START_TIME</var>: The UTC start time of the maintenance window in dictionary format, such as `{hours=1,minutes=0}`, including the curly braces.

For more details about creating an instance,
see
[Create a Managed Lustre instance](https://docs.cloud.google.com/managed-lustre/docs/create-instance.md.txt).

### REST

To specify a maintenance window when creating an instance using the REST API,
include the `maintenancePolicy` object in the request body:

```json
{
  "maintenancePolicy": {
    "weeklyMaintenanceWindows": [
      {
        "dayOfWeek": "DAY",
        "startTime": {
          "hours": HOURS,
          "minutes": MINUTES
        }
      }
    ]
  }
}
```

Where:

- <var translate="no">DAY</var> is the day of the week for the maintenance window, such as `TUESDAY`.
- <var translate="no">HOURS</var> is the hour of the day for the maintenance window start time, such as `1`.
- <var translate="no">MINUTES</var> is the minute of the hour for the maintenance window start time, such as `0`.

See the [`instances.create`](https://docs.cloud.google.com/managed-lustre/docs/reference/rest/v1/projects.locations.instances/create.md.txt) API reference for more details.

## Configure an exclusion window

To prevent maintenance from occurring during certain periods, you can define
a maintenance exclusion window up to two weeks in duration. To create
an annually-recurring exclusion window, omit the year from the start and
end dates.

You can combine a weekly maintenance window and an exclusion window in the same
policy.

### Google Cloud console

To configure an exclusion window when creating an instance, see
[Create an instance](https://docs.cloud.google.com/managed-lustre/docs/create-instance.md.txt).

### gcloud

Create an instance with an exclusion window by specifying the
`--maintenance-policy-exclusion-window` flag:

```bash
gcloud lustre instances create INSTANCE_ID \
  --per-unit-storage-throughput=PER_UNIT_STORAGE_THROUGHPUT \
  --capacity-gib=CAPACITY_GIB \
  --filesystem=FS_NAME \
  --location=LOCATION \
  --network=NETWORK_PATH \
  --maintenance-policy-exclusion-window='startDate=START_DATE,endDate=END_DATE,time=TIME'
```

Replace the following:

- <var translate="no">INSTANCE_ID</var>: The ID of your Managed Lustre instance.
- <var translate="no">PER_UNIT_STORAGE_THROUGHPUT</var> is the [performance tier](https://docs.cloud.google.com/managed-lustre/docs/performance-tiers.md.txt) in MBps per TiB. Valid values are `0`, `125`, `250`, `500`, and `1000`. To specify the [Dynamic tier](https://docs.cloud.google.com/managed-lustre/docs/performance-tiers.md.txt#dynamic_tier), set this to `0` and include the `--dynamic-tier-options-mode=DEFAULT_CACHE` flag.
- <var translate="no">CAPACITY_GIB</var>: The capacity of your instance in GiB.
- <var translate="no">FS_NAME</var>: The name of your file system.
- <var translate="no">LOCATION</var>: The location of your Managed Lustre instance.
- <var translate="no">NETWORK_PATH</var>: The full path of the VPC network to which the instance belongs, in the format `projects/PROJECT_ID/global/networks/NETWORK`. See [Configure a VPC network](https://docs.cloud.google.com/managed-lustre/docs/vpc.md.txt).
- <var translate="no">START_DATE</var>: The start date of the maintenance exclusion window in dictionary format, such as `{day=8,month=6,year=2026}`, including the curly braces. To recur annually, omit the `year` key.
- <var translate="no">END_DATE</var>: The end date of the maintenance exclusion window in dictionary format, such as `{day=8,month=6,year=2026}`, including the curly braces. To recur annually, omit the `year` key.
- <var translate="no">TIME</var>: The UTC start and end time of the exclusion window in dictionary format, such as `{hours=1,minutes=0}`, including the curly braces.

### REST

To specify an exclusion window when creating an instance using the REST API,
include the `maintenancePolicy` object in the request body:

```json
{
  "maintenancePolicy": {
    "maintenanceExclusionWindow": [
      {
        "startDate": {
          "day": START_DAY,
          "month": START_MONTH,
          "year": START_YEAR
        },
        "endDate": {
          "day": END_DAY,
          "month": END_MONTH,
          "year": END_YEAR
        },
        "time": {
          "hours": HOURS,
          "minutes": MINUTES
        }
      }
    ]
  }
}
```

Where:

- <var translate="no">START_YEAR</var> is the year of the exclusion window start date, such as `2026`. Omit this field and `END_YEAR` to create an annually-recurring window.
- <var translate="no">START_MONTH</var> is the month of the exclusion window start date, such as `12`.
- <var translate="no">START_DAY</var> is the day of the exclusion window start date, such as `24`.
- <var translate="no">END_YEAR</var> is the year of the exclusion window end date, such as `2027`. Omit this field and `START_YEAR` to create an annually-recurring window.
- <var translate="no">END_MONTH</var> is the month of the exclusion window end date, such as `1`.
- <var translate="no">END_DAY</var> is the day of the exclusion window end date, such as `7`.
- <var translate="no">HOURS</var> is the hour of the day for the exclusion window time, such as `0`.
- <var translate="no">MINUTES</var> is the minute of the hour for the exclusion window time, such as `0`.

See the [`instances.create`](https://docs.cloud.google.com/managed-lustre/docs/reference/rest/v1/projects.locations.instances/create.md.txt) API reference for more details.

## Update a maintenance policy

To add or modify the maintenance policy for an existing instance:

### Google Cloud console

To update the maintenance policy for an instance, see
[Manage instances](https://docs.cloud.google.com/managed-lustre/docs/instances.md.txt#update_an_instance).

### gcloud

The following `gcloud` example updates the maintenance policy for an instance:

```bash
gcloud lustre instances update INSTANCE_ID \
--location=LOCATION \
--maintenance-policy-weekly-windows='dayOfWeek=DAY,startTime=START_TIME'
```

Replace the following:

- <var translate="no">INSTANCE_ID</var>: The ID of your Managed Lustre instance.
- <var translate="no">LOCATION</var>: The location of your Managed Lustre instance.
- <var translate="no">DAY</var>: The day of the week for the maintenance window, such as `TUESDAY`.
- <var translate="no">START_TIME</var>: The UTC start time of the maintenance window in dictionary format, such as `{hours=1,minutes=0}`, including the curly braces.

### REST

To update a maintenance policy using the REST API, send a `PATCH` request to
the instance endpoint:

```json
PATCH https://lustre.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/instances/INSTANCE_ID?updateMask=maintenancePolicy
Authorization: Bearer ACCESS_TOKEN

{
  "maintenancePolicy": {
    "weeklyMaintenanceWindows": [
      {
        "dayOfWeek": "DAY",
        "startTime": {
          "hours": HOURS,
          "minutes": MINUTES
        }
      }
    ]
  }
}
```

Where:

- <var translate="no">PROJECT_ID</var> is your Google Cloud project ID.
- <var translate="no">LOCATION</var> is the zone in which the instance resides.
- <var translate="no">INSTANCE_ID</var> is the ID of the Managed Lustre instance.
- <var translate="no">DAY</var> is the day of the week for the maintenance window, such as `TUESDAY`.
- <var translate="no">HOURS</var> is the hour of the day for the maintenance window start time, such as `3`.
- <var translate="no">MINUTES</var> is the minute of the hour for the maintenance window start time, such as `45`.

See the [`instances.patch`](https://docs.cloud.google.com/managed-lustre/docs/reference/rest/v1/projects.locations.instances/patch.md.txt) API reference for more details.

## Remove a maintenance policy

To remove a maintenance policy from an instance, clear all weekly maintenance
windows and exclusion windows from the policy.

### Google Cloud console

To remove a maintenance policy from an instance, edit the instance and clear
the maintenance policy fields. See
[Manage instances](https://docs.cloud.google.com/managed-lustre/docs/instances.md.txt#update_an_instance).

### gcloud

Use the `gcloud lustre instances update` command with the
`--clear-maintenance-policy-weekly-windows` and
`--clear-maintenance-policy-exclusion-window` flags:

```bash
gcloud lustre instances update INSTANCE_ID \
--location=LOCATION \
--clear-maintenance-policy-weekly-windows \
--clear-maintenance-policy-exclusion-window
```

Replace the following:

- <var translate="no">INSTANCE_ID</var>: The ID of your Managed Lustre instance.
- <var translate="no">LOCATION</var>: The location of your Managed Lustre instance.

### REST

To remove a maintenance policy using the REST API, send a `PATCH` request to
the instance endpoint with an empty `maintenancePolicy` object and the
`updateMask` query parameter set to `maintenancePolicy`:

```json
PATCH https://lustre.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/instances/INSTANCE_ID?updateMask=maintenancePolicy
Authorization: Bearer ACCESS_TOKEN

{
  "maintenancePolicy": {}
}
```

Where:

- <var translate="no">PROJECT_ID</var> is your Google Cloud project ID.
- <var translate="no">LOCATION</var> is the zone in which the instance resides.
- <var translate="no">INSTANCE_ID</var> is the ID of the Managed Lustre instance.

See the [`instances.patch`](https://docs.cloud.google.com/managed-lustre/docs/reference/rest/v1/projects.locations.instances/patch.md.txt) API reference for more details.

## Reschedule maintenance

If a scheduled maintenance event conflicts with your needs, you can reschedule
it. When rescheduling, you have the following options:

- **Immediately**: Reschedule the maintenance event to start as soon as possible. This option ignores any maintenance windows and exclusion windows that are configured on the instance.
- **Next available window**: Reschedule the maintenance event to the next available maintenance window. This typically shifts the update by one week.
- **By date**: Reschedule the maintenance event to a specific date and time. You can delay maintenance by a maximum of 28 days from the originally scheduled time. This option ignores any maintenance windows and exclusion windows that are configured on the instance.

To reschedule maintenance:

### gcloud

To start the maintenance event as soon as possible:

```bash
gcloud lustre instances reschedule-maintenance INSTANCE_ID \
--location=LOCATION \
--reschedule-type=immediately
```

To reschedule maintenance to the next available window:

```bash
gcloud lustre instances reschedule-maintenance INSTANCE_ID \
--location=LOCATION \
--reschedule-type=next-available-window
```

To reschedule maintenance to a specific time:

```bash
gcloud lustre instances reschedule-maintenance INSTANCE_ID \
--location=LOCATION \
--reschedule-type=by-time \
--reschedule-schedule-time=TIMESTAMP
```

Replace the following:

- <var translate="no">INSTANCE_ID</var>: The ID of your Managed Lustre instance.
- <var translate="no">LOCATION</var>: The location of your Managed Lustre instance.
- <var translate="no">TIMESTAMP</var>: The start time in [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339) format (for example, `2026-04-30T10:00:00Z`). This must be no later than 28 days from the originally scheduled time.

### REST

To start the maintenance event as soon as possible:

```json
POST https://lustre.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/instances/INSTANCE_ID:rescheduleMaintenance
Authorization: Bearer ACCESS_TOKEN

{
  "reschedule": {
    "rescheduleType": "IMMEDIATELY"
  }
}
```

To reschedule maintenance to the next available window:

```json
POST https://lustre.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/instances/INSTANCE_ID:rescheduleMaintenance
Authorization: Bearer ACCESS_TOKEN

{
  "reschedule": {
    "rescheduleType": "NEXT_AVAILABLE_WINDOW"
  }
}
```

To reschedule maintenance to a specific time:

```json
POST https://lustre.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/instances/INSTANCE_ID:rescheduleMaintenance
Authorization: Bearer ACCESS_TOKEN

{
  "reschedule": {
    "rescheduleType": "BY_TIME",
    "scheduleTime": "TIMESTAMP"
  }
}
```

Where:

- <var translate="no">PROJECT_ID</var> is your Google Cloud project ID.
- <var translate="no">LOCATION</var> is the zone in which the instance resides.
- <var translate="no">INSTANCE_ID</var> is the ID of the Managed Lustre instance.
- <var translate="no">TIMESTAMP</var> is the start time in [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339) format, such as `2026-04-30T10:00:00Z`. This must be no later than 28 days from the originally scheduled time.

See the
[`instances.rescheduleMaintenance`](https://docs.cloud.google.com/managed-lustre/docs/reference/rest/v1/projects.locations.instances/rescheduleMaintenance.md.txt)
API reference for more details.