About bulk creation of VMs

Linux Windows

Bulk creation of virtual machine (VM) instances lets you create a large numberof VMs that are identical and independent from each other. When you create VMsin bulk, you can do the following:

  • Minimize consumption of API rate limits. Requests for creating VMs in bulkconsumeAPI rate limits as if you werecreating a single VM.

  • Distribute VM creation across multiple zones in a region.For regional requests, Compute Engine determines the zone to createthe VMs in based on the zones that have available hardware, taking intoconsideration the available capacity in each zone, as well as any of yourreservations.

Compute Engine doesn't manage VMs that you create in bulk. To create agroup of managed VMs, usemanaged instance groups.

Creating VMs in bulk versus batching API requests

Creating VMs in bulk is different frombatching APIrequests with theinstances.insertmethod. The following tablecompares these two ways of creating multiple VMs:

FunctionalityBatching API requestsCreating VMs in bulk
Zone selection
Automatically selected based on considerations such as resource availability and quota
ManualAutomatic when using the regional endpoint
Upfront validation
Request fails immediately if it is not feasible
NoWith capacity and quota
VM name generation
Automatically generated based on a specified name pattern
ManualOptionally generated automatically
Automatic rollback
Request automatically rolled back if Compute Engine cannot create the target number of VMs
NoOptionally enabled
API rate limit
How requests affect the API rate limit
One request for each VMOne request for each bulk operation

Limitations

The following list describes the limitations that apply when creating VMs inbulk:

  • Customer supplied encryption keys. You can't create VMs that have disksthat are protected bycustomer-supplied encryption keys (CSEK).The disks must use Google-default or customer-managed encryption keys.

  • Boot disks from snapshots. You can't use a snapshot to create the boot disksfor the VMs. Instead, usea custom imagewhen you create VMs in bulk.

  • Global DNS. If you are using global DNS, there might be name conflictsbecause the fully qualified domain name (FQDN) doesn't contain the zone. Toavoid this, use zonal DNS. If you cannot switch to zonal DNS, avoid using thesame name pattern across different regions. For more information, seeTypesof internal DNS names.

  • Machine images. You cannot create VMs frommachineimages.

  • Number of VMs. You can create up to 5,000 VMs with each call. Also, youcan create a maximum of 8,000 instances simultaneously at any time. Thissimultaneous operation limit is shared betweeninstances.insert andinstances.bulkInsert.

  • Sole-tenant nodes. You cannot create VMs that usesole-tenant node affinity labels.

  • VM properties. AllVM properties,except their names and custom hostnames, must be identical. You cannot useVM properties that are mutually exclusive between VMs, which include butare not limited to static external IP addresses and static internal IP addresses.

Audit logs

Compute Engine logs information about the bulk VM creation to theAdmin Activity audit log when you make theAPI call and when the API call completes.

Compute Engine also creates separate audit logs for each VM. You canfind the audit log for a single VM by matching the value ofprotoPayload.resourceName with the VM name generated by the naming patternthat you specify with the request.

Pricing

There are no additional charges for using bulk VM creation. As with creatingsingle VMs, billing begins when you create the VMs.

You are not billed for any VMs that Compute Engine fails to create.

What's next

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-15 UTC.