Skip to content

Accept GLACIER/DEEP_ARCHIVE as cold locations, advertise the Veeam archive tier - #6329

Draft
francoisferrand wants to merge 2 commits into
development/9.5from
improvement/CLDSRV-988-archive-storage-class
Draft

francoisferrand wants to merge 2 commits into
development/9.5from
improvement/CLDSRV-988-archive-storage-class

Conversation

@francoisferrand

Copy link
Copy Markdown
Contributor

AWS CLI (and Veeam) only accept the official S3 storage class names, so they could not write "direct to cold": location names are lower case, and the UI does not allow creating upper case ones anyway.

Storage class mapping — GLACIER / DEEP_ARCHIVE in x-amz-storage-class now map to a location of the same lower case name (glacier / deep_archive). This is done in validateStorageClass(), i.e. after auth, so policies apply to the storage class as sent by the client; the usual STANDARD path is untouched, and the header is only rewritten when the value resolves to an accepted cold location. Conversely, objects stored in one of those locations are reported with the AWS name in HeadObject/GetObject, ListObjects(Versions) and GetObjectAttributes. Metadata keeps the canonical location name, so nothing changes for backbeat.

Veeam — system.xml now accepts EnableOnPremArchiveTier in ProtocolCapabilities. When not provided (the zenko-ui template does not set it), it defaults to whether the archive tier is actually usable: enableDirectToCold and a cold location named glacier.

Note: an object in a glacier location is always reported as GLACIER, whichever spelling was used on write.

Issue: CLDSRV-988

@bert-e

bert-e commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

Hello francoisferrand,

My role is to assist you with the merge of this
pull request. Please type @bert-e help to get information
on this process, or consult the user documentation.

Available options
name description privileged authored
/after_pull_request Wait for the given pull request id to be merged before continuing with the current one.
/bypass_author_approval Bypass the pull request author's approval ⭐
/bypass_build_status Bypass the build and test status ⭐
/bypass_commit_size Bypass the check on the size of the changeset TBA ⭐
/bypass_incompatible_branch Bypass the check on the source branch prefix ⭐
/bypass_jira_check Bypass the Jira issue check ⭐
/bypass_peer_approval Bypass the pull request peers' approval ⭐
/bypass_leader_approval Bypass the pull request leaders' approval ⭐
/bypass_source_branch_lineage Bypass the cross-branch contamination check ⭐
/approve Instruct Bert-E that the author has approved the pull request. ✍️
/create_pull_requests Allow the creation of integration pull requests.
/create_integration_branches Allow the creation of integration branches.
/no_octopus Prevent Wall-E from doing any octopus merge and use multiple consecutive merge instead
/unanimity Change review acceptance criteria from one reviewer at least to all reviewers
/wait Instruct Bert-E not to run until further notice.
Available commands
name description privileged
/help Print Bert-E's manual in the pull request.
/status Print Bert-E's current status in the pull request.
/clear Remove all comments from Bert-E from the history TBA
/retry Re-start a fresh build TBA
/build Re-start a fresh build TBA
/force_reset Delete integration branches & pull requests, and restart merge process from the beginning.
/reset Try to remove integration branches unless there are commits on them which do not appear on the source branch.

Status report is not available.

Comment thread lib/api/bucketGet.js
buildAttributesXml(v, v.userMetadata, listParams.optionalAttributes, xml);

return xml.push(`<StorageClass>${v.StorageClass}</StorageClass>`, '</Contents>');
return xml.push(`<StorageClass>${formatStorageClass(v.StorageClass)}</StorageClass>`, '</Contents>');

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ListParts was missed: lib/api/listParts.js:306 still returns mpuOverviewObj.storageClass as stored. An MPU started with GLACIER will show <StorageClass>glacier</StorageClass> there, while HeadObject and ListObjects show GLACIER. Wrap it in formatStorageClass() too (in listParts.js, outside this diff).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, fixed: ListParts now goes through formatStorageClass(), and so does ListMultipartUploads, which had the same issue (arsenal emits the stored x-amz-storage-class per <Upload>). Both are covered by unit tests in directToCold.js (MPU initiated with GLACIER, listing reports GLACIER).

@codecov

codecov Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.88%. Comparing base (e7ee82d) to head (6b5a944).
✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

Files with missing lines Coverage Δ
lib/api/apiUtils/object/objectAttributes.js 100.00% <100.00%> (ø)
lib/api/apiUtils/object/storageClass.js 100.00% <100.00%> (ø)
lib/api/bucketGet.js 95.86% <100.00%> (+0.02%) ⬆️
lib/api/listMultipartUploads.js 91.30% <100.00%> (+0.60%) ⬆️
lib/api/listParts.js 92.50% <100.00%> (+0.06%) ⬆️
lib/routes/veeam/schemas/system.js 100.00% <100.00%> (ø)
lib/utilities/collectResponseHeaders.js 100.00% <100.00%> (ø)

... and 2 files with indirect coverage changes

@@                 Coverage Diff                 @@
##           development/9.5    #6329      +/-   ##
===================================================
- Coverage            87.89%   87.88%   -0.01%     
===================================================
  Files                  206      206              
  Lines                14193    14209      +16     
===================================================
+ Hits                 12475    12488      +13     
- Misses                1718     1721       +3     
Flag Coverage Δ
checksums-disabled-tests 35.68% <47.61%> (+0.02%) ⬆️
file-ft-tests 71.29% <85.71%> (-0.01%) ⬇️
file-ft-tests-null-compat 71.84% <90.47%> (+0.06%) ⬆️
kmip-ft-tests 28.25% <38.09%> (+0.02%) ⬆️
mongo-v0-ft-tests 72.56% <90.47%> (-0.07%) ⬇️
mongo-v1-ft-tests 72.54% <90.47%> (+<0.01%) ⬆️
multiple-backend 36.47% <52.38%> (+0.02%) ⬆️
s3c-ft-tests-v0 66.38% <90.47%> (+<0.01%) ⬆️
s3c-ft-tests-v0-null-compat 66.44% <90.47%> (+<0.01%) ⬆️
s3c-ft-tests-v1 66.36% <90.47%> (+<0.01%) ⬆️
sur-tests 37.01% <52.38%> (+<0.01%) ⬆️
sur-tests-inflights 39.95% <52.38%> (+0.02%) ⬆️
unit 75.44% <100.00%> (+0.03%) ⬆️
utapi-v2-tests 35.63% <47.61%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@bert-e

bert-e commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

Request integration branches

Waiting for integration branch creation to be requested by the user.

To request integration branches, please comment on this pull request with the following command:

/create_integration_branches

Alternatively, the /approve and /create_pull_requests commands will automatically
create the integration branches.

@scality scality deleted a comment from bert-e Oct 14, 2026
Standard S3 clients (AWS CLI, Veeam...) only accept the official storage
class names, so they cannot write directly to a cold location: the
location names are lower case, and cannot be created with an upper case
name anyway.

GLACIER and DEEP_ARCHIVE in x-amz-storage-class are now mapped to a
location of the same (lower case) name, when the header is validated by
the object write APIs. Policies are evaluated beforehand, so they apply
to the storage class as sent by the client. Conversely, an object stored
in a location named after one of these classes is reported with the AWS
name in HeadObject, GetObject, ListObjects(Versions) and
GetObjectAttributes.

Issue: CLDSRV-988
Veeam only offers a bucket as an on-premises archive tier when its
system.xml declares the EnableOnPremArchiveTier capability. The field is
now part of the SOSAPI schema, and defaults to whether the archive tier
can actually be used: Veeam writes to it with the GLACIER storage class,
which needs direct-to-cold writes and a cold location named glacier. The
UI does not need to know about it, while an explicit value still wins.

Issue: CLDSRV-988
@francoisferrand
francoisferrand force-pushed the improvement/CLDSRV-988-archive-storage-class branch from 6957fbd to 6b5a944 Compare October 14, 2026 22:08
const location = normalizeStorageClass(storageClass);
if (config.enableDirectToCold && isColdStorageClass(location)) {
// eslint-disable-next-line no-param-reassign
headers['x-amz-storage-class'] = location;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bucket policies are checked after this rewrite (objectPut/objectCopy/initiateMultipartUpload call validateStorageClass before standardMetadataValidateBucket(AndObj), and checkBucketPolicy builds its RequestContext from request.headers). So bucket policies see glacier while IAM saw GLACIER. A bucket policy Deny with StringEquals s3:x-amz-storage-class: GLACIER will never match, so the write goes through. That doesn't fit "policies apply to the storage class as sent by the client". Keep the original header and pass the resolved location separately, e.g. return it or store it on request, instead of mutating headers.

CapacityInfo: joi.boolean().required(),
UploadSessions: joi.boolean().required(),
IAMSTS: joi.boolean().default(false),
EnableOnPremArchiveTier: joi.boolean().default(supportsOnPremArchiveTier),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This default is computed once, when system.xml is PUT, and then saved in bucketMd._capabilities (veeam/put.js). If someone enables enableDirectToCold or creates or removes the glacier location later, existing buckets keep the old value. They then advertise the archive tier wrongly until Veeam rewrites system.xml. Store the value only when the client sent it, and work out the default when serving GET.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants