Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Questa pagina descrive come creare un repository di backup
per le macchine virtuali (VM) in Google Distributed Cloud (GDC) air-gapped.
Prima di creare backup o snapshot, devi definire almeno un repository di backup che possa essere condiviso tra più backup o snapshot. Un
repository di backup indica al sistema di backup dove archiviare o recuperare i backup.
I repository di backup per le VM sono limitati al server API Management.
Prima di iniziare
Per creare un repository di backup, devi disporre di:
Amministratore dei backup dell'organizzazione: gestisce le risorse di backup come i piani di backup e ripristino nei cluster utente. Chiedi all'amministratore IAM dell'organizzazione di concederti
il ruolo Amministratore backup organizzazione (organization-backup-admin). Per ulteriori informazioni, consulta Definizioni dei ruoli.
Crea un repository di backup
Crea un repository utilizzando la console GDC o l'API.
Console
Accedi alla console GDC.
Nel menu di navigazione, fai clic su Backup for Virtual Machines > Repository.
Fai clic su Crea repository.
Inserisci un nome del repository e una descrizione facoltativa.
Nel campo Endpoint URI S3, inserisci un endpoint con il nome di dominio completo del tuo sito di archiviazione degli oggetti.
Nel campo Nome bucket, inserisci il nome del bucket.
Nel campo Regione bucket, inserisci la regione in cui è stato creato il bucket.
Nell'elenco ID chiave di accesso, inserisci l'ID chiave di accesso.
Nel campo Chiave di accesso, inserisci la chiave di accesso.
Fai clic su Crea.
API
Crea una risorsa personalizzata ClusterBackupRepository utilizzando le tue credenziali.
Aggiungi le credenziali (access-key e access-key-id) al server Management API come secret per comunicare con un bucket di archiviazione che puoi utilizzare per eseguire il backup e il ripristino di molte VM diverse. Questo secret viene aggiunto
al server dell'API Management per automatizzare le operazioni di backup e ripristino. Questo secret
non esiste in nessuna delle VM di cui viene eseguito il backup o il ripristino. Le credenziali devono essere simili all'esempio seguente:
REPOSITORY_NAME: il nome del repository di backup.
STORAGE_NAMESPACE: lo spazio dei nomi del secret che contiene le credenziali di accesso per l'endpoint, ad esempio object-storage-secret-ns.
STORAGE_NAME: il nome del secret che contiene le credenziali di accesso per l'endpoint, ad esempio object-storage-secret.
ENDPOINT: il nome di dominio completo del sistema di archiviazione, ad esempio https://objectstorage.google.gdch.test. Per il campo type, è supportato solo il valore S3
BUCKET_NAME: il nome del bucket.
REGION: la regione in cui è stato creato il bucket.
FORCE_PATH_STYLE: utilizza il campo forcePathStyle per forzare gli URL in stile percorso per gli oggetti. Questo campo deve avere un valore pari a true o false.
IMPORT_POLICY: impostato su uno dei seguenti valori:
ReadWrite: questo repository può essere utilizzato per pianificare o creare backup, piani di backup e ripristini.
ReadOnly: questo repository può essere utilizzato solo per importare e visualizzare i backup. Non è possibile creare nuovi backup o risorse in questo repository, ma i ripristini possono utilizzare e fare riferimento ai backup di sola lettura per il ripristino. Non esistono limitazioni alla frequenza con cui un repository di backup può essere utilizzato come ReadOnly.
ClusterBackupRepository crea una risorsa BackupRepository abilitata alla lettura/scrittura nel server API Management con lo stesso nome.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 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)"]]