Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Ao criar uma instância do Compute Engine, também é necessário criar um disco de inicialização para ela. É possível usar uma imagem pública/personalizada ou um snapshot tirado de outro disco de inicialização. Ao criar um disco de inicialização, limite o tamanho dele a 2 TiB para acomodar as limitações do particionamento do MBR.
O Compute Engine cria automaticamente um disco de inicialização quando você gera uma instância.
Se você precisar de mais espaço de armazenamento de dados para as instâncias, adicione um ou
mais discos de armazenamento de instâncias secundários.
Use os procedimentos descritos neste documento para criar discos de inicialização que podem ser
usados posteriormente para criar VMs. Para melhorar o desempenho de um disco de inicialização ou adicionar
espaço para outros aplicativos ou arquivos do sistema operacional, redimensione o
disco permanente ou
disco de inicialização do Google Cloud Hyperdisk.
Como prática recomendada, não use
discos regionais
para discos de inicialização. Em uma situação de failover, eles não forçam a anexação a uma instância de computação.
Antes de começar
Ao criar máquinas virtuais (VMs) de imagens ou discos usando a
CLI ou REST do Google Cloud, há um limite de 20 instâncias de VM por
segundo. Se precisar
criar um número maior de VMs por segundo, solicite um limite de cota maior
para o recurso Imagens.
Configure a autenticação, caso ainda não tenha feito isso.
A autenticação é
o processo de verificação da sua identidade para acesso a serviços e APIs do Google Cloud .
Para executar códigos ou amostras de um ambiente de desenvolvimento local, autentique-se no
Compute Engine selecionando uma das seguintes opções:
Select the tab for how you plan to use the samples on this page:
Console
When you use the Google Cloud console to access Google Cloud services and
APIs, you don't need to set up authentication.
gcloud
Instale a CLI do Google Cloud.
Após a instalação,
inicialize a Google Cloud CLI executando o seguinte comando:
Para criar um novo disco de inicialização, faça uma solicitação POST para o
método disks.insert:
POST https://compute.googleapis.com/compute/v1/projects/PROJECT_NAME/zones/ZONE/disks?sourceImage=IMAGE
Substitua IMAGE pelo URI completo e codificado por URL da imagem de origem a ser aplicado ao disco de inicialização.
É necessário que o corpo da solicitação contenha um nome para o novo disco:
{
"name": "DISK_NAME"
}
Se você criou um disco de inicialização maior que a imagem, talvez seja necessário
reparticioná-lo.
Criar um disco de inicialização com base em uma captura de tela
Depois de criar um snapshot de um disco de inicialização, você pode usar o snapshot para criar
novos discos de inicialização.
Só é possível aplicar dados de um snapshot quando você cria um disco pela primeira vez. Não é possível
aplicar um snapshot a um disco existente ou a discos que
pertencem a um projeto diferente do snapshot.
Console
No console Google Cloud , acesse a página Criar um disco.
[[["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-08-19 UTC."],[[["\u003cp\u003eWhen creating a Compute Engine instance, a boot disk is required, which can be sourced from a public image, custom image, or a snapshot of another boot disk.\u003c/p\u003e\n"],["\u003cp\u003eBoot disks should be limited to 2 TiB in size due to MBR partitioning limitations, and additional storage can be added via secondary instance storage disks.\u003c/p\u003e\n"],["\u003cp\u003eBoot disks can be created independently of instance creation and attached later, and they can be created from an image or a snapshot of an existing disk.\u003c/p\u003e\n"],["\u003cp\u003eYou can resize Persistent Disk or Google Cloud Hyperdisk boot disks to enhance performance or accommodate more applications and operating system files.\u003c/p\u003e\n"],["\u003cp\u003eWhen creating virtual machines from images or disks using Google Cloud CLI or REST there is a limit of 20 instances per second, and users can request a higher quota for the \u003cstrong\u003eImages\u003c/strong\u003e resource if needed.\u003c/p\u003e\n"]]],[],null,["*** ** * ** ***\n\nWhen you create a Compute Engine instance, you must also create a\nboot disk for the instance. You can use a public image, a custom image, or\na snapshot that was taken from another boot disk. When you create a boot disk,\nlimit the disk size to 2 TiB to account for the limitations of\n[MBR](https://wikipedia.org/wiki/Master_boot_record) partitioning.\n\nCompute Engine automatically creates a boot disk when you\n[create an instance](/compute/docs/instances/create-start-instance).\nIf you require additional data storage space for your instances, add one or\nmore secondary [instance storage disks](/compute/docs/disks) to the instance.\n\nUse the procedures described in this document to create boot disks that you can\nuse later to create VMs. To improve the performance of a boot disk or to add\nspace for additional applications or operating system files, you can\nresize the\n[Persistent Disk](/compute/docs/disks/resize-persistent-disk) or\n[Google Cloud Hyperdisk](/compute/docs/disks/modify-hyperdisks#modify_hyperdisk)\nboot disk.\n\nAs a best practice, don't use\n[regional disks](/compute/docs/disks/regional-persistent-disk)\nfor boot disks. In a failover situation, they don't force-attach to a compute\ninstance.\n\nBefore you begin\n\n- When you create virtual machines (VMs) from images or disks by using the Google Cloud CLI or REST, there's a limit of 20 VM instances per second. If you need to create a higher number of VMs per second, [request a higher quota limit](/compute/quotas#requesting_additional_quota) for the **Images** resource.\n- If you haven't already, set up [authentication](/compute/docs/authentication). Authentication verifies your identity for access to Google Cloud services and APIs. To run code or samples from a local development environment, you can authenticate to Compute Engine by selecting one of the following options:\n\n Select the tab for how you plan to use the samples on this page: \n\n Console\n\n\n When you use the Google Cloud console to access Google Cloud services and\n APIs, you don't need to set up authentication.\n\n gcloud\n 1.\n [Install](/sdk/docs/install) the Google Cloud CLI.\n\n After installation,\n [initialize](/sdk/docs/initializing) the Google Cloud CLI by running the following command:\n\n ```bash\n gcloud init\n ```\n\n\n If you're using an external identity provider (IdP), you must first\n [sign in to the gcloud CLI with your federated identity](/iam/docs/workforce-log-in-gcloud).\n | **Note:** If you installed the gcloud CLI previously, make sure you have the latest version by running `gcloud components update`.\n 2. [Set a default region and zone](/compute/docs/gcloud-compute#set_default_zone_and_region_in_your_local_client).\n\n REST\n\n\n To use the REST API samples on this page in a local development environment, you use the\n credentials you provide to the gcloud CLI.\n 1. [Install](/sdk/docs/install) the Google Cloud CLI. After installation, [initialize](/sdk/docs/initializing) the Google Cloud CLI by running the following command: \n\n ```bash\n gcloud init\n ```\n 2. If you're using an external identity provider (IdP), you must first [sign in to the gcloud CLI with your federated identity](/iam/docs/workforce-log-in-gcloud).\n\n\n For more information, see\n [Authenticate for using REST](/docs/authentication/rest)\n in the Google Cloud authentication documentation.\n\nCreate a boot disk from an image\n\nYou can create a standalone boot disk outside of instance creation\nand attach it to an instance afterwards. \n\nConsole\n\n1. In the Google Cloud console, go to the **Create a disk** page.\n\n [Go to the Create a disk page](https://console.cloud.google.com/compute/disksAdd)\n2. Under **Disk source type** , select **Image**. Choose an image from the\n list.\n\n3. Click **Create**.\n\ngcloud\n\nTo create a standalone boot disk, use the\n[`gcloud compute disks create`](/sdk/gcloud/reference/compute/disks/create)\ncommand: \n\n```\ngcloud compute disks create DISK_NAME --image IMAGE_NAME\n```\n\nREST\n\nTo create a new boot disk, make a `POST` request to the\n[`disks.insert` method](/compute/docs/reference/rest/v1/disks/insert): \n\n```\nPOST https://compute.googleapis.com/compute/v1/projects/PROJECT_NAME/zones/ZONE/disks?sourceImage=IMAGE\n```\n\nReplace `IMAGE` with the URL-encoded, fully qualified URI of the source\nimage to apply to this boot disk.\n\nThe request body must contain a name for this new disk: \n\n```\n{\n \"name\": \"DISK_NAME\"\n}\n```\n\nIf you created a boot disk that is larger than the image, you might want to\n[repartition the boot disk](/compute/docs/disks/resize-persistent-disk#resize_partitions).\n\nCreate a boot disk from a snapshot\n\nAfter you create a snapshot of a boot disk, you can use the snapshot to create\nnew boot disks.\n\nYou can only apply data from a snapshot when you first create a disk. You can't\napply a snapshot to an existing disk, or apply a snapshot to disks that\nbelong to a different project than the snapshot. \n\nConsole\n\n1. In the Google Cloud console, go to the **Create a disk** page.\n\n [Go to the Create a disk page](https://console.cloud.google.com/compute/disksAdd)\n2. Under **Disk source type** , select **Snapshot**.\n\n3. Choose a snapshot from the list.\n\n4. Finish setting the properties for your disk and click **Create**.\n\ngcloud\n\nTo apply data from a disk snapshot, run the following command: \n\n```\ngcloud compute disks create DISK_NAME --source-snapshot SNAPSHOT_NAME\n```\n\nREST\n\nTo create a boot disk from a snapshot, make a `POST` request to the\n[`disks.insert` method](/compute/docs/reference/rest/v1/disks/insert): \n\n```\nPOST https://compute.googleapis.com/compute/v1/projects/PROJECT_NAME/zones/ZONE/disks\n```\n\nThe request body must contain a name for this new disk and the\nURL for the snapshot to use when creating the disk: \n\n```\n{\n \"name\": \"DISK_NAME\",\n \"sourceSnapshot\": \"zones/ZONE/snapshots/SNAPSHOT_NAME\"\n}\n```\n\nWhat's next\n\n- The process for resizing a boot disk and a non-boot disk are the same. For more information, see the instructions in [Resize a Persistent Disk](/compute/docs/disks/resize-persistent-disk#resize_partitions) or [Change the size or provisioned performance of a Hyperdisk volume](/compute/docs/disks/modify-hyperdisks#modify_hyperdisk)."]]