Packer, GCP, and reservations.

20 views
Skip to first unread message

Tony Worm

unread,
Jan 30, 2020, 3:17:33 PM1/30/20
to Packer
Google Cloud has the concept of VM reservations, which we use to ensure K80s are available when needed.

I'm trying to build an image with packer, but it fails to consume any of the reservation. A VM with the same configuration does consume the reservation. There are flags to control how this works, but we have it set to defaults (with no need to specify flags) and still see our reservations used outside of packer.

How can I see what packer is sending to the GCloud API Or where to start tracing this issue? Code and / or debug flags maybe?

Rickard von Essen

unread,
Jan 30, 2020, 4:16:19 PM1/30/20
to packe...@googlegroups.com
Run packer with env var PACKER_LOG=1 and you will get more debug info. 

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/a688ef34-c576-493c-bfb8-b13641c143bb%40googlegroups.com.

Tony Worm

unread,
Jan 30, 2020, 4:44:10 PM1/30/20
to Packer
Logging didn't provide any additional information to help. We are aware of the root error and the logs below show what we see in the GCloud console.

Another unexpected behavior exists for packer in these logs. While packer attempts to retry in the face of the GCP error, CTRL-C is ignored and we cannot exit the packer binary running.

We are able to bring up this same VM configuration using the gcloud tool directly. This consumes one of our reservations. My goal is to determine why, when using packer, a reservation is not being consumed.



======
2020/01/30 14:24:13 packer-builder-googlecompute plugin: Retryable error: 1 error(s) occurred:
2020/01/30 14:24:13 packer-builder-googlecompute plugin: 
2020/01/30 14:24:13 packer-builder-googlecompute plugin: * The zone 'projects/ferrum-dev/zones/us-central1-a' does not have enough resources available to fulfill the request.  '(resource type:compute)'.
2020/01/30 14:24:15 packer-builder-googlecompute plugin: Retryable error: 1 error(s) occurred:
2020/01/30 14:24:15 packer-builder-googlecompute plugin: 
2020/01/30 14:24:15 packer-builder-googlecompute plugin: * The zone 'projects/ferrum-dev/zones/us-central1-a' does not have enough resources available to fulfill the request.  '(resource type:compute)'.
^C2020/01/30 14:24:17 packer-provisioner-ansible plugin: Received interrupt signal (count: 14). Ignoring.
2020/01/30 14:24:17 packer-provisioner-ansible plugin: Received interrupt signal (count: 14). Ignoring.
2020/01/30 14:24:17 packer-provisioner-ansible plugin: Received interrupt signal (count: 14). Ignoring.
2020/01/30 14:24:17 packer-builder-googlecompute plugin: Received interrupt signal (count: 14). Ignoring.
2020/01/30 14:24:17 packer-provisioner-ansible plugin: Received interrupt signal (count: 14). Ignoring.
^C2020/01/30 14:24:17 packer-provisioner-ansible plugin: Received interrupt signal (count: 15). Ignoring.
2020/01/30 14:24:17 packer-provisioner-ansible plugin: Received interrupt signal (count: 15). Ignoring.
2020/01/30 14:24:17 packer-provisioner-ansible plugin: Received interrupt signal (count: 15). Ignoring.
2020/01/30 14:24:17 packer-provisioner-ansible plugin: Received interrupt signal (count: 15). Ignoring.
2020/01/30 14:24:17 packer-builder-googlecompute plugin: Received interrupt signal (count: 15). Ignoring.
2020/01/30 14:24:17 packer-builder-googlecompute plugin: Retryable error: 1 error(s) occurred:
2020/01/30 14:24:17 packer-builder-googlecompute plugin: 
2020/01/30 14:24:17 packer-builder-googlecompute plugin: * The zone 'projects/ferrum-dev/zones/us-central1-a' does not have enough resources available to fulfill the request.  '(resource type:compute)'.
2020/01/30 14:24:20 packer-builder-googlecompute plugin: Retryable error: 1 error(s) occurred:
2020/01/30 14:24:20 packer-builder-googlecompute plugin: 
2020/01/30 14:24:20 packer-builder-googlecompute plugin: * The zone 'projects/ferrum-dev/zones/us-central1-a' does not have enough resources available to fulfill the request.  '(resource type:compute)'.
======

Tony Worm

unread,
Jan 30, 2020, 5:04:15 PM1/30/20
to Packer
Figured it out.

Reservations are very specific, even when set in "any" mode (which is the default). We have the min_cpu_platform in the reservation, but not in the image.json file. Adding it there solved the reservation consumption issue.
Reply all
Reply to author
Forward
0 new messages