Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
Lorsque vous créez une instance Compute Engine, vous devez également créer un disque de démarrage pour celle-ci. Vous pouvez pour cela utiliser une image publique, une image personnalisée ou un instantané pris à partir d'un autre disque de démarrage. Lorsque vous créez un disque de démarrage, limitez la taille du disque à 2 Tio afin de tenir compte des limitations relatives aux partitions MBR.
Suivez les procédures décrites dans ce document pour créer des disques de démarrage que vous pourrez utiliser ultérieurement pour créer des VM. Pour améliorer les performances d'un disque de démarrage ou pour ajouter de l'espace pour des applications supplémentaires ou des fichiers de système d'exploitation, vous pouvez redimensionner le disque de démarrage Persistent Diskou Google Cloud Hyperdisk.
Il est déconseillé d'utiliser des disques régionaux comme disques de démarrage. En cas de basculement, ces disques ne permettent pas de forcer l'association à une instance de calcul.
Avant de commencer
Lorsque vous créez des machines virtuelles (VM) à partir d'images ou de disques à l'aide de Google Cloud CLI ou de REST, la limite est de 20 instances de VM par seconde. Si vous devez créer un nombre plus élevé de VM par seconde, demandez une augmentation de limite de quota pour la ressource Images.
Si ce n'est pas déjà fait, configurez l'authentification.
L'authentification est le processus permettant de valider votre identité pour accéder aux services et aux API Google Cloud .
Pour exécuter du code ou des exemples depuis un environnement de développement local, vous pouvez vous authentifier auprès de Compute Engine en sélectionnant l'une des options suivantes :
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
Installez Google Cloud CLI.
Après l'installation,
initialisez Google Cloud CLI en exécutant la commande suivante :
Pour utiliser les exemples d'API REST de cette page dans un environnement de développement local, vous devez utiliser les identifiants que vous fournissez à gcloud CLI.
Installez Google Cloud CLI.
Après l'installation,
initialisez Google Cloud CLI en exécutant la commande suivante :
Créer un disque de démarrage à partir d'un instantané
Après avoir créé un instantané d'un disque de démarrage, vous pouvez l'utiliser pour créer des disques de démarrage.
Vous ne pouvez appliquer les données d'un instantané qu'au moment de la création d'un disque. Vous ne pouvez pas appliquer un instantané à un disque existant ni à des disques appartenant à un projet différent de celui de l'instantané.
Console
Dans la console Google Cloud , accédez à la page Créer un disque.
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/08/19 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Difficile à comprendre","hardToUnderstand","thumb-down"],["Informations ou exemple de code incorrects","incorrectInformationOrSampleCode","thumb-down"],["Il n'y a pas l'information/les exemples dont j'ai besoin","missingTheInformationSamplesINeed","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 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)."]]