仮想マシン(VM)インスタンスを作成する場合は、その VM 用のブートディスクも作成する必要があります。公開イメージまたはカスタム イメージを使用できます。VM インスタンスを作成すると、GDC によってブート永続ディスクが自動的に作成されます。インスタンスに追加のデータ ストレージ ディスクが必要な場合は、永続ディスクを VM に追加します。
このページに記載されているタスクを実行するには、VM ディスクへのアクセス権が必要です。次の手順に沿って、確認するか、プロジェクト IAM 管理者に VM が存在するプロジェクトの Namespace でプロジェクト VirtualMachine 管理者(project-vm-admin)ロールを割り当ててもらいます。
GDC コンソールまたは gdcloud CLI を使用する VM オペレーションの場合は、プロジェクト IAM 管理者に、プロジェクトの VirtualMachine 管理者ロールとプロジェクト閲覧者(project-viewer)ロールの両方を割り当てるよう依頼します。
イメージからブートディスクを作成する
インスタンスの作成とは別に、スタンドアロンのブート永続ディスクを作成し、後でインスタンスにアタッチできます。このセクションでは、GDC 提供の OS イメージまたはカスタム OS イメージからブートディスクを作成する方法について説明します。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["わかりにくい","hardToUnderstand","thumb-down"],["情報またはサンプルコードが不正確","incorrectInformationOrSampleCode","thumb-down"],["必要な情報 / サンプルがない","missingTheInformationSamplesINeed","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-09-04 UTC。"],[[["\u003cp\u003eCreating a virtual machine (VM) requires a boot disk, which can be either a public image or a custom image.\u003c/p\u003e\n"],["\u003cp\u003eBoot disks can be created independently of VM creation and subsequently attached to a VM instance, offering flexibility in managing storage.\u003c/p\u003e\n"],["\u003cp\u003eYou can create a boot disk using either a GDC-provided image, which are listed using the \u003ccode\u003egdcloud compute images list\u003c/code\u003e command or through \u003ccode\u003ekubectl\u003c/code\u003e, or a custom image, belonging exclusively to your project, which requires having certain IAM roles.\u003c/p\u003e\n"],["\u003cp\u003eWhen creating a boot disk, the size of the disk must be at least the \u003ccode\u003eminimumDiskSize\u003c/code\u003e specified by the chosen image, and you will need to know the path of the \u003ccode\u003eADMIN_KUBECONFIG\u003c/code\u003e file.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003egdcloud\u003c/code\u003e or \u003ccode\u003ekubectl\u003c/code\u003e command-line tools are used to create boot disks and to list the available images.\u003c/p\u003e\n"]]],[],null,["# Create a customized boot disk\n\nWhen you create a virtual machine (VM) instance, you must also create a boot\ndisk for that VM. You can use either a public image or a custom image. GDC\nautomatically creates a boot persistent disk when you\n[create a VM instance](/distributed-cloud/hosted/docs/latest/appliance/application/ao-user/vms/create-a-vm/create-and-start).\nIf you require additional data storage disks for your instances,\n[add a persistent disk to your VM](/distributed-cloud/hosted/docs/latest/appliance/application/ao-user/vms/manage-storage/add-a-vm-disk).\n\nUse the procedures described on this page to create boot disks that you can\nuse later to create VMs.\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/appliance/resources/gdcloud-overview).\nAll commands for GDC air-gapped appliance 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. Locate the Management API server name, or ask your Platform Administrator (PA)\n what the server name is.\n\n2. [Sign in and generate](/distributed-cloud/hosted/docs/latest/appliance/application/ao-user/iam/sign-in#cli) the\n kubeconfig file for the Management API server if you don't have one.\n\n3. Use the path to replace \u003cvar translate=\"no\"\u003eMANAGEMENT_API_SERVER{\"</var>\"}}\u003c/var\u003e in these instructions.\n\nRequest permissions and access\n------------------------------\n\nTo perform the tasks listed in this page, you must have access to VM disks.\nFollow the steps to either\n[verify](/distributed-cloud/hosted/docs/latest/appliance/application/ao-user/vms/preparation)\nor have your Project IAM Admin\n[assign](/distributed-cloud/hosted/docs/latest/appliance/application/ao-user/vms/preparation#grant-user-access-vm-resources)\nyou the Project VirtualMachine Admin (`project-vm-admin`) role in the namespace\nof the project where the VM resides.\n\nFor VM operations using the GDC console or the gdcloud CLI,\nrequest your Project IAM Admin to assign you both the\nProject VirtualMachine Admin role and the Project Viewer (`project-viewer`)\nrole.\n\nCreate a boot disk from an image\n--------------------------------\n\nYou can create a standalone, boot, persistent disk outside of instance creation\nand attach it to an instance afterwards. This section shows how to create a boot\ndisk from either a\n[GDC-provided OS image](/distributed-cloud/hosted/docs/latest/appliance/application/ao-user/vms/create-a-vm/create-and-start#create-vm-from-provided-image)\nor a\n[custom OS image](/distributed-cloud/hosted/docs/latest/appliance/application/ao-user/vms/create-a-vm/create-and-start#create-vm-from-custom).\n\n### Create a boot disk from a GDC-provided image\n\nBefore you create a boot disk by using a GDC-provided image,\nreview the list of available images. Then create a boot disk with the provided image. \n\n### gdcloud\n\n1. List all available images and their minimum disk size:\n\n gdcloud compute images list\n\n This command includes both GDC air-gapped appliance-provided and custom\n images. Choose either one in the `vm-system` namespace.\n2. Select a GDC air-gapped appliance-provided image to create the VM disk:\n\n gdcloud compute disks create \u003cvar translate=\"no\"\u003eBOOT_DISK_NAME\u003c/var\u003e \\\n --project=\u003cvar translate=\"no\"\u003ePROJECT\u003c/var\u003e \\\n --size=\u003cvar translate=\"no\"\u003eDISK_SIZE\u003c/var\u003e \\\n --image=\u003cvar translate=\"no\"\u003eIMAGE_NAME\u003c/var\u003e \\\n --image-project=vm-system\n\n Replace the variables using the following definitions:\n\n### kubectl\n\n1. List all available GDC-provided images:\n\n kubectl --kubeconfig \u003cvar translate=\"no\"\u003eMANAGEMENT_API_SERVER\u003c/var\u003e \\\n get virtualmachineimages.virtualmachine.gdc.goog --namespace vm-system\n\n2. Get the `minimumDiskSize` of a specific GDC-provided\n image. The size of the created customized boot disk must be at least the\n `minimumDiskSize`:\n\n kubectl --kubeconfig \u003cvar translate=\"no\"\u003eMANAGEMENT_API_SERVER\u003c/var\u003e \\\n get virtualmachineimages.virtualmachine.gdc.goog --namespace vm-system \\\n \u003cvar translate=\"no\"\u003eIMAGE_NAME\u003c/var\u003e -ojsonpath='{.spec.minimumDiskSize}'\n\n3. Create a `VirtualMachineDisk` object:\n\n kubectl --kubeconfig \u003cvar translate=\"no\"\u003eMANAGEMENT_API_SERVER\u003c/var\u003e apply -n \u003cvar translate=\"no\"\u003ePROJECT\u003c/var\u003e -f - \u003c\u003cEOF\n apiVersion: virtualmachine.gdc.goog/v1\n kind: VirtualMachineDisk\n metadata:\n name: \u003cvar translate=\"no\"\u003eBOOT_DISK_NAME\u003c/var\u003e\n spec:\n source:\n image:\n name: \u003cvar translate=\"no\"\u003eIMAGE_NAME\u003c/var\u003e\n namespace: vm-system\n size: \u003cvar translate=\"no\"\u003eDISK_SIZE\u003c/var\u003e\n EOF\n\n Replace the variables using the following definitions:\n\n### Create a boot disk from a custom image\n\nA custom image belongs exclusively to your project. To create a VM with a\ncustom boot disk image, if the image doesn't already exist in your project then\nyou must [create one](/distributed-cloud/hosted/docs/latest/appliance/application/ao-user/vms/create-custom-images/create-custom-images).\n\nSet up the necessary [IAM roles](/distributed-cloud/hosted/docs/latest/appliance/application/ao-user/vms/preparation)\nto access custom images in your project if you haven't done so yet. Then proceed\nwith these instructions. \n\n### gdcloud\n\n1. List all custom images and their minimum disk size:\n\n gdcloud compute images list \\\n --project=\u003cvar translate=\"no\"\u003ePROJECT\u003c/var\u003e \\\n\n2. Select a custom image to create the VM disk:\n\n gdcloud compute disks create \u003cvar translate=\"no\"\u003eBOOT_DISK_NAME\u003c/var\u003e \\\n --project=\u003cvar translate=\"no\"\u003ePROJECT\u003c/var\u003e \\\n --size=\u003cvar translate=\"no\"\u003eDISK_SIZE\u003c/var\u003e \\\n --image=\u003cvar translate=\"no\"\u003eIMAGE_NAME\u003c/var\u003e \\\n --image-project=\u003cvar translate=\"no\"\u003ePROJECT\u003c/var\u003e\n\n Replace the variables using the following definitions:\n\n### kubectl\n\n1. List all custom images:\n\n kubectl --kubeconfig \u003cvar translate=\"no\"\u003eMANAGEMENT_API_SERVER\u003c/var\u003e \\\n get virtualmachineimages.virtualmachine.gdc.goog --namespace \u003cvar translate=\"no\"\u003ePROJECT\u003c/var\u003e\n\n2. Get the `minimumDiskSize` of a specific customized image. The size of the\n created customized boot disk must be at least the `minimumDiskSize`:\n\n kubectl --kubeconfig \u003cvar translate=\"no\"\u003eMANAGEMENT_API_SERVER\u003c/var\u003e \\\n get virtualmachineimages.virtualmachine.gdc.goog --namespace vm-system \\\n \u003cvar translate=\"no\"\u003eIMAGE_NAME\u003c/var\u003e -ojsonpath='{.spec.minimumDiskSize}'\n\n3. Create a `VirtualMachineDisk` object:\n\n kubectl --kubeconfig \u003cvar translate=\"no\"\u003eMANAGEMENT_API_SERVER\u003c/var\u003e \\\n apply --namespace \u003cvar translate=\"no\"\u003ePROJECT\u003c/var\u003e -f - \u003c\u003cEOF\n apiVersion: virtualmachine.gdc.goog/v1\n kind: VirtualMachineDisk\n metadata:\n name: \u003cvar translate=\"no\"\u003eBOOT_DISK_NAME\u003c/var\u003e\n spec:\n source:\n image:\n name: \u003cvar translate=\"no\"\u003eIMAGE_NAME\u003c/var\u003e\n namespace: \u003cvar translate=\"no\"\u003ePROJECT\u003c/var\u003e\n size: \u003cvar translate=\"no\"\u003eDISK_SIZE\u003c/var\u003e\n EOF\n\n Replace the variables, using the following definitions:\n\nTo replace a boot disk, see the [Replace a boot disk](/distributed-cloud/hosted/docs/latest/appliance/application/ao-user/vms/manage-vm-boot-disks/replace-a-boot-disk)\npage."]]