Object Storage Service (OSS) provides the following storage classes: Standard, Infrequent Access (IA), Archive, and Cold Archive. You can configure lifecycle rules or call the CopyObject operation to convert the storage class of an object based on your business requirements.

Warning

We recommend that you do not change the storage classes of objects in the .dlsdata/ directory in which OSS-HDFS data is stored in a bucket for which the OSS-HDFS service is enabled.

If you change the storage class of an object in the .dlsdata/ directory to Infrequent Access (IA), you can use the OSS-HDFS service to access the object. If you change the storage class of the object to Archive or Cold Archive, you cannot use the OSS-HDFS service to access the object. If you want to access the object, restore the Archive or Cold Archive object.

Configure lifecycle rules to automatically convert storage classes of objects

You can configure lifecycle rules to allow OSS to automatically convert the storage classes of objects. For more information about the storage classes provided by OSS, see Overview.

  • Storage class conversion based on the last modified time of objects
    • Locally redundant storage (LRS)LRS

      The storage classes of LRS objects can be converted based on the following rules:

      • Conversions from Standard LRS to IA LRS, Archive LRS, or Cold Archive LRS.
      • Conversions from IA LRS to Archive LRS or Cold Archive LRS.
      • Conversions from Archive LRS to Cold Archive LRS.

      If different policies are configured for a bucket at the same time to convert the storage classes of objects to IA, Archive, and Cold Archive, the periods specified in the policies must meet the following requirements:

      Period of time required for conversion to IA LRS < Period of time required for conversion to Archive LRS < Period of time required for conversion to Cold Archive LRS

    • Zone-redundant storage (ZRS)ZRS

      The storage classes of ZRS objects can only be converted from Standard to IA.

    For more information, see Lifecycle rules based on the last modified time.

  • Storage class conversion based on the last access time of objects

    You can configure a lifecycle rule that automatically converts Standard objects to IA objects a specific number of days after the last access time of the objects. After the objects are converted, you can specify whether to convert the objects back to Standard objects or remain IA objects when the objects are accessed. For more information, see Lifecycle rules based on the last access time.

  • Implementation methods of configuring lifecycle rules
    Implementation method Description
    Console A user-friendly and intuitive web application.
    ossutil A high-performance command-line tool.
    Java SDK SDK demos for a variety of programming languages.
    Python SDK
    PHP SDK
    Go SDK
    C SDK
    .NET SDK
    Node.js SDK
    Ruby SDK

Call CopyObject to manually convert storage classes

You can call the CopyObject operation to convert the storage class of an object by overwriting the object. If the storage class of the converted object is IA, Archive, or Cold Archive and the object is stored for less than the specified period of time, you are charged based on the minimum storage period. For more information, see Storage fees.
  • Rules for storage class conversion by calling CopyObject
    • LRS
      Conversions between storage classes are supported.
      Note Before you can convert the storage class of an Archive object or a Cold Archive object, you must restore the object. For more information about how to restore an object, see Restore objects.
    • ZRS

      Only conversions between Standard ZRS and IA ZRS are supported.

  • Implementation methods of storage class conversion by calling CopyObject
    Implementation method Description
    Console A user-friendly and intuitive web application.
    ossutil A high-performance command-line tool.
    Java SDK SDK demos for a variety of programming languages.
    Python SDK
    Go SDK
    C++ SDK

Usage notes

After you convert the storage class of an object to IA, Archive, or Cold Archive, take note of the following items:
  • Minimum billable size

    Objects that are smaller than 64 KB in size are billed as 64 KB.

  • Minimum storage period
    The minimum storage period that you can set for an IA object is 30 days. The minimum storage period that you can set for an Archive object is 60 days. The minimum storage period that you can set for a Cold Archive object is 180 days. If an object is stored for a period less than the minimum storage period, you are still charged for the minimum storage period.
    • Automatic conversion triggered by lifecycle rules

      If you configure lifecycle rules to automatically convert the storage class of an object, OSS does not recalculate the retention period when the storage class of the object changes. For example, an object named a.txt is a Standard object. After the object is stored in OSS for 10 days, its storage class is converted to IA based on lifecycle rules. Then, the object must be stored as an IA object for another 20 days to meet the minimum storage period of 30 days. For more information, see FAQ.

    • Manual conversion

      If you manually convert the storage class of an object, OSS recalculates the retention period of the object. For example, an object named a.txt is a Standard object. After the object is stored in OSS for 10 days, its storage class is manually converted to IA. Then, the retention period of the object as an IA object is reset to 0, and the object must be stored for another 30 days to meet the minimum storage period of 30 days.

  • Restoration time

    It takes a period of time to restore Archive or Cold Archive objects to the readable state. If your business requires your objects to be read in real time, we recommend that you do not convert the storage classes of your objects to Archive or Cold Archive.

  • Data retrieval fees

    When you access IA objects, you are charged additional data retrieval fees based on the amount of accessed data. You are charged data restoration fees when you restore Archive or Cold Archive objects. Data restoration and outbound traffic are two separate billable items. If an object is accessed more than once per month on average, the storage cost of the object may be higher if you convert the storage class of the object from Standard to IA, Archive, or Cold Archive.

  • Temporary storage fees

    When you restore a Cold Archive object, a Standard replica of the object is generated for temporary access. You are charged the temporary storage fees of the replica for its duration as a Standard object before the restoration period ends.