Restaurar uma instância do Compute Engine de um cofre de backup
Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Esta página ajuda você a restaurar uma instância do Compute Engine de um cofre de backup no console Google Cloud .
Antes de começar
Conceda o papel do IAM de operador de Backup e DR do Compute Engine (roles/backupdr.computeEngineOperator)
ao agente de serviço do backup vault do vault no projeto de destino em que
o backup está sendo realizado.
Conceda o papel de IAM Usuário de rede do Compute (roles/compute.networkUser)
para o agente de serviço do cofre de backup
do cofre no projeto host da VPC se você estiver usando a VPC compartilhada.
Conceda os seguintes papéis do IAM ao usuário que realiza a
restauração no projeto do cofre de backup.
Backup and DR Restore User (roles/backupdr.restoreUser) para o cofre de backup e o projeto de destino.
Use o leitor do Compute (roles/compute.viewer) apenas para o destino.
Esses papéis predefinidos contêm as permissões necessárias para acessar o
backup vault no projeto do Compute Engine. Para permissões específicas,
consulte a lista a seguir.
Todas as instâncias do Compute Engine com backups no cofre estão listadas aqui.
Clique no ícone de ação para selecionar a ação Restaurar. A página de restauração é mostrada para que você selecione as seguintes opções de restauração:
Selecione um Nome do recurso.
Selecione um Horário de criação do backup.
Selecione o Nome do projeto em que você quer restaurar a VM.
Clique em Proceed.
A próxima página Criar uma nova instância de VM usando um backup aparece, e as propriedades da VM são preenchidas com base nas propriedades da VM de origem. É possível modificar as propriedades para criar uma nova VM, por exemplo, mudar a seleção de Região ou Tipo de máquina.
Clique em Criar para criar uma nova VM com o backup selecionado.
gcloud
Se ainda não tiver sido concedido, conceda o papel de IAM Operador de backup e DR do Compute Engine (roles/backupdr.computeEngineOperator) ao agente de serviço do backup vault no projeto de recuperação em que a VM está sendo recuperada.
Para acessar a conta de serviço do cofre de backup, use o seguinte comando.
[[["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 guide details the process of restoring a Compute Engine instance from a backup vault within the Google Cloud console, providing step-by-step instructions for both console and gcloud methods.\u003c/p\u003e\n"],["\u003cp\u003eBefore initiating a restore, you must grant specific IAM roles, including Backup and DR Compute Engine Operator, Compute Network User, and Backup and DR Restore User, to the appropriate service agents and users.\u003c/p\u003e\n"],["\u003cp\u003eThe console method involves navigating to the Vaulted backups page, selecting the instance and backup creation time, and then creating a new VM with pre-populated properties that can be customized.\u003c/p\u003e\n"],["\u003cp\u003eThe gcloud method requires using specific commands, including options to restore VMs in the same project or to custom configurations with service accounts and network details.\u003c/p\u003e\n"],["\u003cp\u003eThis documentation also provides information on additional related steps, including creating a backup plan for vaulted backups, checking for cloud credentials, and mounting backup images.\u003c/p\u003e\n"]]],[],null,["# Restore a Compute Engine instance from a backup vault\n\nThis page helps you to restore a Compute Engine instance from a backup vault in the Google Cloud console.\n\nBefore you begin\n----------------\n\n- Grant the Backup and DR Compute Engine Operator (`roles/backupdr.computeEngineOperator`)\n IAM role for the [backup vault service agent](/backup-disaster-recovery/docs/cloud-console/backup-vault-create#service-agent) of the vault in the target project where\n restore is being performed.\n\n- Grant the Compute Network User (`roles/compute.networkUser`) IAM\n role for the [backup vault service agent](/backup-disaster-recovery/docs/cloud-console/backup-vault-create#service-agent)\n of the vault in the VPC host project if you are using Shared VPC.\n\n- Grant the following IAM roles for the user who performs the\n restore in the backup vault project.\n\n - Backup and DR Restore User (`roles/backupdr.restoreUser`) for both backup vault and target project.\n - Compute Viewer (`roles/compute.viewer`) for only the target.\n\n These predefined roles contain the permissions required to access the\n backup vault in the Compute Engine project. For specific permissions,\n see the following list.\n - `backupdr.bvbackups.restore`\n - `backupdr.compute.restoreFromBackupVault`\n - `backupdr.backupVaults.get`\n - `backupdr.backupVaults.list`\n - `backupdr.bvbackups.list`\n - `backupdr.bvdataSources.get`\n - `backupdr.bvdataSources.list`\n - `backupdr.bvbackups.get`\n\n For more information about granting roles, see [Manage access to projects, folders, and organizations](/iam/docs/granting-changing-revoking-access).\n\nRestore a Compute Engine instance\n---------------------------------\n\nUse the following instructions to restore a VM instance. \n\n### Console\n\n1. In the Google Cloud console, go to the **Vaulted backups** page.\n\n [Go to Vaulted backups](https://console.cloud.google.com/backupdr/vaulted-backups)\n\n All Compute Engine instances with vaulted backups are listed here.\n2. Click the action icon to select the **Restore** action. The **Restore page** displays where you select the following restore options:\n\n - Select a **Resource name**.\n - Select a **Backup creation time**.\n - Select the **Project name** into which you want to restore the VM.\n3. Click **Proceed**.\n\n - The next page **Create a new VM instance from a backup** appears, where the VM properties are pre-populated based on the source VM properties. You can modify the properties to create a new VM, for example, change the selection for **Region** or **Machine Type**.\n4. Click **Create** to create a new VM from the selected backup.\n\n | **Note:** You can view and monitor the restore jobs in the **Backup and DR** \\\u003e **Jobs** page.\n\n### gcloud\n\n1. If not already granted, grant the Backup and DR Compute Engine Operator (`roles/backupdr.computeEngineOperator`) IAM role to the backup vault service agent in the recovery project where the VM is being recovered.\n\n2. To get the backup vault service account, use the following command.\n\n gcloud backup-dr backup-vaults describe \u003cvar translate=\"no\"\u003eBACKUPVAULT_NAME\u003c/var\u003e\n --location=\u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eBACKUPVAULT_NAME\u003c/var\u003e: the backup vault name you want to restore data from.\n - \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: the location of the backup vault.\n3. To restore a VM instance, use the following commands.\n\n - Restore a VM in the same project as the workload project with backup ID.\n\n gcloud backup-dr backups restore compute test-backup-id \\\n --project=\u003cvar translate=\"no\"\u003ePROJECT\u003c/var\u003e --location=\u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e \\\n --backup-vault=\u003cvar translate=\"no\"\u003eBACKUPVAULT_NAME\u003c/var\u003e --data-source=\u003cvar translate=\"no\"\u003eDATA_SOURCE\u003c/var\u003e\\\n --name=\u003cvar translate=\"no\"\u003eNAME\u003c/var\u003e --target-zone=\u003cvar translate=\"no\"\u003eTARGET_ZONE\u003c/var\u003e \\\n --target-project=\u003cvar translate=\"no\"\u003eTARGET_PROJECT\u003c/var\u003e\n\n - Restore a VM in the same project as the workload project with backup full resource URL.\n\n gcloud backup-dr backups restore compute projects/test-project-id/locations/us-central1/backupVaults/test-vault/dataSources/test-ds/backups/test-backup-id \\\n --name=\u003cvar translate=\"no\"\u003eNAME\u003c/var\u003e --target-zone=\u003cvar translate=\"no\"\u003eTARGET_ZONE\u003c/var\u003e \\\n --target-project=\u003cvar translate=\"no\"\u003eTARGET_PROJECT\u003c/var\u003e\n\n - Restore a VM instance with custom service-account and network configuration.\n\n gcloud backup-dr backups restore compute test-backup-id \\\n --project=\u003cvar translate=\"no\"\u003ePROJECT\u003c/var\u003e --location=\u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e \\\n --backup-vault=\u003cvar translate=\"no\"\u003eBACKUPVAULT_NAME\u003c/var\u003e --data-source=\u003cvar translate=\"no\"\u003eDATA_SOURCE\u003c/var\u003e\\\n --name=\u003cvar translate=\"no\"\u003eNAME\u003c/var\u003e --target-zone=\u003cvar translate=\"no\"\u003eTARGET_ZONE\u003c/var\u003e \\\n --target-project=\u003cvar translate=\"no\"\u003eTARGET_PROJECT\u003c/var\u003e \\\n --network-interface=network=\u003cvar translate=\"no\"\u003eNETWORK\u003c/var\u003e,subnet=\u003cvar translate=\"no\"\u003eSUBNET\u003c/var\u003e \\\n --service-account=\u003cvar translate=\"no\"\u003eSERVICE_ACCOUNT\u003c/var\u003e \\\n --scopes=\u003cvar translate=\"no\"\u003eSCOPE\u003c/var\u003e\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003ePROJECT\u003c/var\u003e: the name of the backup vault project.\n - \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: the location of the backup vault.\n - \u003cvar translate=\"no\"\u003eBACKUPVAULT_NAME\u003c/var\u003e: the backup vault name you want to restore data from.\n - \u003cvar translate=\"no\"\u003eDATA_SOURCE\u003c/var\u003e: the data source name you want to restore data from.\n - \u003cvar translate=\"no\"\u003eNAME\u003c/var\u003e: the name of the restored VM.\n - \u003cvar translate=\"no\"\u003eTARGET_ZONE\u003c/var\u003e: the region the VM is restored in.\n - \u003cvar translate=\"no\"\u003eTARGET_PROJECT\u003c/var\u003e: the project the VM is restored in.\n - \u003cvar translate=\"no\"\u003eNETWORK\u003c/var\u003e: the network URI of the VM.\n - \u003cvar translate=\"no\"\u003eSUBNET\u003c/var\u003e: the subnet URI of the VM.\n - \u003cvar translate=\"no\"\u003eSERVICE_ACCOUNT\u003c/var\u003e: the service account of the restored VM.\n - \u003cvar translate=\"no\"\u003eSCOPE\u003c/var\u003e: the authorization scope of the service account.\n\nTo override other VM properties, see [Overview of Backup and DR Service Google Cloud CLI commands](https://cloud.google.com/sdk/gcloud/reference/alpha/backup-dr/backups/restore).\n\nThe Backup and DR Compute Engine guide\n--------------------------------------\n\n- [Create and manage a backup plan for vaulted backups](/backup-disaster-recovery/docs/cloud-console/backup-plan-create)\n- [Check for the cloud credentials](/backup-disaster-recovery/docs/configuration/create-cloud-credentials)\n- [Discover and protect Compute Engine instances](/backup-disaster-recovery/docs/configuration/discover-and-protect-ce-inst)\n- [Mount backup images of Compute Engine Persistent Disk](/backup-disaster-recovery/docs/access-data/mount-snapshot-images-of-cloud-instances)\n- [Restore a Compute Engine instance](/backup-disaster-recovery/docs/restore-data/restore-instance)\n- [Import Persistent Disk snapshot images](/backup-disaster-recovery/docs/configuration/import-pdsnapshot-images)"]]