Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Dokumen ini berisi petunjuk untuk mengganti disk booting di
Google Distributed Cloud (GDC) dengan air gap. Jika Anda perlu
membuat disk boot sebelum penggantian, lihat halaman
Membuat disk boot.
Anda dapat melepaskan boot disk dari instance mesin virtual (VM) dan memasang boot disk baru ke instance tersebut. Untuk memperbaiki boot disk, Anda memasangnya ke instance VM lain
tanpa menghapus instance aslinya. Selain itu, daripada membuat ulang seluruh instance VM, Anda dapat mengganti boot disk-nya.
Sebelum memulai
Untuk menggunakan perintah antarmuka command line (CLI) gdcloud, pastikan Anda telah mendownload, menginstal,
dan mengonfigurasi CLI gdcloud.
Semua perintah untuk Distributed Cloud menggunakan CLI gdcloud atau
kubectl, dan memerlukan lingkungan sistem operasi (OS).
Mendapatkan jalur file kubeconfig
Untuk menjalankan perintah terhadap server Management API, pastikan Anda memiliki resource berikut:
Login dan buat file kubeconfig untuk server Management API jika Anda belum memilikinya.
Gunakan jalur ke file kubeconfig server Management API untuk menggantikan
MANAGEMENT_API_SERVER dalam petunjuk ini.
Mendapatkan akses ke disk VM. Ikuti langkah-langkah untuk
memverifikasi
bahwa Anda memiliki peran Project VM Admin yang diperlukan.
Pembatasan
Anda memiliki batasan berikut saat mengganti disk boot:
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 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)."]]