Creating Snapshots

Last updated: 2020-03-04 17:39:27


Operation Scenarios

Through HDD cloud disk, you can create a snapshot to save HDD cloud disk data at a specified time. Tencent Cloud creates snapshots incrementally, that is, only the data that has been newly changed compared with the previous snapshot is created, so the snapshot can be created in a faster time with little change in the amount of data. Although snapshots are created incrementally, deleting snapshots will not affect your use of any snapshot data, and undeleted snapshots can bring HDD cloud disk and Resume to the snapshot state.
You can create a snapshot in any state of HDD cloud disk, but the snapshot can only save the data that point in time has finished writing. If the application or process is writing data, the data may not be saved to the snapshot created by point in time. Depending on the actual business situation, you can choose to temporarily stop all writes and create a snapshot in time, or first remove the HDD cloud disk from Cloud Virtual Machine Unmount Create a snapshot and then re-create it Mount To get a complete snapshot of the data



The snapshot only retains the data that has been written on the hard disk at that time, and does not retain the data that has not been written to the hard disk in memory at that time. It is strongly recommended that you shut down or ensure that memory data has been written to the hard disk and pause reading and writing to the hard disk before creating the snapshot, and do so in the following two ways:

Database Level

For database type business, it is recommended to make all table locks in the database read-only first to prevent new data from being written when creating a snapshot, so that new data cannot be captured by the snapshot. This article takes mysql as an example to do the following:

  1. Execute FLUSH TABLES WITH READ LOCK Command closes all open tables and locks all tables in all databases using a global read lock. as shown below:
  2. Create a snapshot of HDD cloud disk.
  3. Execute UNLOCK TABLES to unlock, as shown below:

System Level

From the system point of view, the data is usually stored in memory buffer in the process of processing, and then written into HDD cloud disk when appropriate, in order to improve the efficiency of the system. Therefore, when creating a snapshot, the data that has not been written to HDD cloud disk in buffer will not be written to the snapshot and Resume from the snapshot, which has an impact on data consistency.
Execute sync Command to force the data in the file system memory buffer to be written to HDD cloud disk immediately, and avoid writing new data before creating the snapshot. No error message is returned after executing the command, that is, the data in the cache has been written to HDD cloud disk. as shown below:


Creating a Snapshot in Console

  1. Log in to the CBS console .
  2. Click Create Snapshot to the right of the line where the target HDD cloud disk is located.
  3. In the pop-up Create Snapshot dialog box, enter a snapshot name and click OK.

Creating a Snapshot with API

You can use the CreateSnapshots API to create a snapshot. For more information, see Creating snapshots .