Container lifecycle
Lifecycle is a feature developed by VNG Cloud that allows you to set up actions that vStorage applies to a container. We define the following two types of rules to help you manage the container lifecycle:
In there:
Transition rule: Rule supports moving objects between storage classes. You can set up one or more lifecycle rules to move objects if within N days the object has not been accessed.
From storage class Gold to storage class Silver.
From storage class Gold to storage class Archive.
Expiration rule: Rule supports deleting objects according to binding conditions. You can set up one or more lifecycle rules to delete objects after a certain period of time from the date the object exists on the vStorage system. You can set up the lifecycle to:
Delete an object belonging to Storage Class Gold.
Delete object belonging to Storage Class Silver.
Note:
Processing objects during a lifecycle rule run depends on the number of objects in the container for which your lifecycle rule is set and the workload of our system. If the container has many objects or the system has a high load, processing will be slow and drag on over the following days. If the container has few objects or the system has a low load, processing is fast and can be completed in a day. To ensure object processing is efficient and fast, you should split your lifecycle rule runs and use Filters to minimize the number of objects that need to be processed.
You can only create lifecycle rules of 1 of 2 types (transition, expiration) on 1 container in any 1 project. For example, if you have set a lifecycle rule of type transition for container01, you cannot set another lifecycle rule of type expiration for container01 and vice versa.
If you set a transition type lifecycle rule for a container, you can only create a maximum of 1 transition rule.
If you set up an expiration type lifecycle rule for 1 container, you can create up to 10 expiration rules.
To create a lifecycle for a container, you can do so via vStorage Portal according to the instructions below:
Log in to https://vstorage.console.vngcloud.vn.
Select the project and choose the container for which you want to set up the lifecycle.
The Lifecycle screen appears. Choose Create a lifecycle rule.
Enter the Lifecycle Rule Name. The allowed characters for the Lifecycle Rule Name include letters (a-z, A-Z), numbers (0-9), '_', and '-'. The length of your Lifecycle Rule Name must be between 5 and 50.
Select the Rule Type and enter a Rule Description if necessary. We provide you with two types of rules:
Transition: Rule to support moving objects between storage classes.
Expiration: Rule to support deleting objects based on specified conditions.
Enter the Filter. This filter applies to a specific lifecycle rule. Each lifecycle rule can have only one filter, and we provide you with filtering options, including:
If you want to search for objects based on Prefix:
Select Prefix.
Enter the prefix string you want to search for.
If you want to search for objects based on Wildcard:
Select Wildcard.
Enter the wildcard string you want to search for.
If you want to search for objects based on Regex:
Select Regex.
Enter the regex string you want to search for.
For example, if you want to search for objects with a common prefix in the object name as file, you need to set up the filter as follows:
Select Prefix
Enter the prefix file
You can learn more about how we search results using each method in the table below:
Search by | Example syntax | Search result | Description |
Name match by prefix | Name match by prefix abc (object in the container) Name match by prefix directoryA/abc (object in directoryA) | abc1, abc2,…distinguish between lower case and lower case. | Search by comparing the entered string with the prefix of the object's name. |
Name match by wildcard (Comming soon) | Name match by wildcard abc (object in the container) Name match by wildcard ?abc? (object in the container) Name match by wildcard abc.?xt (object in the container) Name match by wildcard ab*c.txt (object in the container) Name match by wildcard directoryA/abc (object in the directoryA) Name match by wildcard directoryA/?abc? (object in the directoryA) Name match by wildcard directoryA/abc.?xt (object in the directoryA) Name match by wildcard directoryA/ab*c.txt (object in the directoryA) | abc, abdc, ab)c, abUUc, ab&-Bc…distinguish between lower case and lower case. 1abcx, -abc*, 1abcD,… distinguish between lower case and lower case. abc.txt, abc123.^xt,… distinguish between lower case and lower case. ab*c.txt distinguish between lower case and lower case. | : 0 tới n ký tự bất kỳ, ký tự này có thể là chữ cái in hoa, in thường, ký tự số hoặc ký tự đặc biệt. ?: 1 ký tự bất kỳ, ký tự này có thể là chữ cái in hoa, in thường, ký tự số hoặc ký tự đặc biệt. </strong>, </strong>?: ký tự *, ? lúc này được coi là một ký tự trong bình thường, không phải là toán tử đại diện sử dụng để search. |
Name match by regex (Comming soon)
| Name match by regex ab. (object in the container) Name match by regex directoryA/ab. (object in the directoryA) | ab1,ab2,ab3, abx, ab*,… distinguish between lower case and lower case. | .: Matches any character |
ab, abc distinguish between lower case and lower case. | ?: Repeat the preceding character zero or one times. Often used to make the preceding character optional. | ||
ab, abb, abbb,… distinguish between lower case and lower case. | +: Repeat the preceding character one or more times. | ||
a, ab, abb, abbb,… distinguish between lower case and lower case. | *: Repeat the preceding character zero or more times. | ||
aa distinguish between lower case and lower case. aa, aaa, aaaa distinguish between lower case and lower case. aa, aaa, aaaa, aaaaa,… distinguish between lower case and lower case. | {}: Minimum and maximum number of times the preceding character can repeat. | ||
xyz (object in the container) Name match by regex directoryA/abc | xyz (object in the directoryA) | abc, xyz distinguish between lower case and lower case. | |: OR operator. The match will succeed if the longest pattern on either the left side OR the right side matches. |
abc, abcxyz distinguish between lower case and lower case. | (): Forms a group. You can use a group to treat part of the expression as a single character. | ||
a, b, c distinguish between lower case and lower case. a, b, c, d distinguish between lower case and lower case. khác a, b, c, hoặc - distinguish between lower case and lower case. | [ ]: Match one of the characters in the brackets. A : OR | ||
aaaaaaa, aaaaaaaaaaaaddddd,… distinguish between lower case and lower case. | Use nested operators within a regex search syntax. |
When you choose:
The transition rule will move objects that meet certain conditions from the Gold storage class to the Silver storage class. Currently, the transition feature is only supported for:
8. Choose the destination and time when objects are moved
After you successfully create a new Lifecycle rule of transition type,
|
Expiration rule will delete objects in the container based on certain conditions. Currently, the expiration feature supports:
8. Select the action that occurs with objects in the chosen container, including:
After you successfully create a new Lifecycle rule with expiration type, within 2 hours from the time the lifecycle rule is created, the vStorage system will run the rule, objects that satisfy the conditions will be deleted. Refer to the 2 examples below to understand how the expiration rule works: Example 1: you have created container01 (container01 has not enabled container versioning yet). Now you need to set up a rule according to the rule: if the objects are not accessed for 60 days, the system will delete them. Now you will set up expiration rules as follows: Within 2 hours from the time this lifecycle rule is created, the vStorage system will run the rule, check the objects in container01 and delete objects that meet the 60-day inaccessible condition. Example 2: you have created container01 (container01 has container versioning enabled). Now you need to set up a rule according to the rule: if the objects are not accessed for 60 days, the system will delete them. Now you will set up expiration rules as follows: Within 2 hours from the time this lifecycle rule is created, the vStorage system will run the rule, check the objects in container01, container01_version and do:
|
Last updated