Creating a Replication Policy¶
A replication policy allows CBR to periodically replicate backups that have not been replicated or failed to be replicated to the destination region.
When a backup time and a replication time are both configured, ensure that replication starts after backup is complete. Or, replication may fail.
Constraints¶
You can only apply replication policies to server backup vaults.
Procedure¶
Log in to the CBR console.
Log in to the management console.
Click in the upper left corner and select a region.
Click and choose Storage > Cloud Backup and Recovery.
Choose Policies in the left navigation pane and click the Replication Policies tab. In the upper right corner, click Create Policy. See Figure 1.
Figure 1 Creating a replication policy
Set the replication policy parameters. Table 1 describes the parameters.
¶ Parameter
Description
Example Value
Type
Select a policy type. In this section, we select the replication policy.
Replication policy
Name
Replication policy name
A name must contain 1 to 64 characters including digits, letters, underscores (_), or hyphens (-).
replication_policy
Status
Whether to enable the replication policy
Only after a replication policy is enabled and applied will CBR automatically replicates the backups in the vaults and deletes expired backup replicas.
Execution Time
Execution times of the replication policy in a day
Replication tasks can be scheduled at the beginning of each hour, and you can select multiple hours.
00:00, 02:00
It is recommended that replication be performed during off-peak hours or when no services are running.
Replication Frequency
Select a replication frequency.
Weekly
Specifies on which days of each week the replication task will be executed. You can select multiple days.
Day based
Specifies the interval (every 1 to 30 days) for executing the replication task.
Every day
If you select day-based replication, the first replication is supposed to be executed on the day when the replication policy is created. If the execution time on the day you create the replication policy has passed, the first replication will be performed in the next replication cycle.
Retention Rule
Rule that specifies how backup replicas will be retained in the destination region
Replica quantity
You can set the maximum number of backup replicas to retain for each resource. The value ranges from 2 to 99999.
You can also set long-term retention rules with advanced options. Long-term retention rules and quantity-based retention rules will be both applied.
Day-based: 0-100
Weekly: 0-100
Monthly: 0-100
Yearly: 0-100
A resource may be replicated multiple times in a day. If day-based replication is configured, only the most recent backup replica of that day is retained. If you set Day-based to 5, the most recent backup replica of each of the last five days that have backup replicas generated will be retained and the earliest backup replicas will be deleted automatically. If day-based, weekly, monthly, and yearly retention rules are all configured, all the rules will apply and the union set of backup replicas will be retained. For example, if Day-based is set to 5 and Weekly to 1, five backup replicas will be retained. The long-term retention rule and the quantity-based retention rule both apply.
Time period
You can choose to retain backup replicas for one month, three months, six months, one year, or for any desired number (2 to 99999) of days.
Permanent
Note
The system automatically deletes the earliest and expired backup replicas every other day to avoid exceeding the maximum number of backup replicas to retain or retaining any backup replica longer than the maximum retention period.
There will be delays for CBR to delete expired backup replicas, but normally these delays will not be over 24 hours.
The retention rules apply only to auto-generated backup replicas, but not manual ones. Manual backup replicas need to be deleted manually.
After a backup replica is used to create an image, the replica will not be deleted by the retention rule.
6 months
Destination Region
Region to which backups are replicated
Only the regions that support replication will be displayed.
If the selected region contains only one project, you can directly select the region name.
If the selected region has multiple projects, the default project of the region is preselected. You can select another project if needed.
-
Click OK.
Locate the desired vault and choose More > Apply Replication Policy to apply the replication policy to the vault. Then you can view the applied policy on the vault details page.
After the policy is applied, backups will be periodically replicated to the destination vault based on the policy.
Example¶
A user applies a replication policy to a vault in a given region at 11:00 a.m. on Thursday. According to this policy, backups will be replicated to the destination region on 02:00 a.m. everyday, and only two backup replicas will be retained. According to this vault's backup policy, two backups are automatically generated at 00:00 everyday. At 12:00 p.m. on Saturday, the replication vault will contain two backup replicas, which are replicated on Saturday. Backup replicas generated at 02:00 a.m. on Friday have been automatically deleted according to the replication policy.