This page shows you how to resolve issues with consuming reservations of Compute Engine zonal resources.
Difficulty tracking reservation consumption
Issue: Although you can view the details of a reservation or monitor the consumption of reservations to view how many of its reserved VMs are being consumed and monitor changes to this number over time, you cannot directly view which VMs are consuming a reservation.
Resolution: If you can successfully create a VM that targets a
specific reservation,
then the VM is consuming the reservation specified in the affinity property
(reservationAffinity
) of the VM. Otherwise, creating the VM fails because
the properties don't match
or there are
no available reserved resources.
You can also create a VM that targets a specific reservation to test that it's correctly configured to automatically consume a matching reservation, and then create the VM to consume any matching reservation.
Issues for VMs not consuming reservations
If a VM can't consume a reservation, it might be due to one or more of the following issues:
- The VM's properties don't match the reservation's properties.
- The VM's reservation affinity is incorrect.
- The reservation is already fully consumed by other matching VMs.
- The quota for the resource is exceeded
This section describes how to identify each of these issues, how to resolve each, and how to verify reservation consumption.
Mismatched VM properties
Issue: A VM cannot consume a reservation with different VM properties.
To identify this issue, select one of the following methods:
View the details the reservation and VM, and manually verify that their VM properties match:
View the details of the reservation that you want the VM to consume using the
gcloud compute reservations describe
command:gcloud compute reservations describe RESERVATION_NAME --zone=ZONE
Replace the following:
- RESERVATION_NAME is the name of a reservation.
- ZONE is the zone where the reservation is located.
Keep this output available.
View the details of the VM that you want to consume the reservation
gcloud compute instances describe
command.gcloud compute instances describe VM_NAME
where VM_NAME is the name of the VM.
Keep this output available.
Using both the VM description and reservation description outputs, verify that following properties match:
project
- If the reservation is shared with multiple projects (if the
reservation has the
shareType
property set toSPECIFIC_PROJECTS
), the VM's project can either match the project where the reservation is located or match any of the projects listed undershareSettings
.
- If the reservation is shared with multiple projects (if the
reservation has the
zone
machineType
guestAccelerators.acceleratorType
guestAccelerators.acceleratorCount
minCpuPlatform
- Your VM and reservation must have the exact same
minCpuPlatform
configuration. If you specify aminCpuPlatform
value for either one of them, then both of them must have the same value for that property. Otherwise, both the reservation and the VM should omit the property. For instance, settingminCpuPlatform
to"Intel Broadwell"
when creating a VM will not match theminCpuPlatform
value of"Automatic"
within a reservation.
- Your VM and reservation must have the exact same
localSsds.interface
- The reservation and VM must have the same number of local SSDs with
a matching
localSsds.interface
property for each local SSD.
- The reservation and VM must have the same number of local SSDs with
a matching
resourcePolicies
*
*Only if a reservation specifies a compact placement policy.
Create a VM that targets a specific reservation, which returns an error if the properties don't match. For instructions, see Verify reservation consumption.
Resolution: Update any mismatched VM properties by doing one of the following:
- Update the VM to match the reservation's properties.
- Delete the reservation and create a new reservation that matches the VM's properties.
To check if the VM is now consuming the reservation, see Verify reservation consumption.
If the VM's and reservation's properties match but the VM is not consuming the reservation, proceed to the next section.
VMs miss a placement policy
Issue: A VM is trying to consume a reservation without specifying the reservation's compact placement policy.
Resolution: If a single-project reservation specifies a compact placement policy, a VM must specify exactly the same compact placement policy to consume the reservation. Otherwise, the VM can't consume the reservation.
To make sure that a VM consumes a reservation that specifies a compact placement policy, try one of the following:
If you created a single-project reservation by specifying properties directly, apply the compact placement policy when creating VMs.
If you created a single-project reservation by specifying an instance template, select one of the following methods:
Recommended: use the reservation's instance template to create VMs. This action automatically applies the same compact placement policy specified in the reservation to each new VM you create.
Apply the compact placement policy when creating VMs. This method requires you to manually ensure that the compact placement policy, and any other VM properties, of your VMs and reservations match exactly—any mismatched properties prevent consumption.
VMs specify a different compact placement policy
Issue: A VM is trying to consume a reservation, but the compact placement policy specified in the VM and in the reservation don't match.
Resolution: If a single-project reservation specifies a compact placement policy, a VM must specify exactly the same compact placement policy to consume the reservation. Otherwise, the VM can't consume the reservation.
To solve this issue, try one of the following:
If you created a single-project reservation by specifying properties directly, apply the reservation's compact placement policy when creating new VMs.
If you created a single-project reservation by specifying an instance template, use the same template to create VMs. This action automatically applies the same compact placement policy specified in the reservation to each new VM you create.
VM's reservation affinity is incorrect
Issue: The VM's reservation affinity is misconfigured. A VM's reservation affinity controls the reservations that a VM can consume. To check your VM's reservation affinity, do the following:
-
View the details of the reservation that you want the VM to consume with the
gcloud compute reservations describe
command.gcloud compute reservations describe RESERVATION_NAME --zone=ZONE
Replace the following:
- RESERVATION_NAME is the name of a reservation.
- ZONE is the zone where the reservation is located.
In the output, find the value of the
specificReservationRequired
field, eithertrue
orfalse
. -
View the details of the VM using the
gcloud compute instances describe
command.gcloud compute instances describe VM_NAME
where VM_NAME with the name of the VM.
In the output, find the
reservationAffinity
field, which looks similar to the following:... reservationAffinity: consumeReservationType: RESERVATION_AFFINITY key: compute.googleapis.com/reservation-name values: - RESERVATION_NAME ...
Resolution: Update the VM's reservationAffinity
property
to be compatible with the reservation's specificReservationRequired
field by
using one of the following accepted configurations:
-
If the reservation's
specificReservationRequired
field istrue
, the VM'sreservationAffinity
property must match the following:... reservationAffinity: consumeReservationType: SPECIFIC_RESERVATION key: compute.googleapis.com/reservation-name values: - RESERVATION_NAME ...
where RESERVATION_NAME is the name of the reservation.
-
If the reservation's
specificReservationRequired
field isfalse
, the VM'sreservationAffinity
property must match the following:... reservationAffinity: consumeReservationType: ANY_RESERVATION ...
You need to restart the VM to make the update. After the update, to check if the VM is consuming the reservation, see Verify reservation consumption.
If the VM's reservation affinity is configured correctly but the VM is not consuming any reservations, proceed to the next section.
Reservation is already fully consumed
Issue: The number of VMs currently in use for this reservation matches the reservation's total number of reserved VMs.
To identify this issue, view the details of the reservation and verify that the number of VMs in use for this reservation is less than the reservation's total number of reserved VMs.
Resolution: You can increase the number of VMs available to consume for the reservation by doing one of the following:
- Increase the number of VMs in the reservation by resizing the reservation.
- Create a new reservation with the same properties, if the reservation already reserves the maximum number of VMs.
- Reduce the number of other VMs that are consuming the reservation. For more information, see VMs unintentionally consuming reservations.
To check if the VM is now consuming the reservation, see Verify reservation consumption.
If the reservation is not fully consumed, but the VM is not consuming the reservation, you can further troubleshoot the issue by creating a VM that targets a specific reservation, which returns an error if the consumption fails. For more information, proceed to the next section.
Resource quota exceeded for shared reservations
Issue: A VM isn't consuming a shared reservation because your project doesn't have sufficient quota for the resources that you're trying to consume.
Resolution: Shared reservations have additional quota requirements. If you need to increase quota in your project to consume the reserved resources, then see Request a higher quota in the Cloud Quotas documentation.
VM count not restored after stopping or deleting a VM
Issue: If you stop, suspend, or delete a VM that is consuming a reservation, then the operation must complete before the VM no longer counts against the reservation, and the previously consumed resources are again available for consumption.
Resolution: Wait for a few minutes for the stop, suspend, or delete operation on the VMs to complete. Then, to verify that the stopped, suspended, or deleted VMs no longer count against the reservation, check the total number of consumed VMs in the reservation by using one of the following methods:
Recommended: Monitor the reservation and look for a change in the measurements of the reservation.
View the details of the reservation and check if the value of the
inUseCount
field decreased. If its value didn't decrease, one or more VMs have started consuming the reservation while the stop, suspend, or delete operation was completing.
VMs unintentionally consuming reservations
Issue: When you create reservations that are consumed automatically (default), VMs might unintentionally consume these reservations.
Resolution: You can help control which VMs consume reservations by doing the following:
- Use VMs that cannot consume any reservations where selected.
- Use
reservations that are only consumed when specifically targeted
instead of automatically consumed reservations.