Managing Automatic Snapshot Creation

Snapshots are automatically created at a specified time each day according to the rules you create. You can enable or disable the automatic snapshot creation function and set the automatic snapshot creation policy.

Prerequisites

To use the function of creating or restoring snapshots, the account or IAM user logging in to the CSS management console must have both of the following permissions:

  • Tenant Administrator for project OBS in region Global service

  • CSS Administrator in the current region

Precautions

  • When creating a backup for the first time, you are advised to back up data of all indexes.

  • Cluster snapshots will increase the CPU usage and disk I/O. You are advised to take cluster snapshots during off-peak hours.

  • Before creating a snapshot, you need to perform basic configurations, including configuring the OBS bucket for storing snapshots and IAM agency used for security authentication.

  • If there are available snapshots in the snapshot list when you configure the OBS bucket for storing cluster snapshots, you cannot change the bucket for snapshots that are created later. Exercise caution when you configure the OBS bucket.

  • If snapshots have been stored in the OBS bucket, the OBS bucket cannot be changed. You can disable the snapshot function, enable the snapshot function, and specify a new OBS bucket. After you disable the snapshot function, you cannot use previously created snapshots to restore the cluster.

  • If a cluster is in the Unavailable status, you can use the cluster snapshot function only to restore clusters and view existing snapshot information.

  • During backup and restoration of a cluster, you can perform only certain operations, including scaling out, accessing Kibana, viewing metric, and deleting other snapshots of clusters. However, you cannot perform the following operations: restarting or deleting the cluster, deleting a snapshot that is in the Creating or Restoring status, and creating or restoring another snapshot. If a snapshot is being created or restored for a cluster, any automatic snapshot creation task initiated for the cluster will be canceled.

  • The first snapshot of a cluster is a full snapshot, and subsequent snapshots are incremental snapshots. CSS snapshot files depend on each other.

Managing Automatic Snapshot Creation

  1. Log in to the CSS management console.

  2. In the navigation pane, choose Clusters > OpenSearch.

  3. On the Clusters page that is displayed, click the name of the target cluster. In the navigation pane on the left, choose Cluster Snapshots.

  4. On the displayed Cluster Snapshots page, click the icon to the right of Cluster Snapshot to enable the cluster snapshot function.

  5. Enable the cluster snapshot function. OBS buckets and IAM agencies are automatically created by CSS to store snapshots. The automatically created OBS bucket and IAM agency are displayed on the page. You can also click image1 on the right of Basic Configuration to edit the configuration. To ensure the security of snapshot data, you can select a key to encrypt the snapshot.

    Table 1 Cluster snapshot parameter

    Parameter

    Description

    OBS bucket

    Select an OBS bucket for storing snapshots from the drop-down list box. You can also click Create Bucket on the right to create an OBS bucket. For details, see Creating a Bucket.

    The created or existing OBS bucket must meet the following requirements:

    • Storage Class is Standard or Warm.

    • Region must be the same as that of the created cluster.

    Backup Path

    Storage path of the snapshot in the OBS bucket.

    The backup path configuration rules are as follows:

    • The backup path cannot contain the following characters: \:*?"<>|

    • The backup path cannot start with a slash (/).

    • The backup path cannot start or end with a period (.).

    • The backup path cannot contain more than 1,023 characters.

    IAM Agency

    IAM agency authorized by the current account for CSS to access or maintain data stored in OBS You can also click Create IAM Agency on the right to create an IAM agency. For details, see Creating an Agency.

    The created or existing IAM agency must meet the following requirements:

    • Agency Type must be Cloud service.

    • Set Cloud Service to CSS.

    • The agency must have the Tenant Administrator permission for the OBS(S3) project in OBS(S3).

    Snapshot Encryption

    Whether to enable the snapshot encryption function. Enabling the snapshot encryption function ensures the security of your snapshot data.

    After the snapshot encryption function is enabled, select a key from the Key Name drop-down list. If no key is available, click Create/View Key to go to the KMS management console and create or modify a key. For details, see Creating a CMK.

    • You cannot use default master keys whose aliases end with /default in KMS to encrypt snapshots.

    • If a snapshot has been stored in the OBS bucket, you cannot modify the parameters used for encrypting the snapshot.

    • If the key used for encryption is in the Pending deletion or disable status, you cannot perform backup and restoration operations on the cluster. Specifically, you cannot create new snapshots for the cluster, or use existing snapshots to restore clusters. In this case, switch to the KMS management console and change the status of the target key to enable so that backup and restore operations are allowed on the cluster.

    • If you delete the key used for encryption, you cannot perform backup and restore operations on the cluster. In addition, you cannot restore the deleted key. Therefore, exercise caution when deleting a key. If the key is deleted or is in the Pending deletion or disable state, automatic snapshot creation is allowed based on the configured snapshot policy. However, all automatic snapshot creation tasks will fail, and the failed tasks are displayed in the failed task list in the Failed Tasks dialog box. In such scenario, you are advised to disable the automatic snapshot creation function.

    **Figure 1** Editing basic configurations

    Figure 1 Editing basic configurations

  6. Enable the automatic snapshot creation function. The Configure Automatic Snapshot Creation dialog box is displayed. If the automatic snapshot creation function is enabled, you can click image2 on the right of Automatic Snapshot Creation to modify the snapshot policy.

    • Snapshot Name Prefix: Enter a maximum of 32 characters starting with a lowercase letter. Only lowercase letters, digits, hyphens (-), and underscores (_) are allowed. A snapshot name consists of a snapshot name prefix and a timestamp, for example, snapshot-2018022405925.

    • Time Zone: indicates the time zone for the backup time. Specify backup start time based on the time zone.

    • Index: Enter an index name. You can select an index for backup. Use commas (,) to separate multiple indexes. Uppercase letters, spaces, and the following special characters are not allowed: "\<|>/? If you do not specify this parameter, data of all indexes in the cluster is backed up by default. You can use the asterisk (*) to back up data of certain indexes. For example, if you enter index*, then data of indices with the name prefix of index will be backed up.

      Run the GET /_cat/indices command in Kibana to query the names of all indexes in the cluster.

    • Backup Started: indicates the time when the backup starts automatically every day. You can specify this parameter only in hours and not minutes, for example, 00:00 or 01:00. The value ranges from 00:00 to 23:00. Select the backup time from the drop-down list box.

    • Retention Period (days): indicates the duration when snapshots are retained in the OBS bucket, in days. The value ranges from 1 to 90. You can specify this parameter as required. The system automatically deletes snapshots that are retained over the specified retention period on the half hour. For example, if you set the snapshot policy as shown in Figure 2, the system will automatically delete in 35 days at 00:30 the automated snapshots that were created 35 days earlier at 00:00.

    **Figure 2** Automatic snapshot creation

    Figure 2 Automatic snapshot creation

  7. Click OK to save the snapshot policy.

    Snapshots that are automatically created according to the snapshot policy are displayed in the snapshot list, along with manually created snapshots. You can distinguish them by the Snapshot Type setting. In the upper right corner of the snapshot list, enter the keyword of the snapshot name or snapshot ID to search for the desired snapshots.

    **Figure 3** Automatic snapshot creation

    Figure 3 Automatic snapshot creation

  8. (Optional) Disable the automatic snapshot creation function.

    After you disable the automatic snapshot creation function, the system stops automatic creation of snapshots. If the system is creating a snapshot based on the automatic snapshot creation policy and the snapshot is not yet displayed in the snapshot list, you cannot disable the automatic snapshot creation function. In this case, if you click the button next to Automatic Snapshot Creation, a message is displayed, indicating that you cannot disable the function. You are advised to disable the function after the system completes automatic creation of the snapshot, and the created snapshot is displayed in the snapshot list.

    When disabling the automatic snapshot creation function, you can choose whether to delete the snapshots that have been automatically created by selecting Delete automated snapshots in the displayed dialog box. By default, automatically created snapshots are not deleted.

    • If you do not select Delete automated snapshots, automatically created snapshots are not deleted when you disable the automatic snapshot creation function. You can manually delete them later. For details, see Deleting a Snapshot. If you retain the automatically created snapshots and enable automatic snapshot creation again, then all snapshots whose Snapshot Type is Automated can only be automatically deleted by the system. Specifically, the system automatically deletes snapshots based on the snapshot policy configured when you enable the automatic snapshot creation function again. For example, if you set Retention Period (days) to 10, the system will automatically delete the snapshots that have been retained for more than 10 days.

    • If you select Delete automated snapshots, all snapshots with Snapshot Type set to Automated in the snapshot list will be deleted when you disable the automatic snapshot creation function.