Troubleshoot creating, updating and deleting VMs


This document lists errors that you might encounter when creating or updating VMs.

Errors when creating VMs

If you can't create a VM instance, it might be due to one of the issues that's described in this section.

Insufficient quota

A quota error occurs when a resource request exceeds your quota.

Error messages:

RESOURCE_NAME creation failed:
Quota QUOTA_NAME exceeded. Limit: QUOTA_LIMIT in region REGION
RESOURCE_NAME creation failed:
Quota QUOTA_NAME exceeded. Limit: QUOTA_LIMIT in zone ZONE
Resource exhausted (HTTP 429): QUOTA_EXCEEDED

Resolution: Request a higher quota limit. For more information, see Requesting an increase in quota.

Simultaneous resource mutation or creation operations

If you update more than one resource at a time, for example, modifying secondary ranges in a subnetwork and creating a VM at the same time, you might see a not ready error.

Error message:

The resource 'projects/PROJECT/regions/REGION/subnetworks/default' is not ready

Resolution: To resolve this issue, try the following:

Resource availability

The following are examples of common resource errors that you might encounter when you request new Compute Engine resources or create new reservations:

ZONE_RESOURCE_POOL_EXHAUSTED
ZONE_RESOURCE_POOL_EXHAUSTED_WITH_DETAILS
The zone 'projects/PROJECT_ID/zones/ZONE' does not have enough resources available to fulfill the request.
Try a different zone, or try again later.
A VM_TYPE_AND_SIZE VM instance with RESOURCE_ATTACHMENT is currently unavailable in the ZONE zone.

Capacity changes frequently, so try your request in a different zone, with a different VM hardware
configuration, or at a later time. For more options, see troubleshooting documentation.
A VM_TYPE_AND_SIZE VM instance with RESOURCE_ATTACHMENT is currently unavailable in the ZONE zone, because of  REASON.

Consider trying your request in the ZONE zone(s), which currently has capacity to accommodate your request.

If you cannot move your VM to ZONE, review the REASON failure resolution instructions available in troubleshooting documentation, then try your request again.
If your workload can't accommodate the suggested resolution, try your request with a different VM hardware configuration or at a later time.

To learn how to resolve resource errors, see Troubleshooting resource availability errors.

Zone availability

If you receive a notFound or does not exist in zone error when requesting new resources, it means that the zone you are requesting the resource in does not offer the resource or machine type that you have requested.

Error messages:

notFound

does not exist in zone

Resolution: See Regions and zones to find out which features are available in each zone.

Rate exceeded for resource type

The following error occurs when you create more than one disk or VM from a snapshot in a ten minute period.

Error message:

"code": "RESOURCE_OPERATION_RATE_EXCEEDED",
"message": "Operation rate exceeded for resource 'projects/project-id/zones/zone-id/disks/disk-name'.
Too frequent operations from the source resource."

Resolution:

To create multiple disks from a snapshot, use the snapshot to create an image then create your disks from the image:

  1. Create an image from the snapshot.
  2. Create disks from the image.

For non-boot disks, follow the instructions to create persistent disks from the image and use the following steps:

  • In the Google Cloud console, select Image as the disk Source type.
  • With the gcloud CLI, use the image flag.
  • If using REST, use the sourceImage parameter.

For more information about backing up and replicating your persistent disk data, see Data protection options.

Insufficient permissions

If you receive a permission error when you try to create a VM, you don't have the necessary IAM permissions to create a VM.

Error message:

Error: googleapi: Error 403: Google Compute Engine: Required 'compute.regions.get' permission for 'projects/PROJECT_ID/regions/REGION'., forbidden

Resolution: Ask your organization administrator to grant you access to create VMs. For more information, see Granting access to Compute Engine resources.

Resource names

If you receive a resource already exists error when you try to create a resource, your creation request failed because you specified a non-unique name for the resource for the specified location and project.

Error messages:

The resource 'projects/PROJECT_NAME/zones/ZONE/RESOURCE_TYPE/RESOURCE_NAME' already exists"

The resource 'projects/PROJECT_NAME/regions/REGION/RESOURCE_TYPE/RESOURCE_NAME' already exists"

Resolution: Retry your creation request with a unique resource name.

Network interfaces

If you receive a Too many network interfaces error when creating a VM, your request exceeded the network interface limit for the VM's machine type.

Error messages:

Invalid value for field 'resource': ".

Too many network interfaces. The maximum number of network interfaces allowed for this machine type is NUMBER.
Invalid value for field 'resource.networkInterfaces': ".

Too many network interfaces. The maximum number of network interfaces allowed for this machine type is NUMBER.

Resolution: To learn about how the maximum number of network interfaces is calculated for different machine types, see Maximum number of network interfaces.

Constraint violated

If you receive a Constraint violated error when creating a VM, your request violated one or more organization policy constraints.

Error message:

For example, if your organization restricts Shared VPC subnetworks, you might get the following error:

Constraint constraints/compute.CONSTRAINT violated for projects/PROJECT_ID.
Using the PARAMETER projects/PROJECT_ID/regions/REGION/CONSTRAINTPROJECT_ID is not allowed.

Resolution: Contact your organization administrator.

Required CPU platform

If you receive a required CPU platform error, the CPU platform you specified in the creation request isn't supported by the specified machine type.

Error message:

Could not fetch resource:
- The selected machine type (MACHINE_TYPE) has a required CPU platform of REQUIRED_CPU_PLATFORM.
The minimum CPU platform must match this, but was SPECIFIED_CPU_PLATFORM.

Resolution:

  1. To learn about which CPU platform your machine type supports, review CPU platforms.
  2. Retry your request with a supported CPU platform.

Mismatched reservation properties

If you receive a No available resources in specified reservations error when creating a VM, the properties of the VM and the specific reservation that the VM is targeting for consumption aren't matching.

Error message:

Invalid value for field 'resource.reservationAffinity':
- No available resources in specified reservations [RESERVATION_NAME].

Resolution: Try one of the following:

  • If the VM doesn't match the reservation's properties, modify the VM until its properties match the reservation's properties. Then, try creating the VM again.

  • If the VM has the right properties, but doesn't match the reservation's properties, you can't change the reservation. Instead, do one of the following:

    • When creating the VM, target a different specific reservation.

      You can create a new specific reservation with matching properties if you don't already have one with the correct properties. If you no longer need the previous specific reservation, then you can delete it so you are no longer paying for those reserved resources.

    • When creating the VM, target any matching reservation.

      If there is a reservation configured for automatic consumption that has properties that match the VM, then the new VM consumes that reservation. Otherwise, the VM is still created, but without consuming any of your reserved resources.

    For more information, see Test that VM properties match a reservation.

Service account access denied

The following error might appear in Cloud Audit Logs when you create VMs using a service account:

Error message:

SERVICE_ACCOUNT_ACCESS_DENIED

Resolution: This error appears when the service account that is used to create a VM doesn't have the Identity and Access Management role to access the new VM's service account.

Grant the roles/iam.serviceAccountUser role to the service account that is creating the VM. You can either grant this role at the project-level, which would give the service account that is creating VMs access to all service accounts created in the project, or you can grant this role only on the service account for the new VM.

Missing required permissions

The following error might occur when you try to create a VM from existing VM

Required 'compute.images.useReadOnly' permission for 'projects/PROJECT_ID/global/images/IMAGE_NAME

This error can occur for several reasons. The following is a common cause of this error:

Free Trial

If you try to create a Windows VM during a Free Trial of Google Cloud you receive an error.

Error message:

Windows VM instances are not included with free trial. To use them first enable billing on your account.

Resolution: Windows Server images aren't included in the Free Trial. Upgrade to a paid Cloud Billing account.

VM doesn't start

If a Linux VM that uses a startup script doesn't start after it was created, it might be related to an issue connecting to the metadata server.

This issue can last for up to seven minutes due to a transient network issue that resolves on its own. If the issue does not resolve itself after seven minutes, recreate the VM.

Errors when updating VMs

If you can't update a VM instance, it might be due to the following issue.

Error when changing the machine type

The following error might occur when you try to change the machine type of a VM:

Invalid value for field 'resource.sourceMachineImage': Updating 'sourceMachineImage' is not supported

Resolution:

  • Make sure that your VM supports the processor of the new machine type. For more information about the processors supported by different machine types, see Machine family comparison.

  • Try to change the machine type by using the Google Cloud CLI.