Deleting objects in archive zone

Use the S3 lifecycle policy extension to delete objects within an <ArchiveZone> element.

About this task

Important: Archive zone objects can only be deleted using the expiration lifecycle policy rule.
  • If any <Rule> section contains an <ArchiveZone> element, that rule runs in archive zone and is the only rule that runs in an archive zone.
  • Rules marked <ArchiveZone> do NOT run in nonarchive zones.
The rules within the lifecycle policy determine when and what objects to delete. For more information about lifecycle creation and management, see Configuring Bucket lifecycle.

Procedure

  1. Set the <ArchiveZone> lifecycle policy rule.
    For more information about creating a lifecycle policy, see Creating a lifecycle management policy.
    For example,
    <?xml version="1.0" ?>
    <LifecycleConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
            <Rule>
                    <ID>delete-1-days-az</ID>
                    <Filter>
    		  <Prefix></Prefix>
    		  <ArchiveZone />
                    </Filter>
                    <Status>Enabled</Status>
                    <Expiration>
                            <Days>1</Days>
                    </Expiration>
            </Rule>
    </LifecycleConfiguration>
  2. Optional: Verify whether a specific lifecycle policy contains an archive zone rule.
    radosgw-admin lc get --bucket BUCKET_NAME
    The following example shows the output of a lifecycle policy with an archive zone rule.
    [ceph: root@host01 /]# radosgw-admin lc get --bucket test-bkt 
    
    { 
        "prefix_map": { 
            "": { 
                "status": true, 
                "dm_expiration": true, 
                "expiration": 0, 
                "noncur_expiration": 2, 
                "mp_expiration": 0, 
                "transitions": {}, 
                "noncur_transitions": {} 
            } 
        }, 
        "rule_map": [ 
            { 
                "id": "Rule 1", 
                "rule": { 
                    "id": "Rule 1", 
                    "prefix": "", 
                    "status": "Enabled", 
                    "expiration": { 
                        "days": "", 
                        "date": "" 
                    }, 
                    "noncur_expiration": { 
                        "days": "2", 
                        "date": "" 
                    }, 
                    "mp_expiration": { 
                        "days": "", 
                        "date": "" 
                    }, 
                    "filter": { 
                        "prefix": "", 
                        "obj_tags": { 
                            "tagset": {} 
                        }, 
                        "archivezone": ""    
                    }, 
                    "transitions": {}, 
                    "noncur_transitions": {}, 
                    "dm_expiration": true 
                } 
            } 
        ] 
    }
  3. If the Ceph Object Gateway user is deleted, the buckets at the archive site owned by that user is inaccessible. Link those buckets to another Ceph Object Gateway user to access the data.
    radosgw-admin bucket link --uid NEW_USER_ID --bucket BUCKET_NAME --yes-i-really-mean-it
    [ceph: root@host01 /]# radosgw-admin bucket link --uid arcuser1 --bucket arc1-deleted-da473fbbaded232dc5d1e434675c1068 --yes-i-really-mean-it