This topic describes how to manage backup policies in the Hybrid Backup Recovery (HBR) console.

Background information

Hybrid Backup Recovery (HBR) 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: the backup cycle, retention period, cross-region replication policy, and automatic archiving of backups.

You can configure backup policies for various data sources in different scenarios. This allows you to manage backup policies in a unified manner and flexibly perform backup operations.

Create a backup policy

Note Before you create backup policies, take note of the following limits:
  • 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 console.
  • You can use backup policies to back up only Elastic Compute Service (ECS) instances.

Before you back up a data source, you must create a backup policy.

  1. Log on to the HBR console.
  2. In the left-side navigation pane, click Policy Center.
  3. In the top navigation bar, select a region.
  4. On the Policy Center page, click Create Backup Policy in the upper-right corner.
  5. In the Create Policy panel, configure parameters such as Policy Name, Schedule, Lifecycle, and Replication Policy, and then click OK.
    ParameterDescription
    Policy NameThe name of the custom policy.

    The name must be 2 to 128 characters in length, and can contain only the following special characters: periods (.), underscores (_), hyphens (-), and colons (:). The name cannot start with auto, a special character, or a digit.

    Backup VaultThe backup vault to which you want to store the backup data. If you do not need to configure a backup vault, you can select No.
    • No: No backup vault is created. The default storage vault of HBR is used.
    • Create Vault: If you select this option, specify a name for the vault in the Vault Name field. If you do not configure this parameter, a random name is specified for the backup vault.
    • Select Vault: If you select this option, select a backup vault from the Vault Name drop-down list.
    Important You can use backup policies to back up only ECS instances. The snapshot capacity is used. You do not need to configure a backup vault.
    Schedule
    Time ScaleThe time granularity for data backup. Valid values:
    • Hourly: Data is backed up at an interval of the specified hours.
    • Daily: Data is backed up at an interval of the specified days.
    • Weekly: Data is backed up on the specified days of the week.
    • Monthly: Data is backed up on the specified days of the specified months.
    Lifecycle
    Retention PeriodThe retention period of the backup data.
    Important You cannot permanently store the backup data of ECS instances.
    • Permanent: The backup data is permanently stored.
    • Specify Time: You can specify a retention period. Valid values: 1 to 999. Unit: days. The default retention period is 7 days.
    Special Retention PeriodTo help you meet data security requirements, HBR allows you to specify a retention period for general backups and specify longer retention periods for the first backups that are generated every week, every month, and every year. A special retention policy includes the settings of retention periods for the first backups that are generated every week, every month, and every year. For more information, see Special retention policy.
    Replication Policy
    Replication to Other RegionIf you turn on Replication to Other Region, the backups created based on the current backup policy are automatically replicated to the destination region. This provides cross-region protection for ECS instances.

    If an ECS instance is infected with viruses or data is lost due to accidental deletion, you can use backups in the source region or backups replicated to the destination region to create another instance or disk to restore data.

    Destination RegionThis parameter is required only if you turn on Replication to Other Region. This parameter specifies the destination region to which you want to replicate the backup data.
    Retention PeriodThis parameter is required only if you turn on Replication to Other Region. This parameter specifies the period of time for which you want to retain the backup data that is replicated to the destination region.
    • Permanent: The backup data is permanently stored.
    • Specify Time: You can specify a retention period. Valid values: 1 to 999. Unit: days. The default retention period is 7 days.
    After the backup policy is created, you can view the backup policy on the Backup Policy page. backuppolicy

Associate data sources with the backup policy

After the backup policy is created, you can associate it with data sources. You can also navigate to the management page of a data source and back up the data source by using the backup policy.

Important You can associate a backup policy only with ECS instances.
  1. Log on to the HBR console.
  2. In the left-side navigation pane, click Policy Center.
  3. In the top navigation bar, select a region.
  4. Find the backup policy that you want to manage and click Associate Data Source in the Actions column.
  5. In the Associate Data Source panel, configure the backup objects and backup settings, and then click OK.
    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 associate up to 50 ECS instances with a backup policy.
      • Hybrid Backup Recovery (HBR) automatically checks whether the selected ECS instances support snapshot-consistent groups. HBR 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, HBR ensures only the crash consistency of disks. For more information, see Create a snapshot-consistent group.
    2. Configure the backup settings and click OK.
      • Confirm the backup policy.
      • If you select a single ECS instance, you can turn on Application Consistent Backup to enable the application-consistent backup feature.
        • Enable the application-consistent backup feature for a Windows ECS instance
          Note If you select Application Consistent Backup, you must install a Cloud Assistant client on the ECS instance. In Windows, the process of a Cloud Assistant client is named AliyunService. For more information, see Overview.
        • Enable the application-consistent backup feature for a Linux ECS instance

          Write the application pre-freeze and post-thaw scripts based on the applications deployed on the ECS instance and upload the scripts to the ECS instance.

          You can use the FTP service or Cloud Assistant to upload the application pre-freeze and post-thaw scripts to the ECS instance.

          • Application pre-freeze scripts: Run the chmod 700 /tmp/prescript.sh command to grant the read, write, and execute permissions on the scripts only to the root user. /tmp/prescript.sh is the save path of the scripts.
          • Application post-thaw scripts: Run the chmod 700 /tmp/postscript.sh command to grant the read, write, and execute permissions on the scripts only to the root user. /tmp/postscript.sh is the save path of the scripts.
          Important
          • If Application Consistent Backup is selected and the scripts are configured as expected, HBR creates application-consistent backup files.
          • If Application Consistent Backup is selected but no scripts are configured or the scripts are not configured as expected, HBR creates file system-consistent backup files.
          Sample scripts for the application-consistent feature:
          Note If you select Application Consistent Backup, you must install a Cloud Assistant client on the ECS instance. In Linux, the process of a Cloud Assistant client is named aliyun.service. You can run the ps aux|grep aliyun.service command to check whether a Cloud Assistant client is installed. For more information, see Overview.
    After you associate data sources with the backup policy, you can view the associated data sources on the Backup Policy page. Hybrid Backup Recovery (HBR) runs the backup plan based on the backup policy. Associate data sources with the backup policy

What to do next

After a backup policy is created, you can perform the following operations in the Actions column.
OperationDescription
EditYou can modify the settings of the backup policy. After the backup policy is modified, the modification takes effect in the next backup job.

For example, if the backup policy that you created does not meet your business requirements, you can perform this operation to modify the backup policy.

More > Run NowYou can immediately start all backup jobs that are associated with the data sources.
More > DisassociateYou can disassociate the backup policy from the data sources. After the backup policy is disassociated from the data sources, HBR no longer performs the backup plan for the data sources.
Warning After a backup policy is disassociated from a data source, HBR no longer backs up data from the data source based on the backup policy. Proceed with caution.
More > DeleteYou can delete the backup policy. After you delete the backup policy, HBR no longer runs backup jobs for the associated data sources but the backup data is retained.
Warning After a backup policy is deleted, HBR no longer runs backup jobs for the associated data sources. The data sources are no longer protected. Proceed with caution.