Open tpdownes opened 7 months ago
Another thought: I believe you can eliminate the need for IAM permissions entirely by modifying and polling VM guest attributes rather than instance metadata.
https://cloud.google.com/compute/docs/metadata/manage-guest-attributes
Overview of the Issue
If the Packer VM is:
then the
packer
process gets stuck in an infinite loop. The guidance to the user is not very informative. My thoughts:retry.Config
to put a limit on the number of Tries or StartTimeoutThese could be done separately. 1 and 2 are probably obvious. The reasoning behind 3 may not be. If you create a service account on Google Cloud and assign it IAM roles, those roles are not immediately applied but have a known propagation delay. Thus an automation pipeline might create the service account, assign it adequate permissions, and nevertheless Packer might fail.
Each timeout might reasonably be 10 minutes to account for worst case propagation delay.
Reproduction Steps
Begin by creating a service account without any IAM roles:
Then supply that project_id and service account to the template below.
Plugin and Packer version
Simplified Packer Buildfile
Log Fragments and crash.log files