Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Linux
Windows
La creazione di istanze di macchine virtuali (VM) in blocco ti consente di creare un numero elevato di VM identiche e indipendenti tra loro. La creazione di VM in blocco ti consente di:
Ridurre al minimo il consumo dei limiti di frequenza dell'API. Le richieste di creazione di VM in blocco utilizzano i limiti di frequenza dell'API come se stessi creando una singola VM.
Distribuire la creazione di VM in più zone all'interno di una regione.
Per le richieste a livello di regione, Compute Engine determina la zona in cui creare le VM in base alle zone con hardware disponibile, tenendo in considerazione la capacità disponibile in ogni zona, nonché eventuali prenotazioni.
Compute Engine non gestisce le VM create in blocco. Per creare un gruppo di VM gestite, utilizza i gruppi di istanze gestite.
Confronto tra creazione di VM in blocco e raggruppamento in batch delle richieste API
Selezione della zona
Selezionata automaticamente in base a considerazioni come quota e disponibilità delle risorse
Manuale
Automatica se utilizzi l'endpoint a livello di regione
Convalida immediata
La richiesta non riesce immediatamente se non è fattibile
No
Con capacità e quota
Generazione del nome della VM
Generato automaticamente in base a un pattern del nome specificato
Manuale
Generazione automatica facoltativa
Rollback automatico
Rollback della richiesta eseguito automaticamente se Compute Engine non riesce a creare il numero target di VM
No
Attivazione facoltativa
Limite di frequenza API
In che modo le richieste influiscono sul limite di frequenza API
Una richiesta per ogni VM
Una richiesta per ogni operazione in blocco
Limitazioni
Il seguente elenco descrive le limitazioni che si applicano alla creazione di VM in blocco:
Chiavi di crittografia fornite dal cliente. Non puoi creare VM con dischi protetti da chiavi di crittografia fornite dal cliente (CSEK).
I dischi devono utilizzare chiavi di crittografia predefinite di Google o gestite dal cliente.
Dischi di avvio da snapshot. Non puoi utilizzare uno snapshot per creare dischi di avvio per le VM. Utilizza invece un'immagine personalizzata quando crei le VM in blocco.
DNS globale. Se utilizzi il DNS globale, potrebbero esserci nomi in conflitto perché il nome di dominio completo (FQDN) non contiene la zona. Per evitarlo, utilizza il DNS di zona. Se non puoi passare al DNS di zona, evita di utilizzare lo stesso pattern di nomi in regioni diverse. Per saperne di più, consulta Tipi di nomi DNS interni.
Numero di VM. Puoi creare fino a 5000 VM con ogni chiamata. Inoltre, puoi creare un massimo di 8000 istanze contemporaneamente in qualsiasi momento. Questo limite di operazioni simultanee è condiviso tra instances.insert e instances.bulkInsert.
Proprietà delle VM. Tutte le proprietà delle VM, tranne i nomi e i nomi host personalizzati, devono essere identiche. Non puoi utilizzare proprietà VM che si escludono a vicenda tra le VM, come, a titolo esemplificativo, indirizzi IP esterni e indirizzi IP interni statici.
Audit log
Compute Engine registra le informazioni sulla creazione in blocco delle VM nell'audit log per le attività di amministrazione quando esegui la chiamata API e al termine della chiamata.
Compute Engine crea anche audit log separati per ogni VM. Puoi trovare l'audit log di una singola VM utilizzando come valore di protoPayload.resourceName il nome della VM generato dal pattern di denominazione specificato con la richiesta.
Prezzi
Non vengono addebitati costi aggiuntivi per l'utilizzo della creazione di VM in blocco. Come per la creazione di singole VM, la fatturazione inizia quando crei le VM.
Non ti sarà addebitato alcun costo per le VM che Compute Engine non riesce a creare.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-08-04 UTC."],[[["\u003cp\u003eBulk VM creation allows for the creation of numerous identical and independent virtual machines with a single API request, effectively minimizing API rate limit consumption.\u003c/p\u003e\n"],["\u003cp\u003eWhen creating VMs in bulk, Compute Engine can automatically distribute the VMs across multiple zones within a region, optimizing for resource availability and honoring any existing reservations.\u003c/p\u003e\n"],["\u003cp\u003eUnlike batching API requests, bulk VM creation offers automatic zone selection, upfront validation of requests, optional automatic VM name generation, and the possibility of automatic rollback if VM creation fails.\u003c/p\u003e\n"],["\u003cp\u003eThere are limitations to bulk VM creation, such as not supporting customer-supplied encryption keys, boot disks from snapshots, machine images, sole-tenant nodes, and requiring most VM properties to be identical.\u003c/p\u003e\n"],["\u003cp\u003eUsing bulk VM creation does not incur additional charges, and billing only starts upon successful VM creation; additionally, audit logs are provided for both the bulk operation and individual VMs.\u003c/p\u003e\n"]]],[],null,["Linux Windows\n\n*** ** * ** ***\n\nBulk creation of virtual machine (VM) instances lets you create a large number\nof VMs that are identical and independent from each other. When you create VMs\nin bulk, you can do the following:\n\n- **Minimize consumption of API rate limits.** Requests for creating VMs in bulk\n consume [API rate limits](/compute/docs/api-rate-limits) as if you were\n creating a single VM.\n\n- **Distribute VM creation across multiple zones in a region.**\n For regional requests, Compute Engine determines the zone to create\n the VMs in based on the zones that have available hardware, taking into\n consideration the available capacity in each zone, as well as any of your\n [reservations](/compute/docs/instances/choose-reservation-type).\n\nCompute Engine doesn't manage VMs that you create in bulk. To create a\ngroup of managed VMs, use [managed instance groups](/compute/docs/instance-groups).\n\nCreating VMs in bulk versus batching API requests\n\nCreating VMs in bulk is different from [batching API\nrequests](/compute/docs/api/how-tos/batch) with the [`instances.insert`\nmethod](/compute/docs/reference/rest/v1/instances/insert). The following table\ncompares these two ways of creating multiple VMs:\n\n| Functionality | Batching API requests | Creating VMs in bulk |\n|-------------------------------------------------------------------------------------------------------------------|-------------------------|--------------------------------------------|\n| **Zone selection** Automatically selected based on considerations such as resource availability and quota | Manual | Automatic when using the regional endpoint |\n| **Upfront validation** Request fails immediately if it is not feasible | No | With capacity and quota |\n| **VM name generation** Automatically generated based on a specified name pattern | Manual | Optionally generated automatically |\n| **Automatic rollback** Request automatically rolled back if Compute Engine cannot create the target number of VMs | No | Optionally enabled |\n| **API rate limit** How requests affect the API rate limit | One request for each VM | One request for each bulk operation |\n\nLimitations\n\nThe following list describes the limitations that apply when creating VMs in\nbulk:\n\n- **Customer supplied encryption keys.** You can't create VMs that have disks\n that are protected by [customer-supplied encryption keys (CSEK)](/compute/docs/disks/customer-supplied-encryption).\n The disks must use Google-default or customer-managed encryption keys.\n\n- **Boot disks from snapshots.** You can't use a snapshot to create the boot disks\n for the VMs. Instead, use [a custom image](/compute/docs/images/create-custom#create_image)\n when you create VMs in bulk.\n\n- **Global DNS.** If you are using global DNS, there might be name conflicts\n because the fully qualified domain name (FQDN) doesn't contain the zone. To\n avoid this, use zonal DNS. If you cannot switch to zonal DNS, avoid using the\n same name pattern across different regions. For more information, see [Types\n of internal DNS names](/compute/docs/internal-dns#instance-fully-qualified-domain-names).\n\n- **Machine images.** You cannot create VMs from [machine\n images](/compute/docs/machine-images).\n\n- **Number of VMs.** You can create up to 5,000 VMs with each call. Also, you\n can create a maximum of 8,000 instances simultaneously at any time. This\n simultaneous operation limit is shared between\n [`instances.insert`](/compute/docs/reference/rest/v1/instances/insert) and\n [`instances.bulkInsert`](/compute/docs/reference/rest/v1/instances/bulkInsert).\n\n- **Sole-tenant nodes.** You cannot create VMs that use\n [sole-tenant node affinity labels](/compute/docs/nodes/sole-tenant-nodes#node_affinity_and_anti-affinity).\n\n- **VM properties.** All [VM properties](/compute/docs/instances/update-instance-properties),\n except their names and custom hostnames, must be identical. You cannot use\n VM properties that are mutually exclusive between VMs, which include but\n are not limited to static external IP addresses and static internal IP addresses.\n\nAudit logs\n\nCompute Engine logs information about the bulk VM creation to the\n[Admin Activity audit log](/logging/docs/audit#admin-activity) when you make the\nAPI call and when the API call completes.\n\nCompute Engine also creates separate audit logs for each VM. You can\nfind the audit log for a single VM by matching the value of\n`protoPayload.resourceName` with the VM name generated by the naming pattern\nthat you specify with the request.\n\nPricing\n\nThere are no additional charges for using bulk VM creation. As with creating\nsingle VMs, billing begins when you create the VMs.\n\nYou are not billed for any VMs that Compute Engine fails to create.\n\nWhat's next\n\n- [Create VMs in bulk](/compute/docs/instances/multiple/create-in-bulk)"]]