Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Este documento contém instruções para substituir um disco de inicialização no
Google Distributed Cloud (GDC) com isolamento físico. Se você precisar
criar um disco de inicialização antes da substituição, consulte a página
Criar um disco de inicialização.
É possível remover os discos de inicialização da sua instância de máquina virtual (VM) e anexar novos
discos de inicialização a ela. Para reparar discos de inicialização, ative-os em outra instância de VM
sem excluir a original. Além disso, em vez de recriar uma instância de VM
inteira, você pode substituir os discos de inicialização dela.
Antes de começar
Para usar os comandos da interface de linha de comando (CLI) gdcloud, verifique se você baixou, instalou
e configurou a CLI gdcloud.
Todos os comandos do Distributed Cloud usam a CLI gdcloud ou kubectl e exigem um ambiente de sistema operacional (SO).
Extrair o caminho do arquivo kubeconfig
Para executar comandos no servidor da API Management, verifique se você tem os seguintes
recursos:
Faça login e gere o arquivo
kubeconfig para o servidor da API Management se você não tiver um.
Use o caminho para o arquivo kubeconfig do servidor da API Management para substituir
MANAGEMENT_API_SERVER nestas instruções.
Obtenha acesso aos discos da VM. Siga as etapas para
verificar
se você tem o papel necessário de administrador de VM do projeto.
Restrições
Ao substituir um disco de inicialização, você tem as seguintes restrições:
[[["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 document provides instructions for replacing a boot disk in Google Distributed Cloud (GDC) air-gapped environments, offering an alternative to recreating an entire VM instance.\u003c/p\u003e\n"],["\u003cp\u003eBoot disks can only be attached or detached from a stopped VM instance, and only one boot disk can be attached to a VM at a time, which can be a new or pre-existing bootable disk.\u003c/p\u003e\n"],["\u003cp\u003eYou can replace a boot disk using either the GDC console or the \u003ccode\u003ekubectl\u003c/code\u003e CLI, and both methods require stopping the VM instance before the replacement.\u003c/p\u003e\n"],["\u003cp\u003eWhen replacing a boot disk, you have the option to provision a new boot disk with a customizable name, size, image, deletion rule, and storage profile, or you can choose an existing boot disk.\u003c/p\u003e\n"],["\u003cp\u003eBefore doing any replacement, ensure you have downloaded, installed, and configured the \u003ccode\u003egdcloud\u003c/code\u003e CLI, and you have access to the kubeconfig file of the management API server.\u003c/p\u003e\n"]]],[],null,["# Replace a boot disk\n\nThis document contains instructions to replace a boot disk in\nGoogle Distributed Cloud (GDC) air-gapped. If you need to\ncreate a boot disk before your replacement, see the\n[Create a boot disk](/distributed-cloud/hosted/docs/latest/gdch/application/ao-user/vms/manage-vm-boot-disks/create-customized-boot-disk)\npage.\n\nYou can detach boot disks from your virtual machine (VM) instance and attach new\nboot disks to it. To repair boot disks, you mount them to another VM instance\nwithout deleting the original one. Also, instead of recreating an entire VM\ninstance, you can replace its boot disks.\n| **Note:** If you try to start a VM instance without a boot disk, you get an error, but you can edit other instance properties.\n\nBefore you begin\n----------------\n\nTo use `gdcloud` command-line interface (CLI) commands, ensure that you have downloaded, installed,\nand configured the [`gdcloud` CLI](/distributed-cloud/hosted/docs/latest/gdch/resources/gdcloud-overview).\nAll commands for Distributed Cloud use the `gdcloud` or\n`kubectl` CLI, and require an operating system (OS) environment.\n\n### Get the kubeconfig file path\n\nTo run commands against the Management API server, ensure you have the following\nresources:\n\n1. [Sign in and generate](/distributed-cloud/hosted/docs/latest/gdch/application/ao-user/iam/sign-in#cli) the\n kubeconfig file for the Management API server if you don't have one.\n\n2. Use the path to the kubeconfig file of the Management API server to replace\n \u003cvar translate=\"no\"\u003eMANAGEMENT_API_SERVER\u003c/var\u003e in these instructions.\n\n3. Obtain access to VM disks. Follow the steps to\n [verify](/distributed-cloud/hosted/docs/latest/gdch/application/ao-user/vms/preparation#verify-user-access)\n that you have the required Project VM Admin role.\n\nRestrictions\n------------\n\nYou have the following restrictions when replacing a boot disk:\n\n- Attach or detach a boot disk only from a [stopped VM instance](/distributed-cloud/hosted/docs/latest/gdch/application/ao-user/vms/manage-vms/operations-and-lifecycle/start-and-stop-vm#stop-a-vm).\n- Attach only one boot disk for each VM instance.\n- Attach only existing boot disks to a VM instance.\n- Replace the boot disk only with a new bootable disk.\n\nReplace a boot disk\n-------------------\n\nReplace a boot disk by using the GDC console or the `kubectl` CLI. \n\n### Console\n\n1. In the navigation menu, click **Virtual Machines \\\u003e Instances**.\n\n2. In the list of VMs, click a VM name to view its details.\n\n3. Click **Replace boot disk**.\n\n4. In the confirmation dialog, click **Stop** to stop the VM.\n\n5. Wait a few minutes for the VM to stop.\n\n6. Click **Refresh**.\n\n7. When the VM is in a stopped state, click **Replace boot disk** again.\n\n8. In the Replace boot disk dialog, choose a new boot disk or an\n existing boot disk.\n\n - To provision a new boot disk, click the **New boot disk** tab.\n\n 1. In the **Disk name** field, enter a new disk name that is unique to the project.\n 2. In the **Size** field, enter a disk size between 12 and 65536 GiB.\n 3. In the **Image name** list, select an image.\n 4. In the Deletion rule section, click **Keep disk** or **Delete disk**.\n 5. In the **Storage profile** section, choose a profile. The default profile is **Standard**.\n - To choose an existing boot disk, click the **Existing boot disk** tab.\n\n 1. In the **Disk** list, select a disk.\n 2. In the Deletion rule section, click **Keep disk** or **Delete disk**.\n9. Click **Save**.\n\n10. [Restart the VM](/distributed-cloud/hosted/docs/latest/gdch/application/ao-user/vms/manage-vms/operations-and-lifecycle/start-and-stop-vm#restart-a-vm).\n\n### kubectl\n\n1. [Stop the VM instance](/distributed-cloud/hosted/docs/latest/gdch/application/ao-user/vms/manage-vms/operations-and-lifecycle/start-and-stop-vm#stop-a-vm).\n\n | **Note:** You don't need to unmount the disk.\n2. Open the current `spec.disks` value to change it for the new virtual machine\n disk:\n\n kubectl --kubeconfig \u003cvar translate=\"no\"\u003eMANAGEMENT_API_SERVER\u003c/var\u003e edit virtualmachines.virtualmachine.gdc.goog --namespace \u003cvar translate=\"no\"\u003ePROJECT\u003c/var\u003e \u003cvar translate=\"no\"\u003eVM_NAME\u003c/var\u003e\n\n Replace the following values:\n - \u003cvar translate=\"no\"\u003eMANAGEMENT_API_SERVER\u003c/var\u003e with the path to the kubeconfig file of the Management API server.\n - \u003cvar translate=\"no\"\u003ePROJECT\u003c/var\u003e with the Distributed Cloud project where you want to replace the boot disk.\n - \u003cvar translate=\"no\"\u003eVM_NAME\u003c/var\u003e with the name of the virtual machine.\n3. Modify the boot disk in the config file by replacing\n \u003cvar translate=\"no\"\u003eVM_BOOT_DISK_NAME\u003c/var\u003e with the new VM boot disk name:\n\n disks:\n - virtualMachineDiskRef:\n name: \u003cvar translate=\"no\"\u003eVM_BOOT_DISK_NAME\u003c/var\u003e\n boot: true\n\n The result must look like the following example: \n\n disks:\n - virtualMachineDiskRef: \n name: NEW_VM_BOOT_DISK_NAME\n boot: true\n\n4. [Restart the VM](/distributed-cloud/hosted/docs/latest/gdch/application/ao-user/vms/manage-vms/operations-and-lifecycle/start-and-stop-vm#restart-a-vm)."]]