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 uma máquina virtual (VM) de um backup existente no Google Distributed Cloud (GDC) isolado por air-gap.
Depois que um backup é criado, é possível criar uma restauração para ele, que
inicia a restauração de toda a VM. A VM restaurada e os discos associados têm nomes diferentes com base no que você especifica como Novo nome da instância de VM no console do GDC ou restoredResourceName na interface de programação de aplicativos (API).
Quando um backup é restaurado, toda a VM é restaurada. Depois que os recursos são
criados, a restauração da capacidade do aplicativo está sujeita ao sistema operacional
ou à imagem da VM.
Antes de começar
Para criar uma VM com base em um backup, você precisa ter o seguinte:
Administrador de VirtualMachine do projeto: gerencia VMs no namespace do projeto. Peça ao administrador do IAM do projeto para conceder a você o papel de administrador de máquinas virtuais do projeto (project-vm-admin).
Criador de backup: cria backups e restaurações manuais. Peça ao administrador do IAM do projeto para conceder a você o papel de criador de backup (backup-creator).
Leitor do projeto: tem acesso somente leitura a todos os recursos nos namespaces do projeto. Peça ao administrador do IAM do projeto para conceder a você o papel de Leitor do projeto (project-viewer).
Criar uma restauração para VMs
Restaure um backup de VM 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.
Selecione um projeto.
Clique na guia Backups.
Na lista de backups, encontre o backup que você quer restaurar e clique em Restaurar.
No campo Novo nome da instância de VM, insira um nome para a nova instância virtual de destino em que o backup será restaurado.
Opcional: no campo de descrição Nova instância de VM, insira uma descrição.
Insira um Nome para a restauração.
Clique em Restaurar.
API
Defina um recurso personalizado VirtualMachineRestoreRequest para iniciar o processo de restauração. O backup referenciado no campo virtualMachineBackup se refere a um recurso personalizado VirtualMachineBackup gerado por um VirtualMachineBackupRequest. Confira um exemplo de
VirtualMachineRestoreRequest:
Defina um recurso personalizado VirtualMachineRestoreRequest para iniciar o processo de restauração:
[[["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 how to restore a virtual machine (VM) from an existing backup in Google Distributed Cloud (GDC) air-gapped.\u003c/p\u003e\n"],["\u003cp\u003eRestoring a VM from backup creates a new VM instance and disks with a user-defined name, as specified by the "New VM instance name" in the GDC console, or the \u003ccode\u003erestoredResourceName\u003c/code\u003e via API.\u003c/p\u003e\n"],["\u003cp\u003eTo perform a VM restore, you need an existing backup and appropriate access roles, including Project VirtualMachine Admin, Backup Creator, and Project Viewer.\u003c/p\u003e\n"],["\u003cp\u003eYou can initiate the VM restore process either through the GDC console by navigating to "Backup for Virtual Machines" and selecting the "Restore" option, or via the API by defining a \u003ccode\u003eVirtualMachineRestoreRequest\u003c/code\u003e custom resource.\u003c/p\u003e\n"],["\u003cp\u003eRestored VMs and restores can be viewed and deleted through the GDC console or via \u003ccode\u003ekubectl\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Create a VM from a backup\n\nThis page describes how to create a virtual machine (VM) from an existing backup in Google Distributed Cloud (GDC) air-gapped.\n\nAfter a backup is created, you can create a restore for that backup, which\ninitiates the restoration of the entire VM. The restored VM\nand its associated disks have different names based on what you specify as the\n**New VM instance name** in the GDC console, or the\n`restoredResourceName` in the application programming interface (API).\n\nWhen a backup is restored, the entire VM is restored. After the resources are\ncreated, actual restoration of application capability is subject to the VM\noperating system or image.\n\nBefore you begin\n----------------\n\nTo create a VM from a backup you must have the following:\n\n- An existing backup. For more information, see [Create a backup\n plan](/distributed-cloud/hosted/docs/latest/gdch/platform-application/pa-ao-operations/vm-backup/create-backup-plan).\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\nCreate a restore for VMs\n------------------------\n\nRestore a VM backup using the GDC console or the API. \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 that you want to restore and click **Restore**.\n6. In the **New VM instance name** field, enter a name for the new target virtual instance to restore the backup in.\n7. Optional: In the **New VM instance** description field, enter a description.\n8. Enter a **Name** for the restore.\n9. Click **Restore**.\n\n### API\n\nDefine a `VirtualMachineRestoreRequest` custom resource to initiate the restore\nprocess. The referenced backup in the `virtualMachineBackup` field refers to a\n`VirtualMachineBackup` custom resource generated by a\n`VirtualMachineBackupRequest`. Here's an example of a\n`VirtualMachineRestoreRequest`:\n\nDefine a `VirtualMachineRestoreRequest` custom resource to initiate the\nrestore process: \n\n apiVersion: virtualmachine.gdc.goog/v1\n kind: VirtualMachineRestoreRequest\n metadata:\n name: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eRESTORE_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 virtualMachineBackup: \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 restoreName: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eRESTORE_NAME\u003c/span\u003e\u003c/var\u003e\n restoredResourceName: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eRESTORED_RESOURCE_NAME\u003c/span\u003e\u003c/var\u003e\n restoredResourceDescription: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eRESTORED_RESOURCE_DESCRIPTION\u003c/span\u003e\u003c/var\u003e\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eVM_BACKUP_NAME\u003c/var\u003e: the name of the `VirtualMachineBackup` to restore from.\n- \u003cvar translate=\"no\"\u003ePROJECT_NAME\u003c/var\u003e: the name of the GDC project.\n- \u003cvar translate=\"no\"\u003eRESTORE_REQUEST_NAME\u003c/var\u003e: the name to give the restore request that is being initiated.\n- \u003cvar translate=\"no\"\u003eRESTORE_NAME\u003c/var\u003e: name to give the restore that is being initiated.\n- \u003cvar translate=\"no\"\u003eRESTORED_RESOURCE_NAME\u003c/var\u003e: the name to give the restored VM.\n- \u003cvar translate=\"no\"\u003eRESTORED_RESOURCE_DESCRIPTION\u003c/var\u003e: notes for why the restore is being performed.\n\nThe result of the restore creates a new VM with the same configuration and disk\nstate as the backup.\n\n### View a restore for VMs\n\nView a list of restores using the GDC 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 **Restores** tab.\n5. Click a restore in the list to view its details.\n\nDelete a restore\n----------------\n\nDelete a restore 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 **Restores** tab.\n5. In the list of restores, find the restore to delete and click **Delete Restore**.\n6. In the **Restore name** field, enter the name of the restore to delete.\n7. Click **Delete Restore**.\n\n### kubectl\n\n1. List the existing restores:\n\n kubectl get virtualmachinerestores.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 restore that you want to delete.\n\n3. Delete the restore:\n\n kubectl delete virtualmachinerestores.virtualmachine.gdc.goog \u003cvar translate=\"no\"\u003eRESTORE_NAME\u003c/var\u003e -n \u003cvar translate=\"no\"\u003ePROJECT_NAME\u003c/var\u003e\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eRESTORE_NAME\u003c/var\u003e: the name of the restore.\n - \u003cvar translate=\"no\"\u003ePROJECT_NAME\u003c/var\u003e: the name of the project."]]