Create the object-storage bucket that Backup and Recovery uses as an offsite backup target. The bucket is the destination for the disk-to-object and 3-2-1 fan-out protection policies.
| Target | Script | Status |
|---|---|---|
| ONTAP S3 | create-ontap-s3-bucket.sh |
Tested 2026-10-27 (create) and 2026-10-28 (--wait) without object lock: bucket created and listed by object-storage. Tested again 2026-11-13 (credential lookup by name, create, --wait), and the bucket was confirmed on the ONTAP S3 server. Object lock untested |
| AWS S3 | create-aws-s3-bucket.sh |
Tested 2026-10-28 (account-name lookup, create, --wait) and 2026-10-30 (--tag). Retested 2026-11-17 (eu-central-1, account-name lookup, create, --wait; the bucket was listed after about 30 seconds). Object lock and customer-managed KMS keys untested. The list does not show tags, so check them in the Console or AWS |
| Azure Blob | create-azure-storage-account.sh |
Tested 2026-10-28: resource-group lookup, create and --wait, with and without --object-lock (the request is accepted and the account is listed). The list does not show the lock state, so check it in the Console or the Azure portal |
| StorageGRID | create-storagegrid-bucket.sh |
Not yet tested against StorageGRID |
| S3-compatible | create-s3-compatible-bucket.sh |
Tested 2026-10-28 without object lock: bucket created and listed. Object lock untested. Needs a Backup and Recovery version with S3-compatible support |
Run the commands below from this section's scripts/ folder (cd scripts).
- Authentication and account discovery completed.
- For ONTAP S3, StorageGRID and S3-compatible: a credential in Backup and Recovery, see ONTAP S3, StorageGRID and S3-compatible. The scripts look it up by name.
- For AWS S3: an AWS credential added to the Console, see AWS S3 credentials. The bucket is created in that AWS account.
export ACCESS_TOKEN="<access_token>" # BEARER_TOKEN is accepted as an alias
export ACCOUNT_ID="<account_public_id>" # ORG_ID is accepted as an alias
export AGENT_ID="<console_agent_id>"
export CONSOLE_API="https://cloudmanager.cloud.netapp.com" # API_HOST is accepted as an aliasOptional: WORKSPACE_ID, sent by the AWS script as x-netapp-workspace-id, as the Console UI does.
Every script supports --dry-run (prints the request body, no API call) and --help.
Every create call returns a job ID, so the bucket may not exist yet when the script exits. Add --wait to poll the object-storage list every 5 seconds until the new bucket appears (up to --timeout seconds, default 120). The script exits 0 when the bucket is listed and 1 on timeout, so it can be chained into the next step, for example creating a protection policy in 06-protection-policies. No job-status call is documented here, so "listed" is the signal. The AWS and Azure list calls need extra query parameters (aws-account-id, or subscription and resource-group), so those two scripts poll with the values you passed. The polling is the wait_for_object_store function in lib/bnr-common.sh.
./create-ontap-s3-bucket.sh --list-credentials # name, id and server of the ONTAP S3 credentials
./create-ontap-s3-bucket.sh --bucket "<bucket_name>" --credential-name "<credential_name>" --dry-run
./create-ontap-s3-bucket.sh --bucket "<bucket_name>" --credential-name "<credential_name>"The call creates the bucket on the ONTAP S3 server; it does not register an existing one (confirmed on the ONTAP side, 2026-11-13). The bucket name must follow S3 naming rules (lowercase). --dry-run does not resolve the credential name: it prints a placeholder instead of the credential ID, and the lookup runs only in the real call.
With --credential-id instead of --credential-name, the credential lookup is skipped. Add --object-lock to enable object lock.
List the regions and KMS keys the Console offers, then create the bucket:
./create-aws-s3-bucket.sh --list-aws-accounts
./create-aws-s3-bucket.sh --list-regions
./create-aws-s3-bucket.sh --list-kms-keys --aws-account-name "<aws_credential_name>" --region "<region_code>"
./create-aws-s3-bucket.sh --bucket "netapp-backup-<name>" --region "<region_code>" \
--aws-account-name "<aws_credential_name>" --dry-run
./create-aws-s3-bucket.sh --bucket "netapp-backup-<name>" --region "<region_code>" \
--aws-account-name "<aws_credential_name>"Use --aws-account-id instead of --aws-account-name if you already know the 12-digit AWS account ID. The name is the credential name shown in the Console, and the script resolves it with GET /occm/api/accounts/cloud-providers.
Bucket names must start with netapp-backup-. The Console UI now enforces this prefix for AWS S3 backup targets, and the script checks it before sending anything (also with --dry-run). A name without the prefix is refused with a suggested name, for example netapp-backup-pu-aws-test-7 for pu-aws-test-7; the script does not add the prefix silently. The name may have at most 63 characters, so 49 remain after the prefix. The API accepted a name without the prefix on 2026-11-17, before the UI rule was known; --skip-prefix-check sends the name unchanged if you need that. The API itself neither enforces nor rejects the prefix, so the check exists to match the UI. Tested live 2026-11-18 with netapp-backup-pu-test-aws-1 in eu-central-1 (HTTP 201, listed with --wait). Existing buckets are not renamed. A policy created on 2026-11-17 accepted a bucket without the prefix (AWS_BACKUP_TARGET); whether policies still accept such buckets after the rule change has not been checked.
--kms-key-id is empty by default, which is what the UI sends for default encryption.
For a bucket with object lock, add --object-lock-mode COMPLIANCE or GOVERNANCE. Object lock modes and tags are not yet tested. The UI sends no versioning field, so the Console appears to enable versioning together with object lock. Add --tag KEY=VALUE once per AWS tag:
./create-aws-s3-bucket.sh --bucket "netapp-backup-<name>" --region "<region_code>" \
--aws-account-name "<aws_credential_name>" \
--object-lock-mode COMPLIANCE --tag type=testCOMPLIANCE object lock protects data in a way that even the AWS root user cannot undo. Check retention settings before using it on a bucket with real backups.
The Console creates the bucket in AWS and returns a job ID. HTTP 2xx means the request was accepted, not that the bucket is ready.
List the subscriptions and resource groups the Console sees, then create the storage account:
./create-azure-storage-account.sh --list-subscriptions
./create-azure-storage-account.sh --list-resource-groups --subscription-name "<subscription_name>"
./create-azure-storage-account.sh --name "<storage_account_name>" \
--subscription-name "<subscription_name>" --resource-group "<resource_group>" \
--region "<azure_region>" --object-lock --dry-run
./create-azure-storage-account.sh --name "<storage_account_name>" \
--subscription-name "<subscription_name>" --resource-group "<resource_group>" \
--region "<azure_region>" --object-lockUse --subscription-id instead of --subscription-name if you already know the subscription GUID. The resource group must already exist, and the Azure credential you added to the Console (see Azure credentials) must have access to the subscription. --region is the region of the storage account and can differ from the resource group's region.
The name becomes the storage account name, so use 3-24 lowercase letters and digits. The UI sends no encryption or lock-mode field for Azure, so the script has none. Azure encrypts data at rest by default. Like AWS, the call returns a job ID.
./create-storagegrid-bucket.sh --list-credentials
./create-storagegrid-bucket.sh --bucket "<bucket_name>" --credential-name "<credential_name>" --object-lock --dry-run
./create-storagegrid-bucket.sh --bucket "<bucket_name>" --credential-name "<credential_name>" --object-lockThe Console API calls StorageGRID SGWS. The credential must exist first, see StorageGRID credentials. With --credential-id instead of --credential-name, the lookup is skipped. The call returns a job ID, like AWS and Azure.
For third-party S3-compatible object storage. This needs a Backup and Recovery version that supports S3-compatible storage.
./create-s3-compatible-bucket.sh --list-credentials
./create-s3-compatible-bucket.sh --bucket "<bucket_name>" --credential-name "<credential_name>" --object-lock --dry-run
./create-s3-compatible-bucket.sh --bucket "<bucket_name>" --credential-name "<credential_name>" --object-lockThe Console API calls this provider S3_COMPATIBLE. The credential, with the S3 endpoint and the access and secret keys, must exist first, see S3-compatible credentials. With --credential-id instead of --credential-name, the lookup is skipped. The call returns a job ID.
list-buckets.sh is read-only and lists the buckets that already exist in Backup and Recovery, per provider:
./list-buckets.sh # all providers
./list-buckets.sh --provider ONTAP_S3 # one provider: AWS, AZURE, ONTAP_S3, SGWS or S3_COMPATIBLE
./list-buckets.sh --json | jq '.[] | {provider, credential, buckets: (.buckets | length)}'ONTAP S3, StorageGRID and S3-compatible are queried once per credential (the provider plus credential-id query that the bucket scripts use for --wait), so the output shows which credential each bucket belongs to. AWS is queried once per AWS account known to the Console with provider=AWS&aws-account-id=<aws account id> (the call the Console UI makes), or for one account with --aws-account-id. The AWS list shows the S3 buckets of the AWS account that the Console can see, including buckets that were never used as backup targets, and the response carries no region. Azure needs the subscription and the resource group (the API answers "AZURE resource-group and subscription query parameters are required to list Azure storage accounts"), so pass --subscription-id (or --subscription-name) and --resource-group, for example ./list-buckets.sh --provider AZURE --subscription-name "<name>" --resource-group "<rg>" (tested 2026-10-28). Use create-azure-storage-account.sh --list-subscriptions and --list-resource-groups to find the values, and --debug to print each request URL. The text output shows the bucket name, region and creation time (- when the API does not return a field). An object-lock column appears only for providers whose list response carries an object_lock field. The Azure response does not (it returns object_store_name, creation_time, region, provider, resource_group and subscription), so the list cannot tell you whether an Azure bucket has object lock. --json prints the raw bucket objects. A provider that fails, for example because the Backup and Recovery version does not support it yet, is reported on its own line and does not stop the others.
curl -sS --get "${CONSOLE_API}/backup-recovery/organizations/${ACCOUNT_ID}/v1/object-storage" \
--header "Authorization: Bearer ${ACCESS_TOKEN}" \
--header "X-Agent-Id: ${AGENT_ID}" \
--data-urlencode "provider=<ONTAP_S3|AWS|AZURE|SGWS|S3_COMPATIBLE>" \
--data-urlencode "credential-id=<credential_id>" | jq '.[].object_store_name'The credential-id filter applies to ONTAP S3. I have not confirmed which filter parameters AWS accepts. The summary call GET .../v1/object-storage-summary shows bucket counts per provider.