Troubleshooting bulk VM creation


This document shows you how to resolve issues with bulk instance API creation operations.

Operation errors

When you use the bulk instance API to create VMs, create requests return HTTP 200 OK with a status of RUNNING if the request starts successfully. If the request doesn't start successfully, the API returns one of the responses below.

Invalid

If the following API response fields are present when you create VMs, your API request isn't written correctly, or it uses a property that isn't supported by the bulk API.

API response fields:

  • HTTP 400
  • "reason": "invalid"

To resolve this issue, do the following:

  1. View the message field in the response to determine which property in the request caused the error.
  2. Update the property that caused the error.
  3. Retry the request.
  4. If the request fails again, try using the API Explorer to validate the request. For more information, see Validating API requests.

Quota exceeded

If the following API response fields are present when you create VMs, you reached a quota limit for a resource. For more information about quotas, see Resource quotas.

API response fields:

  • HTTP 403
  • "reason": "quotaExceeded"
To resolve this issue, do the following:

  1. View the `message` field to identify which resource quota the request exceeded.
  2. Do one of the following:

Rate limit exceeded

If the following API response fields are present when you create VMs, you reached the 20 request per second request limit or you have more than 10 bulk operations running at the same time.

API response fields:

  • HTTP 403
  • "reason": "rateLimitExceeded"

To resolve this issue, wait until some requests complete and try your request again.

Insufficient capacity

If the following API response fields are present when you create VMs, the region or zone you tried to create VMs in has insufficient capacity.

API response fields:

  • HTTP 503
  • "reason": "insufficientCapacity"
To resolve this issue, do one of the following:

  • Create VMs in a different region
  • Create VMs in a different zone if using the zonal endpoint
  • Try a different VM configuration
  • Retry your request later

Request status errors

When you use the bulk instance API to create VMs, your create request returns HTTP 200 OK with a status of RUNNING if the request starts successfully. However, the request may fail before it completes. You can check the status of your request to ensure the request completed successfully. If the request didn't complete successfully, you see one of the following request statuses.

Quota exceeded

If the following API response fields are present when you poll operations, your request failed because you reached a quota limit for a resource. For more information about quotas, see Resource quotas.

API response fields:

  • "status": "done"
  • "httpErrorMessage": "FORBIDDEN"
  • "code"": "QUOTA_EXCEEDED"

To resolve this issue, do the following:

  1. View the `message` field to identify which resource quota the request exceeded.
  2. Do one of the following:

Resource already exists

If the following API response fields are present when you poll operations, your request failed because it tried to create a resource that already exists.

API response fields:

  • code: RESOURCE_ALREADY_EXISTS
  • httpErrorMessage: CONFLICT
  • status: DONE

To resolve this issue, do the following:

  1. View the message field to identify the name of the resource that already exists.
  2. Retry your request using a different namePattern. For more information, see Creating multiple VMs in a region.

Insufficient capacity

If the following API response fields are present when you poll operations, your request failed because the region or zone (if using the zonal endpoint) you tried to create VMs in has insufficient capacity.

API response fields:

  • "status": "DONE"
  • "httpErrorMessage": "SERVICE UNAVAILABLE"
  • "code": "ZONE_RESOURCE_POOL_EXHAUSTED"

To resolve this issue, do one of the following:

  • Create VMs in a different region
  • Create VMs in a different zone if using the zonal endpoint
  • Try a different VM configuration
  • Retry your request later

What's next?