All Products
Search
Document Center

Cloud Backup:Back up ECS instances

Last Updated:Oct 29, 2024

Cloud Backup is integrated with the Alibaba Cloud snapshot service to provide agentless backup for Elastic Compute Service (ECS) instances and disks. Cloud Backup can create crash-consistent snapshots for all disks, including system disks and data disks. You can use the snapshots to back up or restore an ECS instance or disk. You can also clone an ECS instance or disk.

Prerequisites

  • Cloud Backup is activated. You are not charged for activating Cloud Backup. You are charged client usage fees when you use Cloud Backup to back up ECS instances. For more information, see Pricing of Cloud Backup.

  • The ECS snapshot service is activated.

  • All disks attached to your ECS instances are enhanced SSDs (ESSDs). This ensures crash consistency of the ECS instances. If some disks are not ESSDs, Cloud Backup enables the crash consistency feature only for specific disks.

Background information

Usage notes

  • If the snapshot service is not activated, Cloud Backup automatically enables the snapshot service when you use the ECS instance backup feature to back up ECS instances for the first time. You are charged for the usage of ECS snapshots. You are charged client usage fees when you use Cloud Backup to back up ECS instances. For more information, see Pricing of Cloud Backup.

    ECS instance backup is a backup orchestration service that is provided by Cloud Backup based on the ECS snapshot capability. The fees for the storage usage of ECS snapshots that are used by this feature are included into the snapshot service bill. If you turn on Replication to Other Region, the fees for the storage usage of ECS snapshots that are replicated to the destination region and the fees for cross-region traffic are also included into the snapshot service bill. For more information, see Snapshots.

  • The first time you create a backup plan or associate a backup plan with a backup policy, Cloud Backup automatically creates a service-linked role to obtain the permissions to access related resources. For more information, see Service-linked roles for Cloud Backup.

  • You cannot use the ECS instance backup feature to back up or restore local disks. For more information, see Local disks.

    If you use local disks to store data, your data may be lost. We recommend that you use the ECS file backup feature to protect your files in local disks and use the database backup feature to protect your databases that are deployed in local disks. For more information, see Back up files from an ECS instance and Database backup.

  • If backup policies are supported in the region where you edit a backup plan, Cloud Backup automatically converts your backup plan to a backup policy. The parameter settings of your backup plan remain unchanged.

  • You can associate only one backup policy with each ECS instance. You do not need to create a backup vault for ECS instance backup. You can configure the backup interval and retention period in a backup policy. For more information about the parameters in a backup policy, see Manage backup policies.

  • To prevent conflicting execution time of snapshots, we recommend that you do not use the ECS instance backup feature and the snapshot service for the same disk at the same time. You can select a backup method based on your business requirements.

Procedure

Note

You can create backup policies only in some regions. To view the regions that support backup policies, click Policy Center in the left-side navigation pane of the Cloud Backup console.

  1. Log on to the Cloud Backup console.

  2. In the left-side navigation pane, choose Backup > ECS Instance Backup.

  3. In the top navigation bar, select a region.

  4. In the upper-left corner of the page, click Add ECS Backup.

  5. In the Add ECS Backup panel, perform the following steps:

    1. Specify the backup objects and click Next.

      Important
      • You must select the ECS instances and disks that you want to back up. Protect All Disks is turned on by default. If you want to protect all disks of an ECS instance, turn on Protect All Disks. In this case, the disks that are later attached to the ECS instance are also protected. If you want to protect only specific disks, turn off Protect All Disks.

      • You can select up to 99 ECS instances at a time.

      • Cloud Backup automatically checks whether the selected ECS instances support snapshot-consistent groups. Cloud Backup automatically creates a snapshot-consistent group for the ECS instances that support snapshot-consistent groups. If an ECS instance does not support snapshot-consistent groups, Cloud Backup ensures only the crash consistency of disks. For more information, see Create a snapshot-consistent group.

    2. Configure the backup settings and click OK.

      You can set the Backup Type parameter to Manual Backup or Associate Backup Policy. The following list describes the corresponding parameters.

      • Manual Backup

        • Only one backup file is created for the selected ECS instances at the current point in time.

        • You must specify the retention period of the backup data, whether to enable application-consistent backup, and whether to enable cross-region replication.

          Parameter

          Description

          Retention Period

          The retention period of the backup data. Unit: days, weeks, months, or years.

          Replication Encryption Configuration

          • Auto Config: Cloud Backup automatically selects an encryption method based on whether the source disk is encrypted.

            • If the source disk is not encrypted, Cloud Backup directly replicates the backup data to the specified destination region.

            • If the source disk is encrypted, Cloud Backup uses the default service customer master key (CMK) to encrypt the backup data, and then replicates the backup data to the specified destination region.

              Note

              Key Management Service (KMS) provides default data encryption capabilities for other Alibaba Cloud services. You can view service keys in the KMS console. For more information, see Overview of integration with KMS.

          • Assign KMS Key: Data is encrypted by using the KMS key of the specified destination region, regardless of whether the source disk is encrypted.

            Important
            • If you enable KMS-based encryption, you cannot modify a KMS key.

            • Before you can use a KMS key to encrypt data, you must create the key in the KMS console. For more information, see Create a CMK.

          Application Consistent Backup

          If you select a single ECS instance, you can turn on Application Consistent Backup to enable the application-consistent backup feature.

          For more information, see Enable the application-consistent backup feature.

          Replication to Other Region

          Turn on Replication to Other Region to enable the cross-region replication feature.

          The backup data is automatically replicated to the Destination Region.

          If an ECS instance is infected with viruses or data is accidentally deleted, you can use the backup data replicated to the destination region to create another ECS instance.

      • Associate Backup Policy

        Important

        If you select a region that supports backup policies, associate a backup policy with the ECS instances that you want to back up. Cloud Backup periodically backs up the ECS instances.

        To view the regions that support backup policies, click Policy Center in the left-side navigation pane of the Cloud Backup console. For more information about how to create a backup policy, see Create a backup policy.

        If you select a region that does not support backup policies, configure a backup plan.

        Parameter

        Description

        Backup Policy

        Select a proper backup policy from the drop-down list.

        Cloud Backup automatically backs up data sources based on the backup policy that you configure. Backup policies help you flexibly manage data sources. A backup policy includes the following settings: backup vault encryption method, backup interval, retention period, cross-region replication policy, and automatic archiving of backup data.

        If the default backup policy does not meet your requirements, you can click Manage Policy to go to the Policy Center page to create or modify a backup policy.

        For more information about the parameters in a backup policy, see Manage backup policies.

        Replication Encryption Configuration

        This parameter is required only if you turn on Replication to Other Region in Backup Policy.

        • Auto Config: Cloud Backup automatically selects an encryption method based on whether the source disk is encrypted.

          • If the source disk is not encrypted, Cloud Backup directly replicates the backup data to the specified destination region.

          • If the source disk is encrypted, Cloud Backup uses the default service CMK to encrypt the backup data, and then replicates the backup data to the specified destination region.

            Note

            KMS provides default data encryption capabilities for other Alibaba Cloud services. You can view service keys in the KMS console. For more information, see Overview of integration with KMS.

        • Assign KMS Key: Data is encrypted by using the KMS key of the specified destination region, regardless of whether the source disk is encrypted.

          Important
          • If you enable KMS-based encryption, you cannot modify a KMS key.

          • Before you can use a KMS key to encrypt data, you must create the key in the KMS console. For more information, see Create a CMK.

        Application Consistent Backup

        If you select a single ECS instance, you can turn on Application Consistent Backup to enable the application-consistent backup feature.

        For more information, see Enable the application-consistent backup feature.

    After you create the backup policy, Cloud Backup runs the first backup job at the start time that you specified and runs the subsequent backup jobs based on the interval that you specified.image

    Backup is successful

    When the backup execution time is reached, Cloud Backup runs a backup job. If Backup Status is Completed, the backup job is completed. You can view the backup points in the backup history.image

    View the total size of ECS snapshots

    • On the ECS Instance Backup page, you can view the total snapshot size of all disks that are backed up by Cloud Backup. The statistics data is not updated in real time. The maximum latency is 24 hours.

      image

    • The value of Instance Backup Capacity indicates the total size of snapshot chains generated for all protected ECS instances. To view the snapshot size of a specific ECS instance or a specific disk, go to the Snapshots tab in the ECS console. For more information, see How do I view snapshot sizes?

Restore an ECS instance

For more information, see Restore an ECS instance.

Retention period of snapshots

  • Snapshots created by using the ECS instance backup feature are displayed on the Snapshots tab in the ECS console. "Cloud Backup" is displayed in the Creation Method column, as shown in the following figure. The retention period displayed on the Snapshots tab is the retention period that you configure in the backup settings. In the following figure, the retention period of the ECS snapshot is 7 days. Due to technical limits, the query result of the DescribeSnapshots API operation indicates that snapshots are permanently retained. Ignore the inaccuracy.

    image

    You can extend the retention period of snapshots. For more information, see Extend the retention period of backup data.

  • When the retention period of a backup point for an ECS instance expires, Cloud Backup automatically deletes the snapshot corresponding to the backup point. Do not call the DeleteSnapshot API operation to delete a snapshot that is created by Cloud Backup. Otherwise, the backup point of the ECS instance cannot be used due to missing snapshot data. If you create a disk or image by using a snapshot that is created by Cloud Backup, Cloud Backup no longer manages the lifecycle of the snapshot. In this case, the snapshot is not automatically deleted based on the retention period. You must call the DeleteSnapshot API operation to delete the snapshot.

  • Snapshots created by using the ECS instance backup feature can be used in snapshot sharing scenarios. When the retention period of shared snapshots expires, the snapshots are automatically deleted. To prevent shared snapshots from becoming invalid due to expiration, pay attention to the retention period displayed in the ECS console or the Cloud Backup console.

Extend the retention period of backup data

If you want to retain existing backup data of an ECS instance for a longer period of time, you can extend the retention period of backup data at a specific backup point. After the retention period of backup data is extended, the corresponding snapshot cannot be deleted before it expires. When the new retention period expires, the snapshot of the ECS instance is automatically deleted.

  • The backup data of an ECS instance includes three dimensions: consistency group, instance, and disk. You can extend the retention period of only the existing backup data of an ECS instance.

  • You can extend the retention period by an integer number of days. The maximum retention period is 65,536 days. The new retention period configured in the Cloud Backup console is synchronized to the Snapshots tab in the ECS console.

  1. On the Backed-up ECS Instances tab, find the ECS instance and click the 加号 icon.

  2. On the Instance Protection tab, click the backup point whose retention period you want to extend and set the expiration time. You can specify a time range or select Never Expire.

    image

  3. Click Save.

After you set the expiration time, you can view the new expiration time in the Expires At field. The new retention period is synchronized to the Snapshots tab in the ECS console.

image

Restore an ECS disk

For more information, see Restore a disk.

Replicate and restore data across regions

Enable the cross-region replication feature

If you enable cross-region replication for a backup plan, backup data is automatically replicated to the specified Destination Region. To modify the destination region of the backup plan, click the link of the backup plan and then click Edit in the Actions column.

image

If an ECS instance is infected with viruses or data is accidentally deleted, you can use the backup data replicated to the destination region to create another ECS instance.

Backup data is replicated to the destination region

On the Jobs tab, Completed is displayed in the Remote Replication Status column, which indicates that your backup data has been replicated to the destination region.

image

Restore an ECS instance for disaster recovery

If the source ECS instance is infected with viruses or data is accidentally deleted, you can create another ECS instance in the destination region, for example, China (Shanghai), to restore the data.

  1. Log on to the Cloud Backup console.

  2. In the left-side navigation pane, choose Backup > ECS Instance Backup.

  3. In the top navigation bar, select a region. Example: China (Shanghai).

  4. On the Backed-up ECS Instances tab, find the ECS instance that you want to restore.

  5. Select an appropriate backup point and click Disaster Recovery.image

  6. In the Disaster Recovery panel, configure the network, security group, and instance type, and click OK to create a pay-as-you-go ECS instance.

    Important

    You are charged for the new ECS instance based on the billing rules of ECS. For more information, see Pay-as-you-go.

    image

    After you create the restore job, you can view the progress on the Jobs tab. After the restore job is completed, you can click the link of the ECS instance to access the ECS instance.image

Troubleshooting

When you create a backup plan to back up ECS instances or when you execute the backup plan, exceptions may occur. You can troubleshoot the exceptions based on the following instructions.

Error message: The policy contains permanent retention rules and cannot be applied to ECS instance backup.

The number of manual snapshots that can be retained on a disk is limited. If permanent retention is enabled in the associated backup policy, an error may occur when you create a snapshot.

We recommend that you change the retention period to the specified duration in the backup policy.

Error message: No destination region is specified.

The backup policy does not specify the destination region for remote replication.

We recommend that you perform the following operations:

  • If you do not need to replicate backups to a destination region, click Edit Policy and turn off Replication to Other Region.

  • If you need to replicate backup data to a destination region, click Edit Policy, specify Destination Region, and then save the policy.

  • If the backup policy does not meet your backup requirements, click Create Backup Policy to create a backup policy and then select the policy.

Error message: This ECS instance has been released.

The ECS instance is released. Cloud Backup no longer runs the backup plan.

We recommend that you perform the following operations:

  • If the ECS instance is released as expected, choose More > Stop Backup to cancel the backup.

    Important

    After the backup is canceled, the ECS instance is removed from the Backed-up ECS Instances tab and all backup plans of the ECS instance are deleted. The backup data generated for the ECS instance is retained.

  • If the ECS instance is released unexpectedly, we recommend that you check whether the ECS instance can be restored by using the ECS instance backup feature of Cloud Backup. For more information, see Restore an ECS instance.

Error message: The backup plan has been suspended.

The backup plan is suspended. Cloud Backup no longer runs the backup plan.

We recommend that you perform the following operations:

  • If the backup plan is suspended as expected, no additional operation is required.

  • If the backup plan is suspended unexpectedly, we recommend that you resume the backup plan by performing the following operation: Choose More > Resume Plan. After the backup plan is resumed, Cloud Backup runs backup jobs based on the backup plan.

Error message: Failed-Failed to synchronize metadata.

When backup data is replicated to a specified destination region, the information about the destination region cannot be synchronized, resulting in a replication failure.

The information about the destination region may fail to be read due to network jitter. We recommend that you retry or change the destination region and then execute the backup plan again.

Related operations

The following table describes the tabs that are provided by the ECS instance backup feature. You can efficiently manage backup jobs on these tabs.

Tab

Description

Operation

Backed-up ECS Instances

Displays the ECS instances that are protected by Cloud Backup.

  • Manual Backup: To perform manual backup, you must configure a backup plan.

  • Auto Backup: To perform automatic backup, you must configure a backup plan.

  • Clone Now: You can clone an ECS instance only if the system disk of the ECS instance is an ESSD. A pay-as-you-go ECS instance is created based on the configurations and data of the ECS instance at the current point in time. Snapshots are created for all disks on the ECS instance and retained for one day. For more information about the billing of snapshots, see Snapshots.

  • Add to Consistency Group: You can add multiple ECS instances whose system disks are ESSDs to a consistency group. Then, you can back up, restore, or clone the ECS instances by group.

    You can create a consistency group or specify an existing consistency group.

  • Run Now: You can immediately execute a backup plan.

  • Modify Plan: If a backup plan no longer meets your business requirements, you can modify the backup plan.

    Important

    If backup policies are supported in the region where you modify a backup plan, you must associate a backup policy with the data sources. We recommend that you create a backup policy before you modify a backup plan. The disk configuration in a historical backup plan is retained. Backups that have been generated are not affected.

  • Delete Plan: If you no longer need to back up data based on a backup plan, you can delete the association between the ECS instance and the backup plan.

  • Resume Plan: You can resume a suspended backup plan.

  • Suspend Plan: If you suspend a backup plan, backup protection is no longer performed.

  • Stop Backup: You can stop protection for an ECS instance.

    Important

    If you stop protection for an ECS instance, the ECS instance is removed from the Backed-up ECS Instances tab and all backup plans of the ECS instance are deleted. The backup data generated for the ECS instance is retained. If you want to delete a backup file of an ECS instance, find the backup point of the backup file in the backup history and then click Delete.

  • Delete Backup Point: You can delete backup points that are created within a specified period of time. You cannot restore data from deleted backup points.

    Important
    • If the disk snapshot corresponding to a backup point has been used to create a disk or a custom image, the snapshot is not deleted and only the backup point for the ECS instance is deleted.

    • If the immutable backup feature is enabled for the backup policy based on which a backup point is generated, the backup point cannot be deleted until it automatically expires.

Jobs

Displays the status of each executed job.

You can cancel the jobs that are being executed.

What to do next

References

  • Cloud Backup provides resource plans for various backup scenarios so that you can enjoy higher discounts and minimize your costs. For more information, see Purchase resource plans.

  • Cloud Backup allows you to back up one or more disks. You can restore the original disks or create new disks at any time. For more information, see Back up disks.

  • Cloud Backup allows you to back up directories and files on ECS instances. You can view and restore data at any time. For more information, see Back up files from an ECS instance.

  • Cloud Backup allows you to migrate directories and files from on-premises servers to the cloud. You can view and restore data at any time. For more information, see Back up on-premises files.

  • For more information about Cloud Backup, see What is Cloud Backup?