All Products
Search
Document Center

CloudOps Orchestration Service:Use a snapshot to create a temporary disk for data restoration

Last Updated:Jun 20, 2024

Background information

If you want to restore data from a snapshot to an Elastic Compute Service (ECS) instance, you can create a disk from the snapshot. For more information, see Create a disk from a snapshot. For Windows instances, you can use a disk to restore data without the need to modify the UUID and related configurations of the disk. For Linux instances, you need to perform the following steps to restore data:

  1. Create a disk from a snapshot.

  2. Attach the disk to an ECS instance.

  3. Log on to the ECS instance, change the UUID of the disk, and then mount a partition.

  4. Restore data to another disk as required.

  5. Detach and release the disk that is created from the snapshot.

Solution

CloudOps Orchestration Service (OOS) provides a public template that you can use to restore data from snapshots to Linux instances with a few clicks. You need to only select a source snapshot that contains the data to be restored and a destination ECS instance to which the data is restored. OOS automatically creates a temporary disk and attaches the disk to the ECS instance. Then, you can restore the data based on your business requirements. After the restoration is complete, you can return to the OOS console and resume the execution. OOS automatically detaches and releases the temporary disk. If you use the public template provided by OOS to restore data, you do not need to manually create, attach, detach, or release disks. You also do not need to modify the UUIDs of disks, mount partitions, or modify configuration files. You need to only focus on the data to be restored.

Procedure

  1. Log on to the OOS console.

  2. In the left-side navigation pane, choose Automated Task > Public Template.

  3. Find the ACS-ECS-RestoreDataWithSnapshot template and click Create Execution.

  4. In the Create Task wizard, configure the required parameters in the Basic Information step and click Next Step: Parameter Settings.

  5. In the Parameter Settings step, configure the parameters.

  • RegionId: the region in which the source snapshot and destination ECS instance reside.

  • SnapshotId: the ID of the source snapshot that contains the data to be restored.

  • InstanceId: the ID of the destination ECS instance to which the data is restored.

  • RetainTempDisk: specifies whether to retain the temporary disk. If you turn on RetainTempDisk, OOS retains the disk. The disk is billed in pay-as-you-go mode. If you turn off RetainTempDisk, OOS automatically detaches and releases the disk after the data is restored.

  • WorkingDir: the directory in which OOS executes the script.

  • OOSAssumeRole: the RAM role that is assumed by OOS. This parameter is optional. By default, OOS uses the permissions granted to the current account. If a RAM role is specified, OOS assumes this role to perform O&M tasks.

  1. Click Next Step: OK, and then click Create.

  2. On the Task Execution Management page, click the execution ID to view the details of the created execution. OOS creates and attaches a temporary disk to the ECS instance and waits for you to manually restore the data. The execution is suspended. You can log on to the ECS instance to restore the data from the temporary disk to another disk.

  3. After you restore the data, go back to the execution details page, and click Review Task. In the dialog box that appears, set the Review Task parameter to Approve Task and click OK. OOS then detaches and releases the temporary disk.

  4. To obtain more information about the execution after it is complete, click Details in the Actions column. On the execution details page, view the logs on the Log tab in the Execution Steps and Results section.