Stay organized with collections
Save and categorize content based on your preferences.
This page describes how to create a backup repository
for virtual machines (VMs) in Google Distributed Cloud (GDC) air-gapped.
Before creating backups or snapshots, you must define at least one
backup repository that can be shared among several backups or snapshots. A
backup repository tells the backup system where to store or retrieve backups.
Backup repositories for VMs are restricted to Management API server.
Before you begin
To create a backup repository, you must have the following:
Organization Backup Admin: manages backup resources such as backup and
restore plans in user clusters. Ask your Organization IAM Admin to grant you
the Organization Backup Admin (organization-backup-admin) role. For more
information, see Role
definitions.
Create a backup repository
Create a repository using the GDC console or the API.
Console
Sign into the GDC console.
In the navigation menu, click Backup for Virtual Machines > Repositories.
Click Create repository.
Enter a repository name and an optional description.
In the S3 URI endpoint field, enter an endpoint with the fully-qualified
domain name of your object storage site.
In the Bucket name field, enter the name of the bucket.
In the Bucket region field, enter the region where the bucket was
created.
In the Access Key ID list, enter the access key ID.
In the Access key field, enter the access key.
Click Create.
API
Create a ClusterBackupRepository custom resource using your credentials.
Add the credentials (access-key and access-key-id) to the Management API server as a secret to communicate with a storage bucket that you can
use to backup and restore many different VMs. This secret is added
to the Management API server to automate backup and restore operations. This secret
doesn't exist inside any of the VMs being backed up or restored. The credentials must look like the following example:
REPOSITORY_NAME: the name of the backup repository.
STORAGE_NAMESPACE: the namespace for the secret that contains access credentials for the endpoint, such as object-storage-secret-ns.
STORAGE_NAME: the name of the secret that contains access credentials for the endpoint, such as object-storage-secret.
ENDPOINT: the fully qualified domain name for the storage system, such as https://objectstorage.google.gdch.test. For the type field, only a value of S3 is supported
BUCKET_NAME: the name of the bucket.
REGION: the region where the bucket was created.
FORCE_PATH_STYLE: Use the forcePathStyle field to force path style URLs for objects. This field must have a value of true or false.
IMPORT_POLICY: Set to one of the following:
ReadWrite: This repository can be used to schedule or create backups, backup plans, and restores.
ReadOnly: This repository can only be used to import and view backups. No new backups or resources can be created in this repository, but restores can use and reference read-only backups for restoration. There is no restriction on how often a backup repository can be used as ReadOnly.
The ClusterBackupRepository creates a read-write enabled BackupRepository resource in the Management API server that has the same name.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-29 UTC."],[[["\u003cp\u003eThis page details the process of creating a backup repository for virtual machines (VMs) within Google Distributed Cloud (GDC) air-gapped environments.\u003c/p\u003e\n"],["\u003cp\u003eCreating a backup repository is a prerequisite for initiating any VM backups or snapshots, serving as the designated storage location.\u003c/p\u003e\n"],["\u003cp\u003eUsers can create a backup repository either through the GDC console or by utilizing the API, requiring specific storage bucket and S3 credentials.\u003c/p\u003e\n"],["\u003cp\u003eThe API method involves adding storage access credentials as a secret to the Management API server and then creating a \u003ccode\u003eClusterBackupRepository\u003c/code\u003e with endpoint, bucket, and region details.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eimportPolicy\u003c/code\u003e field in the API allows for defining the repository's access as either \u003ccode\u003eReadWrite\u003c/code\u003e, allowing backups and restores, or \u003ccode\u003eReadOnly\u003c/code\u003e, allowing only viewing backups and restoring from them.\u003c/p\u003e\n"]]],[],null,["# Create a backup repository\n\nThis page describes how to create a backup repository\nfor virtual machines (VMs) in Google Distributed Cloud (GDC) air-gapped.\n\nBefore creating backups or snapshots, you must define at least one\nbackup repository that can be shared among several backups or snapshots. A\nbackup repository tells the backup system where to store or retrieve backups.\nBackup repositories for VMs are restricted to Management API server.\n\nBefore you begin\n----------------\n\nTo create a backup repository, you must have the following:\n\n- [A storage bucket and S3 credentials](/distributed-cloud/hosted/docs/latest/gdch/platform/pa-user/create-storage-buckets) for the bucket.\n- The necessary identity and access role:\n\n - Organization Backup Admin: manages backup resources such as backup and restore plans in user clusters. Ask your Organization IAM Admin to grant you the Organization Backup Admin (`organization-backup-admin`) role. For more information, see [Role\n definitions](/distributed-cloud/hosted/docs/latest/gdch/platform/pa-user/iam/role-definitions).\n\nCreate a backup repository\n--------------------------\n\nCreate a repository using the GDC console or the API. \n\n### Console\n\n1. Sign into the GDC console.\n2. In the navigation menu, click **Backup for Virtual Machines \\\u003e Repositories**.\n3. Click **Create repository**.\n4. Enter a repository name and an optional description.\n5. In the **S3 URI endpoint** field, enter an endpoint with the fully-qualified domain name of your object storage site.\n6. In the **Bucket name** field, enter the name of the bucket.\n7. In the **Bucket region** field, enter the region where the bucket was created.\n8. In the **Access Key ID** list, enter the access key ID.\n9. In the **Access key** field, enter the access key.\n10. Click **Create**.\n\n### API\n\n\nCreate a `ClusterBackupRepository` custom resource using your credentials.\n\n1. Add the credentials (`access-key` and `access-key-id`) to the Management API server as a secret to communicate with a storage bucket that you can\n use to backup and restore many different VMs. This secret is added\n to the Management API server to automate backup and restore operations. This secret\n doesn't exist inside any of the VMs being backed up or restored. The credentials must look like the following example:\n\n apiVersion: v1\n kind: Namespace\n metadata:\n name: \"s3-secret-ns\"\n labels:\n name: \"s3-secret-ns\"\n ---\n apiVersion: v1\n kind: Secret\n metadata:\n namespace: \"s3-secret-ns\"\n name: \"s3-secret\"\n type: Opaque\n data:\n access-key-id: YWNjZXNzS2V5MQ== # echo -n accessKey1 | base64 -w0\n access-key: dmVyeVNlY3JldEtleTE= # echo -n verySecretKey1 | base64 -w0\n\n2. Create a `ClusterBackupRepository` directly in the Management API server:\n\n apiVersion: backup.gdc.goog/v1\n kind: ClusterBackupRepository\n metadata:\n name: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eREPOSITORY_NAME\u003c/span\u003e\u003c/var\u003e\n spec:\n secretReference:\n namespace: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eSTORAGE_NAMESPACE\u003c/span\u003e\u003c/var\u003e\n name: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eSTORAGE_NAME\u003c/span\u003e\u003c/var\u003e\n endpoint: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eENDPOINT\u003c/span\u003e\u003c/var\u003e\n type: \"S3\"\n s3Options:\n bucket: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eBUCKET_NAME\u003c/span\u003e\u003c/var\u003e\n region: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eREGION\u003c/span\u003e\u003c/var\u003e\n forcePathStyle: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eFORCE_PATH_STYLE\u003c/span\u003e\u003c/var\u003e\n importPolicy: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eIMPORT_POLICY\u003c/span\u003e\u003c/var\u003e\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eREPOSITORY_NAME\u003c/var\u003e: the name of the backup repository.\n - \u003cvar translate=\"no\"\u003eSTORAGE_NAMESPACE\u003c/var\u003e: the namespace for the secret that contains access credentials for the endpoint, such as `object-storage-secret-ns`.\n - \u003cvar translate=\"no\"\u003eSTORAGE_NAME\u003c/var\u003e: the name of the secret that contains access credentials for the endpoint, such as `object-storage-secret`.\n - \u003cvar translate=\"no\"\u003eENDPOINT\u003c/var\u003e: the fully qualified domain name for the storage system, such as `https://objectstorage.google.gdch.test`. For the `type` field, only a value of `S3` is supported\n - \u003cvar translate=\"no\"\u003eBUCKET_NAME\u003c/var\u003e: the name of the bucket.\n - \u003cvar translate=\"no\"\u003eREGION\u003c/var\u003e: the region where the bucket was created.\n - \u003cvar translate=\"no\"\u003eFORCE_PATH_STYLE\u003c/var\u003e: Use the `forcePathStyle` field to force path style URLs for objects. This field must have a value of `true` or `false`.\n - \u003cvar translate=\"no\"\u003eIMPORT_POLICY\u003c/var\u003e: Set to one of the following:\n - `ReadWrite`: This repository can be used to schedule or create backups, backup plans, and restores.\n - `ReadOnly`: This repository can only be used to import and view backups. No new backups or resources can be created in this repository, but restores can use and reference read-only backups for restoration. There is no restriction on how often a backup repository can be used as ReadOnly.\n\n The `ClusterBackupRepository` creates a read-write enabled `BackupRepository` resource in the Management API server that has the same name.\n\nWhat's next\n-----------\n\n- [Manage a backup repository](/distributed-cloud/hosted/docs/latest/gdch/platform-application/pa-ao-operations/vm-backup/manage-backup-repository)"]]