Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Nesta página, descrevemos como criar um repositório de backup
para máquinas virtuais (VMs) no Google Distributed Cloud (GDC) isolado por air-gap.
Antes de criar backups ou snapshots, defina pelo menos um repositório de backup que possa ser compartilhado entre vários backups ou snapshots. Um
repositório de backup informa ao sistema de backup onde armazenar ou recuperar backups.
Os repositórios de backup para VMs são restritos ao servidor da API Management.
Antes de começar
Para criar um repositório de backup, você precisa ter o seguinte:
Administrador de backup da organização: gerencia recursos de backup, como planos de backup e
restauração em clusters de usuário. Peça ao administrador do IAM da organização para conceder a você o papel de Administrador de backup da organização (organization-backup-admin). Para mais informações, consulte Definições de papéis.
Criar um repositório de backup
Crie um repositório usando o console do GDC ou a API.
Console
Faça login no console do GDC.
No menu de navegação, clique em Backup para máquinas virtuais > Repositórios.
Clique em Criar repositório.
Insira um nome e uma descrição opcional para o repositório.
No campo Endpoint do URI do S3, insira um endpoint com o nome de domínio totalmente qualificado do seu site de armazenamento de objetos.
No campo Nome do bucket, insira o nome do bucket.
No campo Região do bucket, insira a região em que o bucket foi criado.
Na lista ID da chave de acesso, insira o ID da chave de acesso.
No campo Chave de acesso, insira a chave de acesso.
Clique em Criar.
API
Crie um recurso personalizado ClusterBackupRepository usando suas credenciais.
Adicione as credenciais (access-key e access-key-id) ao servidor da API Management como um secreto para se comunicar com um bucket de armazenamento que pode ser usado para fazer backup e restaurar várias VMs diferentes. Esse segredo é adicionado ao servidor da API Management para automatizar operações de backup e restauração. Esse segredo
não existe em nenhuma das VMs que estão sendo incluídas no backup ou restauradas. As credenciais precisam ser semelhantes ao exemplo a seguir:
STORAGE_NAMESPACE: o namespace do secret que contém as credenciais de acesso do endpoint, como object-storage-secret-ns.
STORAGE_NAME: o nome do secret que contém as credenciais de acesso para o endpoint, como object-storage-secret.
ENDPOINT: o nome de domínio totalmente qualificado do sistema de armazenamento, como https://objectstorage.google.gdch.test. Para o campo type, apenas o valor S3 é aceito.
BUCKET_NAME: o nome do bucket
REGION: a região em que o bucket foi criado.
FORCE_PATH_STYLE: use o campo forcePathStyle para forçar URLs de estilo de caminho para objetos. Esse campo precisa ter um valor de true ou false.
IMPORT_POLICY: defina como uma das seguintes opções:
ReadWrite: esse repositório pode ser usado para programar ou criar backups, planos de backup e restaurações.
ReadOnly: esse repositório só pode ser usado para importar e visualizar backups. Nenhum novo backup ou recurso pode ser criado nesse repositório, mas as restaurações podem usar e referenciar backups somente leitura. Não há restrição quanto à frequência com que um repositório de backup pode ser usado como ReadOnly.
O ClusterBackupRepository cria um recurso BackupRepository ativado para leitura e gravação no servidor da API Management com o mesmo nome.
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-09-04 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)"]]