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.

Note For more information about the four storage classes, see Overview.

Configure lifecycle rules to automatically convert storage classes

You can configure lifecycle rules to allow OSS to automatically convert the storage classes of objects.

  • Rules to convert storage class based on lifecycle rules
    • Locally redundant storage (LRS)LRS

      The storage class 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.
    • Zone-redundant storage (ZRS)ZRS

      The storage class of ZRS objects can be converted based on the rule: Only conversions from Standard ZRS to IA ZRS are supported.

  • Examples on how to convert storage classes based on lifecycle rules
    In an LRS bucket, you can configure a lifecycle rule for objects whose names contain a specified prefix: Lifecycle rules
    The storage class of objects in the bucket is converted based on the following rules:
    • Objects are converted to IA objects after the objects are stored for 30 days.
    • Objects are converted to Archive objects after the objects are stored for 180 days.
    • Objects are converted to Cold Archive objects after the objects are stored for 360 days.
    • Objects are deleted after the objects are stored for more than 720 days.
    Note If a bucket has Transit to IA Storage Class, Transit to Archive Storage Class, Transit to Cold Archive Storage Class, and Delete configured at the same time, the retention periods in days must meet the following requirements:

    Days for Transit to IA Storage Class < Days for Transit to Archive Storage Class < Days for Transit to Cold Archive Storage Class < Days for Delete

  • 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

    You are charged the full price for 64 KB for objects that are smaller than 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 shorter period 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. 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. 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 (not charged in public preview)

    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.