Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
Cette page explique comment sauvegarder des machines virtuelles (VM) tout en respectant les principes de sauvegarde et de restauration isolées de Google Distributed Cloud (GDC).
Il contient également des instructions sur la façon d'afficher la liste des sauvegardes de VM et de supprimer les sauvegardes de VM existantes.
Avant de commencer
Pour sauvegarder des VM, vous devez disposer des éléments suivants :
Un dépôt de sauvegarde et un plan de sauvegarde existants. Une sauvegarde manuelle doit faire référence à un plan de sauvegarde existant pour la configuration de la sauvegarde.
Rôles d'identité et d'accès nécessaires :
Administrateur VirtualMachine du projet : gère les VM dans l'espace de noms du projet. Demandez à votre administrateur IAM de projet de vous attribuer le rôle Administrateur de machines virtuelles du projet (project-vm-admin).
Backup Creator : crée des sauvegardes manuelles et les restaure. Demandez à l'administrateur IAM du projet de vous accorder le rôle Créateur de sauvegardes (backup-creator).
Lecteur du projet : dispose d'un accès en lecture seule à toutes les ressources des espaces de noms du projet. Demandez à votre administrateur IAM de projet de vous attribuer le rôle Lecteur de projet (project-viewer).
Sauvegarder manuellement des VM
Sauvegardez les VM à l'aide de la console GDC ou de l'API.
Console
Connectez-vous à la console GDC.
Dans le menu de navigation, cliquez sur Sauvegarde pour les machines virtuelles.
Sélectionnez un projet.
Cliquez sur l'onglet Sauvegardes.
Cliquez sur Créer une sauvegarde.
Dans le champ de l'instance VM source, sélectionnez la VM que vous souhaitez sauvegarder.
Saisissez un nom pour la sauvegarde.
Dans le champ Plan de sauvegarde, sélectionnez le plan de sauvegarde pour lequel vous souhaitez créer une sauvegarde.
Cliquez sur Créer.
API
Émettez une demande de sauvegarde de machine virtuelle pour lancer une sauvegarde :
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/09/04 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Difficile à comprendre","hardToUnderstand","thumb-down"],["Informations ou exemple de code incorrects","incorrectInformationOrSampleCode","thumb-down"],["Il n'y a pas l'information/les exemples dont j'ai besoin","missingTheInformationSamplesINeed","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 2025/09/04 (UTC)."],[[["\u003cp\u003eThis page provides instructions on how to manually back up virtual machines (VMs) within the Google Distributed Cloud (GDC) environment, using either the GDC console or the API.\u003c/p\u003e\n"],["\u003cp\u003eTo perform VM backups, users must have an existing backup repository and plan, along with specific identity and access roles such as Project VirtualMachine Admin and Backup Creator.\u003c/p\u003e\n"],["\u003cp\u003eThe document explains how to view a list of existing VM backups and their details through both the GDC console interface and the \u003ccode\u003ekubectl\u003c/code\u003e command-line tool.\u003c/p\u003e\n"],["\u003cp\u003eUsers can delete VM backups via the GDC console or by using \u003ccode\u003ekubectl\u003c/code\u003e to issue a \u003ccode\u003eVirtualMachineDeleteBackupRequest\u003c/code\u003e, following a process to select and confirm the deletion of backups.\u003c/p\u003e\n"]]],[],null,["# Back up VMs\n\nThis page describes how to back up virtual machines (VMs) while adhering to Google Distributed Cloud (GDC) air-gapped backup and restore principles.\nIt also contains instructions on how to view a list of VM backups, and delete existing VM backups.\n\nBefore you begin\n----------------\n\nTo back up VMs, you must have the following:\n\n- An existing [backup repository and backup plan](/distributed-cloud/hosted/docs/latest/gdch/platform/pa-user/backup-plan-vm). A manual backup must reference an existing backup plan for the backup configuration.\n- The necessary identity and access roles:\n\n - Project VirtualMachine Admin: manages VMs in the project namespace. Ask your Project IAM Admin to grant you the Project VirtualMachine Admin (`project-vm-admin`) role.\n - Backup Creator: creates manual backups and restores. Ask your Project IAM Admin to grant you the Backup Creator (`backup-creator`) role.\n - Project Viewer: has read-only access to all resources within project namespaces. Ask your Project IAM Admin to grant you the Project Viewer (`project-viewer`) role.\n\nManually back up VMs\n--------------------\n\nBack up VMs using either 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**.\n3. Select a project.\n4. Click the **Backups** tab.\n5. Click **Create a backup**.\n6. In the **Source VM** instance field, select the VM that you want to back up.\n7. Enter a **Name** for the backup.\n8. In the **Backup plan** field, select the backup plan for which you want to to create a backup.\n9. Click **Create**.\n\n### API\n\nIssue a virtual machine backup request to initiate a backup: \n\n apiVersion: virtualmachine.gdc.goog/v1\n kind: VirtualMachineBackupRequest\n metadata:\n name: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eBACKUP_REQUEST_NAME\u003c/span\u003e\u003c/var\u003e\n spec:\n virtualMachineBackupPlanTemplate: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eVM_BACKUP_PLAN_TEMPLATE\u003c/span\u003e\u003c/var\u003e\n virtualMachine: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eVM_NAME\u003c/span\u003e\u003c/var\u003e\n virtualMachineBackupName: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eVM_BACKUP_NAME\u003c/span\u003e\u003c/var\u003e\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eBACKUP_REQUEST_NAME\u003c/var\u003e: name to give the backup request that is being initiated.\n- \u003cvar translate=\"no\"\u003eVM_BACKUP_PLAN_TEMPLATE\u003c/var\u003e: the name of the `VirtualMachineBackupPlanTemplate` resource to use for configuration of the backup.\n- \u003cvar translate=\"no\"\u003eVM_NAME\u003c/var\u003e: the name of the VM to back up.\n- \u003cvar translate=\"no\"\u003eVM_BACKUP_NAME\u003c/var\u003e: the name of the backup to create.\n\nView VM backups\n---------------\n\nView a list of VM backups using the GDC console or `kubectl`. \n\n### Console\n\n1. Sign into the GDC console.\n2. In the navigation menu, click **Backup for Virtual Machines**.\n3. Select a project.\n4. Click the **Backups** tab.\n5. Click a backup in the list to view its details.\n\n### kubectl\n\nView a VM backup by listing the backups and viewing their details.\n\n1. List the existing backups:\n\n kubectl get virtualmachinebackups.virtualmachine.gdc.goog -n \u003cvar translate=\"no\"\u003ePROJECT_NAME\u003c/var\u003e\n\n Replace \u003cvar translate=\"no\"\u003ePROJECT_NAME\u003c/var\u003e with the name of the project.\n2. In the list, find the backup that you want to view.\n\n3. View the backup details:\n\n kubectl describe virtualmachinebackup.virtualmachine.gdc.goog \u003cvar translate=\"no\"\u003eVM_BACKUP_NAME\u003c/var\u003e -n \u003cvar translate=\"no\"\u003ePROJECT_NAME\u003c/var\u003e\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eVM_BACKUP_NAME\u003c/var\u003e: the name of the backup.\n - \u003cvar translate=\"no\"\u003ePROJECT_NAME\u003c/var\u003e: the name of the project.\n\nDelete a VM backup\n------------------\n\nDelete VM backups by using the GDC console or `kubectl`. \n\n### Console\n\n1. Sign in to the GDC console.\n2. In the navigation menu, click **Backup for Virtual Machines**.\n3. Select a project.\n4. Click the **Backups** tab.\n5. In the list of backups, find the backup to delete and click **Delete Backup**.\n6. In the **Backup name** field, enter the name of the backup to delete.\n7. Click **Delete Backup**.\n\n### kubectl\n\nDelete a VM backup using `kubectl`.\n\n1. List the existing VM backups:\n\n kubectl get virtualmachinebackups.virtualmachine.gdc.goog -n \u003cvar translate=\"no\"\u003ePROJECT_NAME\u003c/var\u003e\n\n Replace \u003cvar translate=\"no\"\u003ePROJECT_NAME\u003c/var\u003e with the name of the project.\n2. In the list, find the backup that you want to delete.\n\n3. Issue a `VirtualMachineDeleteBackupRequest` to delete the backup:\n\n apiVersion: virtualmachine.gdc.goog/v1\n kind: VirtualMachineDeleteBackupRequest\n metadata:\n name: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eDELETE_BACKUP_REQUEST_NAME\u003c/span\u003e\u003c/var\u003e\n namespace: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003ePROJECT_NAME\u003c/span\u003e\u003c/var\u003e\n spec:\n virtualMachineBackupRef:\n name: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eVM_BACKUP_NAME\u003c/span\u003e\u003c/var\u003e\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eDELETE_BACKUP_REQUEST_NAME\u003c/var\u003e: the name to give the `VirtualMachineDeleteBackupRequest` that is being initiated.\n - \u003cvar translate=\"no\"\u003eVM_BACKUP_NAME\u003c/var\u003e: the name of the backup to delete.\n - \u003cvar translate=\"no\"\u003ePROJECT_NAME\u003c/var\u003e: the name of the project.\n\nWhat's next\n-----------\n\n- [Create a VM from a backup](/distributed-cloud/hosted/docs/latest/gdch/platform-application/pa-ao-operations/vm-backup/create-vm-from-backup)"]]