Container lifecycle
Last updated
Last updated
Address
VNG CorporationLifecycle 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 ^
before a character in the brackets negates the character or range
: 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:
Moving objects for postpaid customer accounts.
Moving objects from the Gold container to the Silver container.
Moving objects from the Gold container to the Archive container.
8. Choose the destination and time when objects are moved
Transition to: select vStorage Silver.
Then enter the number of days since the last time the object was accessed (Get/Download request).
After you successfully create a new Lifecycle rule of transition type,
If you choose Transition to: vStorage Silver, the vStorage system will automatically create a container with a tier suffix. This container will be used as a place to store transited objects. For example, when you create a lifecycle rule of type Transition to: vStorage Silver for Container01, the system will automatically create Container01_tier (storage class Silver). Within 5 hours from when the lifecycle rule is created, the vStorage system will run the rule, objects that satisfy the conditions will be moved from Container01 to Container01_tier with the object URL unchanged.
If you select Transition to: vStorage Archive, the vStorage system will automatically create a container with the archive_tier suffix. This container will be used as a place to store transited objects. For example, when you create a lifecycle rule of type Transition to: vStorage Archive for Container01, the system will automatically create Container01_archive_tier (storage class archive). Within 5 hours from when the lifecycle rule is created, the vStorage system will run the rule, objects that satisfy the conditions will be moved from Container01 to Container01_archive_tier with the object URL unchanged.
Expiration rule will delete objects in the container based on certain conditions. Currently, the expiration feature supports:
Deleting objects for both pre-paid and post-paid customer accounts.
Deleting objects in Gold, Silver, and Archive containers. (For Archive containers, the minimum number of days to perform object deletion is 180 days).
8. Select the action that occurs with objects in the chosen container, including:
Expire current versions of objects: Use when you want to set up the deletion of objects in the original container based on a period of time from the date the object exists in the vStorage system. This rule applies to deleting objects in non-versioning containers. When you choose this setting, you need to enter the number of days from the object's initialization.
Permanently delete previous versions: Use when you want to set up the deletion of objects in the corresponding version container of the original container based on a period of time from when the versioned object was created. This rule applies to deleting objects in versioned containers. When you choose this setting, you need to enter the number of days from when the object becomes an old version (meaning the object exists in the versioned container).
Expire marked-deleted objects: Use when you want to set up the deletion of files marked as deleted generated in versioned containers. (Delete marked files are files generated when you delete an object in the original container that has versioning enabled). This rule applies to deleting objects in versioned containers.
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:
Delete objects belonging to container01 that satisfy the 60-day inaccessibility condition.
Delete objects belonging to container01_version that satisfy the 60-day condition to become the old version (ie the object exists in container01_version for 60 days).
Delete the delete marker files generated in container01_version.
Click on the container icon or select it to use the container lifecycle feature and click