This page provides instructions on how to complete the following tasks:
- Create an instance with maintenance windows
- Set a preferred window for maintenance
- Turn on maintenance notifications
- Find scheduled maintenance
- Reschedule maintenance
- Remove a maintenance policy from an instance
For an overview of maintenance updates and maintenance windows, see About maintenance.
Create an instance with maintenance windows
gcloud
To create a Memorystore for Valkey instance with maintenance windows, use the
gcloud memorystore instances create
command:
gcloud memorystore instances create INSTANCE_ID \ --project=PROJECT_ID \ --location=REGION_ID \ --psc-auto-connections=network=projects/PROJECT_ID/global/networks/NETWORK_ID \ --shard-count=SHARD_COUNT \ --maintenance-policy-weekly-window=day=DAY,startTime=hours=HOUR
Replace the following:
INSTANCE_ID: the ID of the Memorystore for Valkey instance that you're creating. Your instance ID must be 1 to 63 characters and use only lowercase letters, numbers, or hyphens. It must start with a lowercase letter and end with a lowercase letter or number.
PROJECT_ID: the project ID or number of the Google Cloud project where you want to create your instance.
REGION_ID: the region where you want the instance to be located.
NETWORK_ID: the ID of the network that you want to use to create your instance.
SHARD_COUNT: the number of shards in your instance. The shard count determines the total memory capacity for storing instance data. For more information about instance specifications, see Instance and node specification.
DAY: the day that you want maintenance to occur. Acceptable values are
MONDAY
-SUNDAY
.HOUR: the hour of the day (in UTC time) when the maintenance window starts. Acceptable values are
0
-23
.
For example:
gcloud memorystore instances create my-instance \ --project=my-project \ --location=us-central1 \ --psc-auto-connections=network=projects/my-project/global/networks/default \ --shard-count=8 \ --maintenance-policy-weekly-window=day=MONDAY,startTime=hours=9
By default, when you create an instance with maintenance windows,
in-transit encryption is deactivated and the authorized network is default
.
Set a preferred window for maintenance
gcloud
To set a maintenance window for a Memorystore for Valkey instance, use the gcloud memorystore instances update
command:
gcloud memorystore instances update INSTANCE_ID \ --project=PROJECT_ID \ --location=REGION_ID \ --maintenance-policy-weekly-window=day=DAY,startTime=hours=HOUR
Replace the following:
- INSTANCE_ID: the ID of the instance.
- PROJECT_ID: the project ID or number of the Google Cloud project that contains the instance.
- REGION_ID: the region where your instance is located.
- DAY: the day that you want maintenance to occur. Acceptable
values are
MONDAY
-SUNDAY
. - HOUR: the hour of the day (in UTC time) when the maintenance
window starts. Acceptable values are
0
-23
.
Turn on maintenance notifications
To turn on maintenance notifications:
In the Google Cloud console, go to the Communication page.
Click Product Notifications.
From the menu, select your Google Cloud project.
In the row for Memorystore, toggle the email button to ON.
A maintenance notification email uses this title: "Upcoming maintenance for your
Cloud Memorystore instance [your-instance-name]"
. Each email address that
needs to receive notifications must opt in separately.
Maintenance notifications are set at the project level rather than on instances. Memorystore for Valkey sends notifications to the email address associated with your Google Account. You can't configure a custom email alias (for example, a team email alias).
Find scheduled maintenance
If maintenance is scheduled for your Memorystore for Valkey instance, then use the gcloud memorystore instances describe
command to view
the scheduled maintenance.
gcloud
gcloud memorystore instances describe INSTANCE_ID \ --project=PROJECT_ID \ --location=REGION_ID
Replace the following:
- INSTANCE_ID: the ID of the instance
- PROJECT_ID: the project ID or number of the Google Cloud project that contains the instance
- REGION_ID: the region where your instance is located
The output for scheduled maintenance is, as follows:
maintenancePolicy: weeklyMaintenanceWindow: - day: DAY duration: 3600 seconds - startTime hour: HOUR maintenanceSchedule: endTime: 'END_DATE_AND_TIME_STAMP' scheduleDeadlineTime: 'SCHEDULED_DATE_AND_TIME_STAMP' startTime: 'START_DATE_AND_TIME_STAMP'
Where:
maintenancePolicy
shows information about the creation time of your preferred maintenance policy.DAY
is the day of the week that maintenance occurs.HOUR
is the hour (in UTC time) that maintenance begins.
maintenanceSchedule
shows information about the scheduled maintenance for your instance.END_DATE_AND_TIME_STAMP
indicates when a scheduled maintenance update ends for your instance.SCHEDULED_DATE_AND_TIME_STAMP
indicates when a maintenance update is scheduled to be completed for your instance.START_DATE_AND_TIME_STAMP
indicates when a scheduled maintenance update begins for your instance.
Reschedule maintenance
To reschedule maintenance, use the gcloud memorystore instances reschedule-maintenance
command.
gcloud
gcloud memorystore instances reschedule-maintenance INSTANCE_ID \ --project=PROJECT_ID \ --location=REGION_ID \ --reschedule-type=RESCHEDULE_TYPE [--schedule-time=RESCHEDULE_TIME]
Replace the following:
- INSTANCE_ID: the ID of the instance.
- PROJECT_ID: the project ID or number of the Google Cloud project that contains the instance.
- REGION_ID: the region where your instance is located.
RESCHEDULE_TYPE: the type of rescheduled update. Available values are:
IMMEDIATE
: Start the maintenance update immediately.SPECIFIC_TIME
: Designate a specific time for the update. This time must be no more than 14 days from the time of the original maintenance window.
RESCHEDULE_TIME: the date and time when Memorystore for Valkey reschedules the maintenance update.
Remove a maintenance policy from an instance
If you no longer need a maintenance policy for an instance, and you want to use Memorystore for Valkey's default setting for maintenance instead, then
you can remove the policy from the instance. To do so, use the gcloud memorystore instances update
command.
gcloud
gcloud memorystore instances update INSTANCE_ID \ --project=PROJECT_ID \ --location=REGION_ID \ --clear-maintenance-policy-weekly-window
Replace the following:
- INSTANCE_ID: the ID of the instance from which you want to remove the maintenance policy
- PROJECT_ID: the project ID or number of the Google Cloud project that contains the instance
- REGION_ID: the region where your instance is located
What's next
- View the permissions required to manage maintenance windows for your Memorystore for Valkey instance.