Giter Site home page Giter Site logo

hashicorp / packer-plugin-googlecompute Goto Github PK

View Code? Open in Web Editor NEW
22.0 12.0 50.0 1.22 MB

Packer plugin for Google Compute Builder

Home Page: https://www.packer.io/docs/builders/googlecompute

License: Mozilla Public License 2.0

Makefile 0.37% Go 87.55% HCL 0.53% MDX 10.01% Shell 1.54%
packer-plugin gcp packer google googlecompute

packer-plugin-googlecompute's Introduction

Packer Plugin Googlecompute

The Googlecompute multi-component plugin can be used with HashiCorp Packer to create custom images. For the full list of available features for this plugin see docs.

Installation

Using pre-built releases

Using the packer init command

Starting from version 1.7, Packer supports a new packer init command allowing automatic installation of Packer plugins. Read the Packer documentation for more information.

To install this plugin, copy and paste this code into your Packer configuration . Then, run packer init.

packer {
  required_plugins {
    googlecompute = {
      version = ">= 1.1.4"
      source  = "github.com/hashicorp/googlecompute"
    }
  }
}

Manual installation

You can find pre-built binary releases of the plugin here. Once you have downloaded the latest archive corresponding to your target OS, uncompress it to retrieve the plugin binary file corresponding to your platform. To install the plugin, please follow the Packer documentation on installing a plugin.

From Sources

If you prefer to build the plugin from sources, clone the GitHub repository locally and run the command go build from the root directory. Upon successful compilation, a packer-plugin-googlecompute plugin binary file can be found in the root directory. To install the compiled plugin, please follow the official Packer documentation on installing a plugin.

Configuration

For more information on how to configure the plugin, please read the documentation located in the docs/ directory.

Contributing

  • If you think you've found a bug in the code or you have a question regarding the usage of this software, please reach out to us by opening an issue in this GitHub repository.
  • Contributions to this project are welcome: if you want to add a feature or a fix a bug, please do so by opening a Pull Request in this GitHub repository. In case of feature contribution, we kindly ask you to open an issue to discuss it beforehand.

packer-plugin-googlecompute's People

Contributors

arnaud-dezandee avatar atsushi-ishibashi avatar azr avatar cbednarski avatar crunk1 avatar dependabot[bot] avatar erjohnso avatar evandbrown avatar filirom1 avatar hashicorp-copywrite[bot] avatar jescalan avatar jsoref avatar lbajolet-hashicorp avatar mbrukman avatar minimum2scp avatar mitchellh avatar msarahan avatar mwhooker avatar nywilken avatar pschultz avatar psinghal20 avatar rasa avatar rickard-von-essen avatar seanmalloy avatar sethvargo avatar seventieskid avatar swampdragons avatar sylviamoss avatar tkrisko avatar upodroid avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

packer-plugin-googlecompute's Issues

googlecompute builder ignores precedence of authentication methods when running in GCE

This issue was originally opened by @rbjorklin as hashicorp/packer#10607. It was migrated here as a result of the Packer plugin split. The original body of the issue is below.


Overview of the Issue

googlecompute builder ignores precedence of authentication methods when running in GCE. The issue can be worked around by commenting this line.

Reproduction Steps

  • Run a packer build with the ansible provisioner using use_os_login from your local workstation using account_file
  • Try running the same build from within GCE itself and watch the build either fail or use other credentials than specified

Packer version

Packer v1.7.0-dev

Simplified Packer Buildfile

source "googlecompute" "build-dev-agent" {
  service_account_email   = "<something>"
  image_name              = "jenkins-build-agent-${formatdate("YYYY-MM-DD't'hh-mm-ss", timestamp())}"
  image_family            = "jenkins-build-agent"
  use_os_login            = true
  project_id              = "<something>"
  source_image_family     = "centos-7"
  ssh_username            = "packer"
  zone                    = "<something>"
  network_project_id      = "<something>"
  subnetwork              = "<something>"
  omit_external_ip        = true
  use_internal_ip         = true
  account_file            = "sa_key.json"
}

build {
  sources = [
    "sources.googlecompute.build-dev-agent",
  ]

  provisioner "ansible" {
    host_alias      = "localhost"
    playbook_file   = "./playbook.yml"
  }
}

Operating system and Environment details

Centos 7, x86_64

Log Fragments and crash.log files

packer-builder-googlecompute plugin: [INFO] Requesting Google token via account_file...
packer-builder-googlecompute plugin: [INFO]   -- Email: [email protected]
...
packer-builder-googlecompute plugin: [INFO] OSLogin: GCE service account [email protected] will be used for identity
==> googlecompute.build-dev-agent: Importing SSH public key for OSLogin...
==> googlecompute.build-dev-agent: Error importing SSH public key for OSLogin: googleapi: Error 403: End user credentials must match the user specified in the request., forbidden

Rocky linux image is not found

Creating a custom image from rocky linux results in the following error:
Error getting source image for instance creation: Could not find image, rocky-linux-8-v20211105.

Setting source_image to centos-8-v20211105 causes no error.

Plugin and Packer version

packer --version 1.7.8
hashicorp/packer-plugin-googlecompute 1.0.7

Packer Buildfile

packer {
  required_plugins {
    googlecompute = {
      version = ">= 1.0.7"
      source  = "github.com/hashicorp/googlecompute"
    }
  }
}

variable "project_id"{
  type = string
}

source "googlecompute" "test" {
  project_id   = var.project_id
  zone = "us-central1-a"
  source_image = "rocky-linux-8-v20211105"
  ssh_username = "test"
  image_name   = "test-rocky-1"
  image_family = "test-rocky"
}

build {
  sources = [
    "source.googlecompute.test"
  ]
  provisioner "shell" {
    inline = ["echo foo"]
  }
}

Error 400: Invalid value for field 'resource.sourceDisk'

Overview of the Issue

When trying to use googlecompute, v0.0.2 plugin, packer is failing to create an image after successful build phase. Using packer 1.7.2 binary without required_plugins block and init works fine as before for very same code (template), in same environment.

Reproduction Steps

Execution of packer templates with defined required_plugins block after packer init

Plugin and Packer version

packer 1.7.2
plugin 0.0.2

Simplified Packer Buildfile

source "googlecompute" "default" {
  disk_size             = var.disk_size
  disk_type             = var.disk_type
  image_description     = var.desc
  image_family          = var.image_family
  image_labels          = var.image_labels
  image_name            = var.image_name
  labels                = var.labels
  machine_type          = var.machine_type
  network               = var.network
  omit_external_ip      = var.omit_external_ip
  preemptible           = var.preemptible
  project_id            = var.project_id
  scopes                = var.scopes
  service_account_email = var.service_account_email
  source_image_family   = var.source_image_family
  ssh_username          = var.ssh_username
  subnetwork            = var.subnetwork
  tags                  = var.tags
  use_internal_ip       = var.use_internal_ip
  zone                  = var.zone
}

Operating system and Environment details

CentOS7/8, RHEL 7/8 Google provided images

Log Fragments and crash.log files

Step #1: ==> googlecompute.default: Creating image...
Step #1: ==> googlecompute.default: Error waiting for image: googleapi: Error 400: Invalid value for field 'resource.sourceDisk': 'https://compute.googleapis.com/compute/v1/project/zones/europe-west3-a/disks/packer-60815dbe-bb2b-1e0b-fd89-fb85adceef25'. The URL is malformed., invalid
Step #1: ==> googlecompute.default: Deleting disk...
Step #1:     googlecompute.default: Disk has been deleted!
Step #1: ==> googlecompute.default: Provisioning step had errors: Running the cleanup provisioner, if present...
Step #1: Build 'googlecompute.default' errored after 5 minutes 45 seconds: Error waiting for image: googleapi: Error 400: Invalid value for field 'resource.sourceDisk': 'https://compute.googleapis.com/compute/v1/project/zones/europe-west3-a/disks/packer-60815dbe-bb2b-1e0b-fd89-fb85adceef25'. The URL is malformed., invalid
Step #1: 
Step #1: ==> Wait completed after 5 minutes 45 seconds
Step #1: 
Step #1: ==> Some builds didn't complete successfully and had errors:
Step #1: --> googlecompute.default: Error waiting for image: googleapi: Error 400: Invalid value for field 'resource.sourceDisk': 'https://compute.googleapis.com/compute/v1/project/zones/europe-west3-a/disks/packer-60815dbe-bb2b-1e0b-fd89-fb85adceef25'. The URL is malformed., invalid
Step #1: 
Step #1: ==> Builds finished but no artifacts were created.
Finished Step

Debug log:

https://gist.github.com/danielkubat/99f7daf290d33ab6c81d9d5f25c90cda

Allow pushing images to separate GCP projects

Community Note

Please vote on this issue by adding a ๐Ÿ‘ reaction to the original issue to help the community and maintainers prioritize this request.
Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request.
If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Description

Right now images that are generated by modified virtual machines are created in the same project that the original VM was created in. It could be useful to be given the option to create an image in a different project. This option would allow for the creation of multiple different images environments as well as potentially restrict Packer's permissions in more secure projects.

Use Case(s)

A good use case for this would be any situation where you would want to limit the permissions given to Packer in a specific environment. For example, it may be desirable to give Packer permissions to only modify images in a shared project while granting it instance admin on a different project to actually create and configure virtual machines.

Another potential use case is having separate QA and production projects for images. Then Packer could be configured to push images to the correct projects.

Potential configuration

A new image_project_id option that defaults to project_id

Post-processor googlecompute-export fails with unexpected EOF

This issue was originally opened by @diegolima in hashicorp/packer#11419 and has been migrated to this repository. The original issue description is below.


Overview of the Issue

Trying to use the googlecompute-export postprocessor causes the packer build to fail.

Reproduction Steps

Run packer build with the provided template.

Packer version

Packer v1.7.8

Simplified Packer Template

packer {
  required_plugins {
    googlecompute = {
      version = ">= 0.0.1"
      source = "github.com/hashicorp/googlecompute"
    }
  }
}

variable "root_password" {
  type = string
  default = "somepassword"
  sensitive = true
}
variable "gcp_bucket" {
  type = string
  default = "gs://my-bucket"
}

source "googlecompute" "centos79-cvp" {
  project_id = "cvp-tests"
  source_image = "centos-7-v20211105"
  ssh_username = "packer"
  zone = "us-central1-a"
}

build {
  name = "centos79-cvp"
  sources = ["sources.googlecompute.centos79-cvp"]
  provisioner "shell" {
    inline = [
      "yum list installed|grep @updates|awk '{print $1}'|xargs sudo yum -y downgrade --disablerepo=updates",
      "sudo sed -i 's/PermitRootLogin no/PermitRootLogin yes/g' /etc/ssh/sshd_config",
      "sudo sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config",
      "echo -e \"${var.root_password}\n${var.root_password}\"|sudo passwd root"
    ]
  }
  post-processor "googlecompute-export" {
    paths = [
      "${var.gcp_bucket}/centos79-cvp-autobuild.tar.gz"
    ]
  }
}

Operating system and Environment details

I'm running packer under Ubuntu 20.04.3 on Windows 10 WSL:

  NAME                   STATE           VERSION
* Ubuntu                 Running         2

Log Fragments and crash.log files

When running with PACKER_LOG=1 I could see the following while running the post-processor:

==> centos79-cvp.googlecompute.centos79-cvp: Running post-processor:  (type googlecompute-export)
==> centos79-cvp.googlecompute.centos79-cvp (googlecompute-export): Exporting image packer-1638182956 to destination: [gs://my-bucket/centos79-cvp-autobuild.tar.gz]
2021/11/29 11:52:56 packer-plugin-googlecompute_v1.0.6_x5.0_linux_amd64 plugin: 2021/11/29 11:52:56 [INFO] Requesting Google token via GCE API Default Client Token Source...
2021/11/29 11:52:56 packer-plugin-googlecompute_v1.0.6_x5.0_linux_amd64 plugin: 2021/11/29 11:52:56 [INFO] Instantiating GCE client...
2021/11/29 11:52:56 packer-plugin-googlecompute_v1.0.6_x5.0_linux_amd64 plugin: 2021/11/29 11:52:56 [INFO] Instantiating OS Login client...
==> centos79-cvp.googlecompute.centos79-cvp (googlecompute-export): Creating temporary RSA SSH key for instance...
2021/11/29 11:53:25 packer-plugin-googlecompute_v1.0.6_x5.0_linux_amd64 plugin: panic: runtime error: invalid memory address or nil pointer dereference
2021/11/29 11:53:25 packer-plugin-googlecompute_v1.0.6_x5.0_linux_amd64 plugin: [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x6383e5]
2021/11/29 11:53:25 packer-plugin-googlecompute_v1.0.6_x5.0_linux_amd64 plugin: 
2021/11/29 11:53:25 packer-plugin-googlecompute_v1.0.6_x5.0_linux_amd64 plugin: goroutine 82 [running]:
2021/11/29 11:53:25 packer-plugin-googlecompute_v1.0.6_x5.0_linux_amd64 plugin: github.com/hashicorp/packer-plugin-sdk/packerbuilderdata.(*GeneratedData).Put(0x0, {0x1380274, 0xf}, {0x10bce80, 0xc0002f3c90})
2021/11/29 11:53:25 packer-plugin-googlecompute_v1.0.6_x5.0_linux_amd64 plugin:         github.com/hashicorp/[email protected]/packerbuilderdata/generated_data.go:26 +0x45
2021/11/29 11:53:25 packer-plugin-googlecompute_v1.0.6_x5.0_linux_amd64 plugin: github.com/hashicorp/packer-plugin-googlecompute/builder/googlecompute.(*StepCreateInstance).Run(0xc000480820, {0x15d7848, 0xc000122740}, {0x15d7ce0, 0xc000303740})
2021/11/29 11:53:25 packer-plugin-googlecompute_v1.0.6_x5.0_linux_amd64 plugin:         github.com/hashicorp/packer-plugin-googlecompute/builder/googlecompute/step_create_instance.go:130 +0x259
2021/11/29 11:53:25 packer-plugin-googlecompute_v1.0.6_x5.0_linux_amd64 plugin: github.com/hashicorp/packer-plugin-sdk/multistep.(*BasicRunner).Run(0xc0003037a0, {0x15d7848, 0xc000122740}, {0x15d7ce0, 0xc000303740})
2021/11/29 11:53:25 packer-plugin-googlecompute_v1.0.6_x5.0_linux_amd64 plugin:         github.com/hashicorp/[email protected]/multistep/basic_runner.go:70 +0x2fe
2021/11/29 11:53:25 packer-plugin-googlecompute_v1.0.6_x5.0_linux_amd64 plugin: github.com/hashicorp/packer-plugin-googlecompute/post-processor/googlecompute-export.(*PostProcessor).PostProcess(0xc00000a1e0, {0x15d7848, 0xc000122740}, {0x15de978, 0xc0007a2e70}, {0x15de9c0, 0xc000308960})
2021/11/29 11:53:25 packer-plugin-googlecompute_v1.0.6_x5.0_linux_amd64 plugin:         github.com/hashicorp/packer-plugin-googlecompute/post-processor/googlecompute-export/post-processor.go:238 +0xdd9
2021/11/29 11:53:25 packer-plugin-googlecompute_v1.0.6_x5.0_linux_amd64 plugin: github.com/hashicorp/packer-plugin-sdk/rpc.(*PostProcessorServer).PostProcess(0xc000122000, 0x7b68b8, 0xc000480100)
2021/11/29 11:53:25 packer-plugin-googlecompute_v1.0.6_x5.0_linux_amd64 plugin:         github.com/hashicorp/[email protected]/rpc/post_processor.go:108 +0x18c
2021/11/29 11:53:25 packer-plugin-googlecompute_v1.0.6_x5.0_linux_amd64 plugin: reflect.Value.call({0xc00056e360, 0xc000306080, 0x13}, {0x1373c9f, 0x4}, {0xc0005ddef8, 0x3, 0x3})
2021/11/29 11:53:25 packer-plugin-googlecompute_v1.0.6_x5.0_linux_amd64 plugin:         reflect/value.go:543 +0x814
2021/11/29 11:53:25 packer-plugin-googlecompute_v1.0.6_x5.0_linux_amd64 plugin: reflect.Value.Call({0xc00056e360, 0xc000306080, 0xc00060a000}, {0xc0003776f8, 0x3, 0x3})
2021/11/29 11:53:25 packer-plugin-googlecompute_v1.0.6_x5.0_linux_amd64 plugin:         reflect/value.go:339 +0xc5
2021/11/29 11:53:25 packer-plugin-googlecompute_v1.0.6_x5.0_linux_amd64 plugin: net/rpc.(*service).call(0xc000122040, 0xc00011c0b5, 0x0, 0xc000732100, 0xc000752280, 0x60be05, {0x10bd080, 0xc0007b68a8, 0x60bd86}, {0x106c960, ...}, ...)
2021/11/29 11:53:25 packer-plugin-googlecompute_v1.0.6_x5.0_linux_amd64 plugin:         net/rpc/server.go:377 +0x239
2021/11/29 11:53:25 packer-plugin-googlecompute_v1.0.6_x5.0_linux_amd64 plugin: created by net/rpc.(*Server).ServeCodec
2021/11/29 11:53:25 packer-plugin-googlecompute_v1.0.6_x5.0_linux_amd64 plugin:         net/rpc/server.go:474 +0x405
2021/11/29 11:53:25 [INFO] (telemetry) ending googlecompute-export
2021/11/29 11:53:25 Deleting original artifact for build 'googlecompute.centos79-cvp'
2021/11/29 11:53:25 /root/.config/packer/plugins/github.com/hashicorp/googlecompute/packer-plugin-googlecompute_v1.0.6_x5.0_linux_amd64: plugin process exited
2021/11/29 11:53:25 packer-plugin-googlecompute_v1.0.6_x5.0_linux_amd64 plugin: 2021/11/29 11:53:25 Destroying image: packer-1638182956
2021/11/29 11:53:27 packer-plugin-googlecompute_v1.0.6_x5.0_linux_amd64 plugin: 2021/11/29 11:53:27 Retryable error: retrying for state DONE, got RUNNING
2021/11/29 11:53:29 packer-plugin-googlecompute_v1.0.6_x5.0_linux_amd64 plugin: 2021/11/29 11:53:29 Retryable error: retrying for state DONE, got RUNNING

Build 'centos79-cvp.googlecompute.centos79-cvp' errored after 4 minutes 15 seconds: 1 error(s) occurred:
* Post-processor failed: unexpected EOF

GCP import post processor: -force option does not work

This issue was originally opened by @cevich in hashicorp/packer#9872 and has been migrated to this repository. The original issue description is below.


Overview of the Issue

Importing Fedora image through the (advanced/complex) nested KVM -> googlecompute-import post-processor works fine the first time. However, when executing packer build a second time, while specifying -force option, we get this error message.

Reproduction Steps

qemu builder -> shell provisioner -> compress then googlecompute-import post-processors

Packer version

1.4.5

Simplified Packer Buildfile

https://github.com/containers/automation_images/blob/master/base_images/gce.yml

Operating system and Environment details

Host is running CentOS 8 in GCE, but problem is also reproducible locally in a CentOS 8 container (provided GCE application default credentials).

Log Fragments and crash.log files

==> fedora (googlecompute-import): Uploading file /tmp/automation_images_tmp/fedora/disk.raw.tar.gz to GCS bucket packer-import/fedora-1598993532.tar.gz...
==> fedora (googlecompute-import): Creating GCE image fedora-b1598993532...
==> fedora (googlecompute-import): Error creating GCE image
2020/09/01 21:26:49 Deleting original artifact for build 'fedora'
Build 'fedora' errored: 1 error(s) occurred:


* Post-processor failed: googleapi: Error 409: The resource 'projects/libpod-218412/global/images/fedora-b1598993532' already exists, alreadyExists
2020/09/01 21:26:49 machine readable: error-count []string{"1"}
==> Some builds didn't complete successfully and had errors:
2020/09/01 21:26:49 machine readable: fedora,error []string{"1 error(s) occurred:\n\n* Post-processor failed: googleapi: Error 409: The resource 'projects/libpod-218412/global/images/fedora-b1598993532' already exists, alreadyExists"}

* Post-processor failed: googleapi: Error 409: The resource 'projects/libpod-218412/global/images/fedora-b1598993532' already exists, alreadyExists
==> Builds finished but no artifacts were created.
* Post-processor failed: googleapi: Error 409: The resource 'projects/libpod-218412/global/images/fedora-b1598993532' already exists, alreadyExists

==> Some builds didn't complete successfully and had errors:
--> fedora: 1 error(s) occurred:

* Post-processor failed: googleapi: Error 409: The resource 'projects/libpod-218412/global/images/fedora-b1598993532' already exists, alreadyExists

2020/09/01 21:26:49 waiting for all plugin processes to complete...
==> Builds finished but no artifacts were created.

Googlecompute builder using IAP errors unless account JSON token is provided

This issue was originally opened by @PhilHayward as hashicorp/packer#10813. It was migrated here as a result of the Packer plugin split. The original body of the issue is below.


Overview of the Issue

I'm attempting to use the packer googlecompute builder from within Google Cloud. The packer environment is authenticated with google cloud using the instance service account. The packer environment is not in the same VPC as the build instance (and resulting GCE image). My organization prohibits the use of external IPs. I would like to use IAP to connect to the build instance, to simplify my firewall configuration.

When I run packer, it errors out when attempting to create the IAP tunnel:
googlecompute: Non-retryable tunnel error: ERROR: (gcloud.auth.activate-service-account) Unable to read file []: [Errno 2] No such file or directory: ''

It appears that packer is attempting to invoke gcloud auth activate-service-account, but since I did not provide an auth token file, it's failing.

I expect packer to use the same authentication for IAP as for all other google cloud operations. If an auth token file has been specified via the account_file option, it should activate the service account as is currently done. Otherwise, it should allow gcloud to use the default authentication process.

Reproduction Steps

  1. Create two VPCs, one to host packer, the other to host the build instance.
  2. Configure Cloud NAT for both VPCs.
  3. Create a firewall rule in the build instance VPC to allow IAP SSH access (gcloud compute firewall-rules create allow-ssh-ingress-from-iap
    --direction=INGRESS
    --action=allow
    --rules=tcp:22
    --source-ranges=35.235.240.0/20)
  4. Create a packer service account, and bind the iap.tunnelResourceAccessor role in addition to the standard roles used for google compute.
  5. Create a separate 'builder' service account with both the log writer and metrics writer roles.
  6. Create an instance ('packer instance') within the packer VPC, with the packer service account attached to the instance.
  7. Run the packer build file below from the packer instance, with variables set as appropriate.

Packer version

1.7.0

Simplified Packer Buildfile

{
"builders": [
{
"type": "googlecompute",
"project_id": "{{user service_project_id}}",
"image_name": "image-{{timestamp | clean_resource_name}}",
"source_image_family": "ubuntu-1804-lts",
"disk_size": "10",
"machine_type": "e2-small",
"ssh_username": "packer",
"zone": "{{user build_zone}}",
"network_project_id": "{{user host_project_id}}",
"network": "{{user host_network}}",
"subnetwork": "{{user subnet}}",
"omit_external_ip": true,
"use_internal_ip": true,
"scopes": ["https://www.googleapis.com/auth/cloud-platform"],
"service_account_email": "builder@{{user service_project_id}}.iam.gserviceaccount.com",
"use_iap": true,
"metadata": {}
}
]
}

Log Fragments and crash.log files

11:55:56 ==> googlecompute: Step Launch IAP Tunnel...
11:55:56 2021/03/23 17:55:54 packer-builder-googlecompute plugin: Finding an available TCP port for IAP proxy
11:55:56 2021/03/23 17:55:54 packer-builder-googlecompute plugin: Found available port: 8849 on IP: 0.0.0.0
11:55:56 2021/03/23 17:55:54 packer-builder-googlecompute plugin: Setting up proxy to listen on localhost at 8849
11:55:56 2021/03/23 17:55:54 packer-builder-googlecompute plugin: Creating tunnel launch script with args []string{"compute", "start-iap-tunnel", "packer-605a2b7d-16d2-0df3-d1f6-5aa4a97b5629", "22", "--local-host-port=localhost:8849", "--zone", "us-west1-b", "--project", "random-critter-7a05"}
11:55:56 2021/03/23 17:55:54 packer-builder-googlecompute plugin: [INFO] (google): Prepending inline gcloud setup script with #!/bin/sh
11:55:56 2021/03/23 17:55:55 packer-builder-googlecompute plugin: stderr: ERROR: (gcloud.auth.activate-service-account) Unable to read file []: [Errno 2] No such file or directory: ''
11:55:56 2021/03/23 17:55:55 packer-builder-googlecompute plugin: NOT RETRYABLE: ERROR: (gcloud.auth.activate-service-account) Unable to read file []: [Errno 2] No such file or directory: ''
11:55:56 ==> googlecompute:
11:55:56 ==> googlecompute: Non-retryable tunnel error: ERROR: (gcloud.auth.activate-service-account) Unable to read file []: [Errno 2] No such file or directory: ''

Broken OSLogin service account authentication on Packer 1.0.10

Overview of the Issue

Service account authentication with OSLogin does not work on Packer 1.0.10. Reverting to Packer 1.0.9 solved the issue. My wild guess is that this PR may have caused the issue

Reproduction Steps

Authentication is performed through both the gcloud CLI and GOOGLE_APPLICATION_CREDENTIALS environment variable. They both use a service account key.

gcloud auth activate-service-account --key-file /tmp/.service-account-key.json
export GOOGLE_APPLICATION_CREDENTIALS="/tmp/.service-account-key.json"

Run packer build trying to provision a VM with use_os_login = true

Plugin and Packer version

From plugin version: 1.0.10

Simplified Packer Buildfile

source "googlecompute" "cos_image" {
  enable_integrity_monitoring = true
  enable_secure_boot          = true
  enable_vtpm                 = true
  metadata = {
    enable-oslogin-2fa = "FALSE"
  }
  omit_external_ip        = true
  service_account_email   = local.service_account_email
  subnetwork              = local.network
  use_iap                 = true
  use_internal_ip         = true
  use_os_login            = true
  // Other parameter omitted for simplicity
}

Operating system and Environment details

Linux

Log Fragments and crash.log files

2022-01-31T09:58:37Z: ==> googlecompute.cos_image: Checking image does not exist...
2022-01-31T09:58:37Z: ==> googlecompute.cos_image: Creating temporary RSA SSH key for instance...
2022-01-31T09:58:37Z: ==> googlecompute.cos_image: Importing SSH public key for OSLogin...
2022-01-31T09:58:42Z: ==> googlecompute.cos_image: All options for deriving the OSLogin user have been exhausted
2022-01-31T09:58:42Z: ==> googlecompute.cos_image: Deleting SSH public key for OSLogin...
2022-01-31T09:58:42Z: ==> googlecompute.cos_image: Error deleting SSH public key for OSLogin. Please delete it manually.
==> googlecompute.cos_image: 
==> googlecompute.cos_image: Error: googleapi: Error 401: End user credentials not provided.
2022-01-31T09:58:42Z: Build 'googlecompute.cos_image' errored after 5 seconds 729 milliseconds: All options for deriving the OSLogin user have been exhausted

==> Wait completed after 5 seconds 729 milliseconds

==> Some builds didn't complete successfully and had errors:
--> googlecompute.cos_image: All options for deriving the OSLogin user have been exhausted

Can't finish simple build of google VM

Overview of the Issue

Simple packer build fails with timeout when running as owner of the project

Reproduction Steps

source "googlecompute" "this_eu" {
  project_id                  = "vegaprotocol"
  source_image_family         = "ubuntu-2004-lts"
  ssh_username                = "ubuntu"
  zone                        = "europe-west2-a"
  image_name                  = replace("base-node-${local.version}", ".", "-")
  machine_type                = "n2-standard-8"
}
build {
  sources = [
    "source.googlecompute.this_eu",
]
}
packer {
  required_plugins {
    googlecompute = {
      version = ">= 1.0.13"
      source  = "github.com/hashicorp/googlecompute"
    }
  }
}

Plugin and Packer version

Packer v1.8.2

Operating system and Environment details

linux, ubuntu 20.04, amd64

Log Fragments and crash.log files

โžœ packer build .
2022/07/07 23:56:55 [INFO] Packer version: 1.8.2 [go1.17.11 linux amd64]
2022/07/07 23:56:55 [TRACE] discovering plugins in /usr/bin
2022/07/07 23:56:55 [TRACE] discovering plugins in /home/mlodzikos/.config/packer/plugins
2022/07/07 23:56:55 [DEBUG] Discovered plugin: amazon = /home/mlodzikos/.config/packer/plugins/github.com/hashicorp/amazon/packer-plugin-amazon_v1.1.1_x5.0_linux_amd64
2022/07/07 23:56:55 [DEBUG] Discovered plugin: digitalocean = /home/mlodzikos/.config/packer/plugins/github.com/hashicorp/digitalocean/packer-plugin-digitalocean_v1.0.6_x5.0_linux_amd64
2022/07/07 23:56:55 [DEBUG] Discovered plugin: googlecompute = /home/mlodzikos/.config/packer/plugins/github.com/hashicorp/googlecompute/packer-plugin-googlecompute_v1.0.12_x5.0_linux_amd64
2022/07/07 23:56:55 [DEBUG] Discovered plugin: googlecompute = /home/mlodzikos/.config/packer/plugins/github.com/hashicorp/googlecompute/packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64
2022/07/07 23:56:55 [INFO] found external [chroot ebs ebssurrogate ebsvolume instance] builders from amazon plugin
2022/07/07 23:56:55 [INFO] found external [import] post-processors from amazon plugin
2022/07/07 23:56:55 found external [ami parameterstore secretsmanager] datasource from amazon plugin
2022/07/07 23:56:55 [INFO] found external [-packer-default-plugin-name-] builders from digitalocean plugin
2022/07/07 23:56:55 [INFO] found external [import] post-processors from digitalocean plugin
2022/07/07 23:56:55 [INFO] found external [-packer-default-plugin-name-] builders from googlecompute plugin
2022/07/07 23:56:55 [INFO] found external [export import] post-processors from googlecompute plugin
2022/07/07 23:56:55 [TRACE] discovering plugins in .
2022/07/07 23:56:55 [INFO] PACKER_CONFIG env var not set; checking the default config file path
2022/07/07 23:56:55 [INFO] PACKER_CONFIG env var set; attempting to open config file: /home/mlodzikos/.packerconfig
2022/07/07 23:56:55 [WARN] Config file doesn't exist: /home/mlodzikos/.packerconfig
2022/07/07 23:56:55 [INFO] Setting cache directory: /home/mlodzikos/.cache/packer
2022/07/07 23:56:55 [TRACE] listing potential installations for "github.com/hashicorp/googlecompute" that match ">= 1.0.13". plugingetter.ListInstallationsOptions{FromFolders:[]string{"/usr/bin/packer", ".", "/home/mlodzikos/.config/packer/plugins"}, BinaryInstallationOptions:plugingetter.BinaryInstallationOptions{APIVersionMajor:"5", APIVersionMinor:"0", OS:"linux", ARCH:"amd64", Ext:"", Checksummers:[]plugingetter.Checksummer{plugingetter.Checksummer{Type:"sha256", Hash:(*sha256.digest)(0xc000880d00)}}}}
2022/07/07 23:56:55 [TRACE] version "v1.0.12" of file "/home/mlodzikos/.config/packer/plugins/github.com/hashicorp/googlecompute/packer-plugin-googlecompute_v1.0.12_x5.0_linux_amd64" does not match constraint ">= 1.0.13"
2022/07/07 23:56:56 [TRACE] Found the following "github.com/hashicorp/googlecompute" installations: [{/home/mlodzikos/.config/packer/plugins/github.com/hashicorp/googlecompute/packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 v1.0.13}]
2022/07/07 23:56:56 [INFO] found external [-packer-default-plugin-name-] builders from googlecompute plugin
2022/07/07 23:56:56 [INFO] found external [export import] post-processors from googlecompute plugin
2022/07/07 23:56:56 [TRACE] listing potential installations for "github.com/hashicorp/digitalocean" that match ">= 1.0.6". plugingetter.ListInstallationsOptions{FromFolders:[]string{"/usr/bin/packer", ".", "/home/mlodzikos/.config/packer/plugins"}, BinaryInstallationOptions:plugingetter.BinaryInstallationOptions{APIVersionMajor:"5", APIVersionMinor:"0", OS:"linux", ARCH:"amd64", Ext:"", Checksummers:[]plugingetter.Checksummer{plugingetter.Checksummer{Type:"sha256", Hash:(*sha256.digest)(0xc000880d00)}}}}
2022/07/07 23:56:56 [TRACE] Found the following "github.com/hashicorp/digitalocean" installations: [{/home/mlodzikos/.config/packer/plugins/github.com/hashicorp/digitalocean/packer-plugin-digitalocean_v1.0.6_x5.0_linux_amd64 v1.0.6}]
2022/07/07 23:56:56 [INFO] found external [-packer-default-plugin-name-] builders from digitalocean plugin
2022/07/07 23:56:56 [INFO] found external [import] post-processors from digitalocean plugin
2022/07/07 23:56:56 [TRACE] listing potential installations for "github.com/hashicorp/amazon" that match ">= 1.1.1". plugingetter.ListInstallationsOptions{FromFolders:[]string{"/usr/bin/packer", ".", "/home/mlodzikos/.config/packer/plugins"}, BinaryInstallationOptions:plugingetter.BinaryInstallationOptions{APIVersionMajor:"5", APIVersionMinor:"0", OS:"linux", ARCH:"amd64", Ext:"", Checksummers:[]plugingetter.Checksummer{plugingetter.Checksummer{Type:"sha256", Hash:(*sha256.digest)(0xc000880d00)}}}}
2022/07/07 23:56:56 [TRACE] Found the following "github.com/hashicorp/amazon" installations: [{/home/mlodzikos/.config/packer/plugins/github.com/hashicorp/amazon/packer-plugin-amazon_v1.1.1_x5.0_linux_amd64 v1.1.1}]
2022/07/07 23:56:56 [INFO] found external [chroot ebs ebssurrogate ebsvolume instance] builders from amazon plugin
2022/07/07 23:56:56 [INFO] found external [import] post-processors from amazon plugin
2022/07/07 23:56:56 found external [ami parameterstore secretsmanager] datasource from amazon plugin
2022/07/07 23:56:56 [TRACE] Starting external plugin /home/mlodzikos/.config/packer/plugins/github.com/hashicorp/googlecompute/packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 start builder -packer-default-plugin-name-
2022/07/07 23:56:56 Starting plugin: /home/mlodzikos/.config/packer/plugins/github.com/hashicorp/googlecompute/packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 []string{"/home/mlodzikos/.config/packer/plugins/github.com/hashicorp/googlecompute/packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64", "start", "builder", "-packer-default-plugin-name-"}
2022/07/07 23:56:56 Waiting for RPC address for: /home/mlodzikos/.config/packer/plugins/github.com/hashicorp/googlecompute/packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64
2022/07/07 23:56:56 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/07 23:56:56 Plugin address: unix /tmp/packer-plugin2779701133
2022/07/07 23:56:56 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/07 23:56:56 Waiting for connection...
2022/07/07 23:56:56 Received unix RPC address for /home/mlodzikos/.config/packer/plugins/github.com/hashicorp/googlecompute/packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64: addr is /tmp/packer-plugin2779701133
2022/07/07 23:56:56 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/07 23:56:56 Serving a plugin connection...
2022/07/07 23:56:56 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/07 23:56:56 [TRACE] starting builder -packer-default-plugin-name-
2022/07/07 23:56:56 Build debug mode: false
2022/07/07 23:56:56 Force build: false
2022/07/07 23:56:56 On error: 
2022/07/07 23:56:56 Waiting on builds to complete...
2022/07/07 23:56:56 Starting build run: googlecompute.this_eu
2022/07/07 23:56:56 Running builder: 
2022/07/07 23:56:56 [INFO] (telemetry) Starting builder googlecompute.this_eu
googlecompute.this_eu: output will be in this color.

2022/07/07 23:56:56 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/07 23:56:56 [INFO] Requesting Google token via GCE API Default Client Token Source...
2022/07/07 23:56:56 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/07 23:56:56 [INFO] Instantiating GCE client...
2022/07/07 23:56:56 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/07 23:56:56 [INFO] Instantiating OS Login client...
==> googlecompute.this_eu: Checking image does not exist...
==> googlecompute.this_eu: Creating temporary RSA SSH key for instance...
==> googlecompute.this_eu: Using image: ubuntu-2004-focal-v20220705
==> googlecompute.this_eu: Creating instance...
2022/07/07 23:57:04 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/07 23:57:04 [DEBUG] Adding metadata during instance creation...
    googlecompute.this_eu: Loading zone: europe-west2-a
    googlecompute.this_eu: Loading machine type: n2-standard-8
2022/07/07 23:57:05 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/07 23:57:05 [DEBUG] using google-managed encryption key for boot disk
    googlecompute.this_eu: Requesting instance creation...
    googlecompute.this_eu: Waiting for creation operation to complete...
2022/07/07 23:57:09 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/07 23:57:09 Retryable error: retrying for state DONE, got RUNNING
2022/07/07 23:57:12 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/07 23:57:12 Retryable error: retrying for state DONE, got RUNNING
2022/07/07 23:57:15 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/07 23:57:15 Retryable error: retrying for state DONE, got RUNNING
    googlecompute.this_eu: Instance has been created!
==> googlecompute.this_eu: Waiting for the instance to become running...
    googlecompute.this_eu: IP: 35.214.59.238
2022/07/07 23:57:19 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/07 23:57:19 Skipping step launch IAP tunnel; "iap" is false.
==> googlecompute.this_eu: Using SSH communicator to connect: 35.214.59.238
2022/07/07 23:57:19 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/07 23:57:19 [INFO] Waiting for SSH, up to timeout: 5m0s
==> googlecompute.this_eu: Waiting for SSH to become available...
2022/07/07 23:57:34 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/07 23:57:34 [DEBUG] TCP connection to SSH ip/port failed: dial tcp 35.214.59.238:22: i/o timeout
2022/07/07 23:57:39 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/07 23:57:39 [DEBUG] TCP connection to SSH ip/port failed: dial tcp 35.214.59.238:22: connect: connection refused
2022/07/07 23:57:44 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/07 23:57:44 [DEBUG] TCP connection to SSH ip/port failed: dial tcp 35.214.59.238:22: connect: connection refused
2022/07/07 23:57:49 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/07 23:57:49 [INFO] Attempting SSH connection to 35.214.59.238:22...
2022/07/07 23:57:49 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/07 23:57:49 [DEBUG] reconnecting to TCP connection for SSH
2022/07/07 23:57:49 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/07 23:57:49 [DEBUG] handshaking with SSH
2022/07/07 23:57:49 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/07 23:57:49 [DEBUG] handshake complete!
2022/07/07 23:57:49 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/07 23:57:49 [DEBUG] Opening new ssh session
2022/07/07 23:57:51 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/07 23:57:51 [INFO] agent forwarding enabled
==> googlecompute.this_eu: Connected to SSH!
2022/07/07 23:57:51 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/07 23:57:51 Running the provision hook
==> googlecompute.this_eu: Deleting instance...
2022/07/07 23:57:55 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/07 23:57:55 Retryable error: retrying for state DONE, got RUNNING
2022/07/07 23:57:58 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/07 23:57:58 Retryable error: retrying for state DONE, got RUNNING
2022/07/07 23:58:01 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/07 23:58:01 Retryable error: retrying for state DONE, got RUNNING
2022/07/07 23:58:04 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/07 23:58:04 Retryable error: retrying for state DONE, got RUNNING
2022/07/07 23:58:07 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/07 23:58:07 Retryable error: retrying for state DONE, got RUNNING
2022/07/07 23:58:10 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/07 23:58:10 Retryable error: retrying for state DONE, got RUNNING
2022/07/07 23:58:12 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/07 23:58:12 Retryable error: retrying for state DONE, got RUNNING
2022/07/07 23:58:15 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/07 23:58:15 Retryable error: retrying for state DONE, got RUNNING
2022/07/07 23:58:18 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/07 23:58:18 Retryable error: retrying for state DONE, got RUNNING
2022/07/07 23:58:21 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/07 23:58:21 Retryable error: retrying for state DONE, got RUNNING
2022/07/07 23:58:24 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/07 23:58:24 Retryable error: retrying for state DONE, got RUNNING
2022/07/07 23:58:27 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/07 23:58:27 Retryable error: retrying for state DONE, got RUNNING
2022/07/07 23:58:29 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/07 23:58:29 Retryable error: retrying for state DONE, got RUNNING
2022/07/07 23:58:32 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/07 23:58:32 Retryable error: retrying for state DONE, got RUNNING
2022/07/07 23:58:35 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/07 23:58:35 Retryable error: retrying for state DONE, got RUNNING
2022/07/07 23:58:38 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/07 23:58:38 Retryable error: retrying for state DONE, got RUNNING
2022/07/07 23:58:41 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/07 23:58:41 Retryable error: retrying for state DONE, got RUNNING
2022/07/07 23:58:43 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/07 23:58:43 Retryable error: retrying for state DONE, got RUNNING
2022/07/07 23:58:46 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/07 23:58:46 Retryable error: retrying for state DONE, got RUNNING
    googlecompute.this_eu: Instance has been deleted!
==> googlecompute.this_eu: Creating image...
2022/07/07 23:58:51 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/07 23:58:51 Retryable error: retrying for state DONE, got RUNNING
2022/07/07 23:58:54 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/07 23:58:54 Retryable error: retrying for state DONE, got RUNNING
2022/07/07 23:58:56 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/07 23:58:56 Retryable error: retrying for state DONE, got RUNNING
2022/07/07 23:58:58 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/07 23:58:58 Retryable error: retrying for state DONE, got RUNNING
2022/07/07 23:59:01 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/07 23:59:01 Retryable error: retrying for state DONE, got RUNNING
2022/07/07 23:59:03 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/07 23:59:03 Retryable error: retrying for state DONE, got RUNNING
2022/07/07 23:59:06 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/07 23:59:06 Retryable error: retrying for state DONE, got RUNNING
2022/07/07 23:59:08 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/07 23:59:08 Retryable error: retrying for state DONE, got RUNNING
2022/07/07 23:59:10 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/07 23:59:10 Retryable error: retrying for state DONE, got RUNNING
2022/07/07 23:59:12 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/07 23:59:12 Retryable error: retrying for state DONE, got RUNNING
2022/07/07 23:59:15 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/07 23:59:15 Retryable error: 1 error(s) occurred:
2022/07/07 23:59:15 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/07 23:59:15 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/07 23:59:17 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/07 23:59:17 Retryable error: 1 error(s) occurred:
2022/07/07 23:59:17 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/07 23:59:17 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/07 23:59:20 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/07 23:59:20 Retryable error: 1 error(s) occurred:
2022/07/07 23:59:20 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/07 23:59:20 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/07 23:59:22 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/07 23:59:22 Retryable error: 1 error(s) occurred:
2022/07/07 23:59:22 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/07 23:59:22 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/07 23:59:24 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/07 23:59:24 Retryable error: 1 error(s) occurred:
2022/07/07 23:59:24 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/07 23:59:24 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/07 23:59:27 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/07 23:59:27 Retryable error: 1 error(s) occurred:
2022/07/07 23:59:27 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/07 23:59:27 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/07 23:59:29 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/07 23:59:29 Retryable error: 1 error(s) occurred:
2022/07/07 23:59:29 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/07 23:59:29 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/07 23:59:31 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/07 23:59:31 Retryable error: 1 error(s) occurred:
2022/07/07 23:59:31 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/07 23:59:31 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/07 23:59:34 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/07 23:59:34 Retryable error: 1 error(s) occurred:
2022/07/07 23:59:34 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/07 23:59:34 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/07 23:59:36 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/07 23:59:36 Retryable error: 1 error(s) occurred:
2022/07/07 23:59:36 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/07 23:59:36 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/07 23:59:38 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/07 23:59:38 Retryable error: 1 error(s) occurred:
2022/07/07 23:59:38 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/07 23:59:38 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/07 23:59:41 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/07 23:59:41 Retryable error: 1 error(s) occurred:
2022/07/07 23:59:41 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/07 23:59:41 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/07 23:59:43 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/07 23:59:43 Retryable error: 1 error(s) occurred:
2022/07/07 23:59:43 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/07 23:59:43 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/07 23:59:45 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/07 23:59:45 Retryable error: 1 error(s) occurred:
2022/07/07 23:59:45 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/07 23:59:45 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/07 23:59:48 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/07 23:59:48 Retryable error: 1 error(s) occurred:
2022/07/07 23:59:48 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/07 23:59:48 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/07 23:59:50 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/07 23:59:50 Retryable error: 1 error(s) occurred:
2022/07/07 23:59:50 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/07 23:59:50 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/07 23:59:52 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/07 23:59:52 Retryable error: 1 error(s) occurred:
2022/07/07 23:59:52 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/07 23:59:52 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/07 23:59:55 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/07 23:59:55 Retryable error: 1 error(s) occurred:
2022/07/07 23:59:55 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/07 23:59:55 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/07 23:59:57 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/07 23:59:57 Retryable error: 1 error(s) occurred:
2022/07/07 23:59:57 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/07 23:59:57 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:00:00 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:00:00 Retryable error: 1 error(s) occurred:
2022/07/08 00:00:00 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:00:00 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:00:02 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:00:02 Retryable error: 1 error(s) occurred:
2022/07/08 00:00:02 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:00:02 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:00:04 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:00:04 Retryable error: 1 error(s) occurred:
2022/07/08 00:00:04 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:00:04 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:00:07 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:00:07 Retryable error: 1 error(s) occurred:
2022/07/08 00:00:07 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:00:07 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:00:09 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:00:09 Retryable error: 1 error(s) occurred:
2022/07/08 00:00:09 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:00:09 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:00:11 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:00:11 Retryable error: 1 error(s) occurred:
2022/07/08 00:00:11 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:00:11 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:00:14 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:00:14 Retryable error: 1 error(s) occurred:
2022/07/08 00:00:14 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:00:14 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:00:16 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:00:16 Retryable error: 1 error(s) occurred:
2022/07/08 00:00:16 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:00:16 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:00:19 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:00:19 Retryable error: 1 error(s) occurred:
2022/07/08 00:00:19 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:00:19 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:00:21 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:00:21 Retryable error: 1 error(s) occurred:
2022/07/08 00:00:21 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:00:21 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:00:42 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:00:42 Retryable error: 1 error(s) occurred:
2022/07/08 00:00:42 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:00:42 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:00:44 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:00:44 Retryable error: 1 error(s) occurred:
2022/07/08 00:00:44 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:00:44 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:00:47 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:00:47 Retryable error: 1 error(s) occurred:
2022/07/08 00:00:47 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:00:47 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:00:49 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:00:49 Retryable error: 1 error(s) occurred:
2022/07/08 00:00:49 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:00:49 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:00:52 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:00:52 Retryable error: 1 error(s) occurred:
2022/07/08 00:00:52 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:00:52 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:00:54 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:00:54 Retryable error: 1 error(s) occurred:
2022/07/08 00:00:54 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:00:54 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:00:56 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:00:56 Retryable error: 1 error(s) occurred:
2022/07/08 00:00:56 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:00:56 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:00:59 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:00:59 Retryable error: 1 error(s) occurred:
2022/07/08 00:00:59 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:00:59 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:01:01 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:01:01 Retryable error: 1 error(s) occurred:
2022/07/08 00:01:01 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:01:01 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:01:03 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:01:03 Retryable error: 1 error(s) occurred:
2022/07/08 00:01:03 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:01:03 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:01:06 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:01:06 Retryable error: 1 error(s) occurred:
2022/07/08 00:01:06 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:01:06 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:01:08 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:01:08 Retryable error: 1 error(s) occurred:
2022/07/08 00:01:08 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:01:08 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:01:18 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:01:18 Retryable error: 1 error(s) occurred:
2022/07/08 00:01:18 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:01:18 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:01:20 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:01:20 Retryable error: 1 error(s) occurred:
2022/07/08 00:01:20 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:01:20 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:01:23 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:01:23 Retryable error: 1 error(s) occurred:
2022/07/08 00:01:23 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:01:23 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:01:25 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:01:25 Retryable error: 1 error(s) occurred:
2022/07/08 00:01:25 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:01:25 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:01:27 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:01:27 Retryable error: 1 error(s) occurred:
2022/07/08 00:01:27 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:01:27 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:01:30 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:01:30 Retryable error: 1 error(s) occurred:
2022/07/08 00:01:30 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:01:30 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:01:32 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:01:32 Retryable error: 1 error(s) occurred:
2022/07/08 00:01:32 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:01:32 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:01:34 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:01:34 Retryable error: 1 error(s) occurred:
2022/07/08 00:01:34 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:01:34 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:01:37 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:01:37 Retryable error: 1 error(s) occurred:
2022/07/08 00:01:37 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:01:37 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:01:39 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:01:39 Retryable error: 1 error(s) occurred:
2022/07/08 00:01:39 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:01:39 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:01:42 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:01:42 Retryable error: 1 error(s) occurred:
2022/07/08 00:01:42 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:01:42 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:01:44 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:01:44 Retryable error: 1 error(s) occurred:
2022/07/08 00:01:44 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:01:44 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:01:46 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:01:46 Retryable error: 1 error(s) occurred:
2022/07/08 00:01:46 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:01:46 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:01:49 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:01:49 Retryable error: 1 error(s) occurred:
2022/07/08 00:01:49 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:01:49 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:01:51 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:01:51 Retryable error: 1 error(s) occurred:
2022/07/08 00:01:51 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:01:51 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:01:53 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:01:53 Retryable error: 1 error(s) occurred:
2022/07/08 00:01:53 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:01:53 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:01:56 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:01:56 Retryable error: 1 error(s) occurred:
2022/07/08 00:01:56 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:01:56 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:01:58 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:01:58 Retryable error: 1 error(s) occurred:
2022/07/08 00:01:58 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:01:58 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:02:00 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:02:00 Retryable error: 1 error(s) occurred:
2022/07/08 00:02:00 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:02:00 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:02:07 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:02:07 Retryable error: 1 error(s) occurred:
2022/07/08 00:02:07 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:02:07 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:02:09 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:02:09 Retryable error: 1 error(s) occurred:
2022/07/08 00:02:09 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:02:09 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:02:11 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:02:11 Retryable error: 1 error(s) occurred:
2022/07/08 00:02:11 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:02:11 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:02:14 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:02:14 Retryable error: 1 error(s) occurred:
2022/07/08 00:02:14 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:02:14 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:02:17 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:02:17 Retryable error: 1 error(s) occurred:
2022/07/08 00:02:17 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:02:17 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:02:19 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:02:19 Retryable error: 1 error(s) occurred:
2022/07/08 00:02:19 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:02:19 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:02:22 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:02:22 Retryable error: 1 error(s) occurred:
2022/07/08 00:02:22 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:02:22 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:02:24 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:02:24 Retryable error: 1 error(s) occurred:
2022/07/08 00:02:24 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:02:24 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:02:27 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:02:27 Retryable error: 1 error(s) occurred:
2022/07/08 00:02:27 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:02:27 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:02:29 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:02:29 Retryable error: 1 error(s) occurred:
2022/07/08 00:02:29 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:02:29 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:02:31 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:02:31 Retryable error: 1 error(s) occurred:
2022/07/08 00:02:31 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:02:31 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:02:34 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:02:34 Retryable error: 1 error(s) occurred:
2022/07/08 00:02:34 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:02:34 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:02:36 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:02:36 Retryable error: 1 error(s) occurred:
2022/07/08 00:02:36 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:02:36 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:02:38 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:02:38 Retryable error: 1 error(s) occurred:
2022/07/08 00:02:38 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:02:38 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:02:44 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:02:44 Retryable error: 1 error(s) occurred:
2022/07/08 00:02:44 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:02:44 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:02:46 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:02:46 Retryable error: 1 error(s) occurred:
2022/07/08 00:02:46 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:02:46 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:02:48 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:02:48 Retryable error: 1 error(s) occurred:
2022/07/08 00:02:48 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:02:48 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:02:51 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:02:51 Retryable error: 1 error(s) occurred:
2022/07/08 00:02:51 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:02:51 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:02:53 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:02:53 Retryable error: 1 error(s) occurred:
2022/07/08 00:02:53 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:02:53 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:02:55 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:02:55 Retryable error: 1 error(s) occurred:
2022/07/08 00:02:55 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:02:55 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:02:58 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:02:58 Retryable error: 1 error(s) occurred:
2022/07/08 00:02:58 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:02:58 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:03:00 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:03:00 Retryable error: 1 error(s) occurred:
2022/07/08 00:03:00 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:03:00 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:03:02 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:03:02 Retryable error: 1 error(s) occurred:
2022/07/08 00:03:02 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:03:02 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:03:05 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:03:05 Retryable error: 1 error(s) occurred:
2022/07/08 00:03:05 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:03:05 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:03:07 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:03:07 Retryable error: 1 error(s) occurred:
2022/07/08 00:03:07 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:03:07 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:03:09 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:03:09 Retryable error: 1 error(s) occurred:
2022/07/08 00:03:09 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:03:09 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:03:12 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:03:12 Retryable error: 1 error(s) occurred:
2022/07/08 00:03:12 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:03:12 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:03:14 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:03:14 Retryable error: 1 error(s) occurred:
2022/07/08 00:03:14 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:03:14 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:03:17 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:03:17 Retryable error: 1 error(s) occurred:
2022/07/08 00:03:17 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:03:17 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:03:19 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:03:19 Retryable error: 1 error(s) occurred:
2022/07/08 00:03:19 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:03:19 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:03:21 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:03:21 Retryable error: 1 error(s) occurred:
2022/07/08 00:03:21 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:03:21 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:03:24 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:03:24 Retryable error: 1 error(s) occurred:
2022/07/08 00:03:24 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:03:24 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:03:26 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:03:26 Retryable error: 1 error(s) occurred:
2022/07/08 00:03:26 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:03:26 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:03:28 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:03:28 Retryable error: 1 error(s) occurred:
2022/07/08 00:03:28 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:03:28 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:03:31 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:03:31 Retryable error: 1 error(s) occurred:
2022/07/08 00:03:31 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:03:31 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:03:33 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:03:33 Retryable error: 1 error(s) occurred:
2022/07/08 00:03:33 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:03:33 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:03:35 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:03:35 Retryable error: 1 error(s) occurred:
2022/07/08 00:03:35 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:03:35 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:03:38 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:03:38 Retryable error: 1 error(s) occurred:
2022/07/08 00:03:38 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:03:38 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:03:40 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:03:40 Retryable error: 1 error(s) occurred:
2022/07/08 00:03:40 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:03:40 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:03:43 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:03:43 Retryable error: 1 error(s) occurred:
2022/07/08 00:03:43 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:03:43 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:03:45 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:03:45 Retryable error: 1 error(s) occurred:
2022/07/08 00:03:45 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:03:45 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:03:47 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:03:47 Retryable error: 1 error(s) occurred:
2022/07/08 00:03:47 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:03:47 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
2022/07/08 00:03:50 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:03:50 Retryable error: 1 error(s) occurred:
2022/07/08 00:03:50 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:03:50 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
==> googlecompute.this_eu: Error waiting for image: time out while waiting for image to register
==> googlecompute.this_eu: Deleting disk...
2022/07/08 00:03:52 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:03:52 Retryable error: 1 error(s) occurred:
2022/07/08 00:03:52 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 
2022/07/08 00:03:52 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: * Internal error. Please try again or contact Google Support. (Code: '-2486866303847494777')
    googlecompute.this_eu: Disk has been deleted!
==> googlecompute.this_eu: Provisioning step had errors: Running the cleanup provisioner, if present...
2022/07/08 00:03:53 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/07/08 00:03:53 Skipping cleanup of IAP tunnel; "iap" is false.
2022/07/08 00:03:53 [INFO] (telemetry) ending googlecompute.this_eu
==> Wait completed after 6 minutes 57 seconds
2022/07/08 00:03:53 machine readable: error-count []string{"1"}
==> Some builds didn't complete successfully and had errors:
2022/07/08 00:03:53 machine readable: googlecompute.this_eu,error []string{"Error waiting for image: time out while waiting for image to register"}
==> Builds finished but no artifacts were created.
Build 'googlecompute.this_eu' errored after 6 minutes 57 seconds: Error waiting for image: time out while waiting for image to register

==> Wait completed after 6 minutes 57 seconds

==> Some builds didn't complete successfully and had errors:
2022/07/08 00:03:54 [INFO] (telemetry) Finalizing.
--> googlecompute.this_eu: Error waiting for image: time out while waiting for image to register

==> Builds finished but no artifacts were created.
2022/07/08 00:03:54 waiting for all plugin processes to complete...
2022/07/08 00:03:54 /home/mlodzikos/.config/packer/plugins/github.com/hashicorp/googlecompute/packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64: plugin process exited

Feature request - tail logs for google instance startup scripts

This issue was originally opened by @JorritSalverda as hashicorp/packer#5820. It was migrated here as a result of the Packer plugin split. The original body of the issue is below.


With Google Compute Instances you can run startup scripts via metadata. This very useful to avoid issues caused by running installation steps over winrm in case of baking Windows images. However currently the output of those scripts is not tailed by Packer.

It is possible though to get the logs from all startup steps and executed scripts with

gcloud compute instances get-serial-port-output <instance name>

It would be very useful to tail those in Packer so you can get feedback on failures in a startup script.

Add support for the "ubuntu-os-pro-cloud" Project

Description

Need support for the "ubuntu-os-pro-cloud" project so that we can build Ubuntu pro packer images.

Use Case(s)

Ability to build Ubuntu Pro packer images.

Potential configuration

Adding ubuntu-os-pro-cloud to this array.

builder googlecompute preserves intermediate machine's hostname instead of set hostname to instance name for newly created machines

  • Packer version 1.8.2
  • Host Windows Server 2019

This issue applies to the googlecompute builder.

Newly created VM based on a Packer created Windows Image in Google Compute gets hostname set to Packer intermediate machine's hostname (packer-62bd6611-ac4b-9422-203a-ed4b75e1ac50). Every next VM gets hostname set to the same value.

Expected behaviour - Newly create VM get hostname set to instance name

Packer returns Powershell Error After Provisioners are complete

Overview of the Issue

I am creating a Windows GCP Image and after invoking the GCP Sysprep

	provisioner "powershell"{
			inline = ["GCESysprep -NoShutdown"]
		}

it returns a weird Powershell error

==> googlecompute.vm: . : The term
==> googlecompute.vm: 'c:/Windows/Temp/packer-ps-env-vars-62f10fbc-5827-c4b2-8272-3b1793e96a67.ps1'
==> googlecompute.vm: is not recognized as the name of a cmdlet, function, script file, or operable
==> googlecompute.vm: program. Check the spelling of the name, or if a path was included, verify
==> googlecompute.vm: that the path is correct and try again.
==> googlecompute.vm: At line:1 char:138
==> googlecompute.vm: + ... lyContinue'};.
==> googlecompute.vm: c:/Windows/Temp/packer-ps-env-vars-62f10fbc-5827-c4b2-8272-3b1793 ...
==> googlecompute.vm: +
==> googlecompute.vm: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
==> googlecompute.vm:     + CategoryInfo          : ObjectNotFound: (c:/Windows/Temp...b1793e96a67.p
==> googlecompute.vm:    s1:String) [], CommandNotFoundException
==> googlecompute.vm:     + FullyQualifiedErrorId : CommandNotFoundException

NOTE The image gets built and it works but I would like to get rid of that error

Reproduction Steps

gcp.pkr.hcl

source "googlecompute" "vm" {
  
  ...
  metadata = {
    windows-startup-script-cmd = local.script_cmd
    windows-shutdown-script-ps1 = "C:/cleanup-packer.ps1"
  }

  account_file = var.account_file_path
}

gcp.build.pkr.hcl

build {
  sources = ["source.googlecompute.vm"]
  provisioner "file" {
			source = "./scripts/cleanup-packer.ps1"
			destination = "C:/cleanup-packer.ps1"
	}
  
	provisioner "powershell"{
			inline = ["GCESysprep -NoShutdown"]
		}
 
}

Screen Shot 2022-08-08 at 9 48 37 AM

Plugin and Packer version

packer 1.8.3

The error happened after provisioner GCPSysPrep -NoShutdown command is executed but there are not more scripts to be called.

Broken Service Account impersonation

Overview of the Issue

When using Google Cloud IAM impersonation mechanism I'm getting an error stating that my user doesn't have sufficient privileges.
I successfully used this mechanism with Terraform hoping it would be the same with Packer.

Reproduction Steps

First of all, in order to use the impersonation mechanism, it is necessary to configure the appropriate service accounts as described here:

  1. Create the Service Account that owns the permissions to interact with the GCE instances:
    1. To make the tests easier, assign the role roles/editor to it;
    2. Service account identifier: service_account_builder@your_project_id.iam.gserviceaccount.com;
  2. Create the Service Account that will be used to impersonate the service account above:
    1. Assign no permission to it;
    2. Service account identifier: service_account_doorman@your_project_id.iam.gserviceaccount.com;
  3. Allow service_account_doorman@your_project_id.iam.gserviceaccount.com to impersonate service_account_builder@your_project_id.iam.gserviceaccount.com by granting him the roles below:
    1. Service Account Token Creator;
    2. Service Account User.
  4. Finally, generate a JSON key for the service account service_account_doorman@your_project_id.iam.gserviceaccount.com: impersonation_json_key.json.

Finally, use the JSON key to run the build.

Plugin and Packer version

$ packer --version
1.7.10

Simplified Packer Buildfile

packer {
  required_plugins {
    googlecompute = {
      version = ">= 1.0.10"
      source  = "github.com/hashicorp/googlecompute"
    }
  }
}

source "googlecompute" "vm_image" {
  project_id                  = "your_project_id"
  source_image_family         = "centos-7"
  zone                        = "europe-west1-b"
  machine_type                = "n1-standard-8"
  impersonate_service_account = "service_account_doorman@your_project_id.iam.gserviceaccount.com"
  image_description           = "VM image"
  instance_name               = "tpl-vm-image-{{uuid}}"
  disk_size                   = 50
  disk_type                   = "pd-ssd"
  metadata = {
    enable-oslogin : "true"
  }
  use_os_login      = true
  ssh_username      = "root"
  image_name        = "tpl-vm-image"
}

build {
  sources = ["sources.googlecompute.vm_image"]

  provisioner "shell" {
    inline = ["echo foo"]
  }
}

And finally, run the build:

GOOGLE_APPLICATION_CREDENTIALS="impersonation_json_key.json" packer build template.pkr.hcl

Operating system and Environment details

$ uname -a
Linux 3.10.0-1160.53.1.el7.x86_64 #1 SMP Fri Jan 14 13:59:45 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
$ cat /etc/*-release
CentOS Linux release 8.4.2105
NAME="CentOS Linux"
VERSION="8"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="8"
PLATFORM_ID="platform:el8"
PRETTY_NAME="CentOS Linux 8"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:8"
HOME_URL="https://centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
CENTOS_MANTISBT_PROJECT="CentOS-8"
CENTOS_MANTISBT_PROJECT_VERSION="8"
CentOS Linux release 8.4.2105
CentOS Linux release 8.4.2105

Log Fragments and crash.log files

Full logs available here.

SoleTenant node support during build process

Community Note

Please vote on this issue by adding a ๐Ÿ‘ reaction to the original issue to help the community and maintainers prioritize this request.
Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request.
If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Description

It's not possible to specity node affinity during build process and it's not possible to address BringYourOwnLicence images

Use Case(s)

Build Windows Images with BYOL model licence.

WinRM Connection Returns 401

Overview of the Issue

I am trying to build a GCP Windows Image but seems like the WinRM connection is not working. Also packer build -debug does not print the credentials for the Administrator user. In AWS, packer build -debug retrieves the password properly.

Reproduction Steps

Using the following template as per the docs and other attributes

source "googlecompute" "windows-example" {
  project_id = var.project_id
  source_image_project_id = ["windows-cloud"]
  source_image_family = "windows-2019"
  #source_image = "windows-server-2019-dc-v20200813"
  zone = "us-east4-a"
  disk_size = 50
  machine_type = "n1-standard-8"
  communicator = "winrm"
  winrm_username = "packer_user"
  winrm_insecure = true
  winrm_use_ssl = true
  tags = ["packer"]
  preemptible = true
  image_labels = {
      server_type = "windows-2019"
  }
  metadata = {
    windows-startup-script-cmd = "winrm quickconfig -quiet & net user /add packer_user & net localgroup administrators packer_user /add & winrm set winrm/config/service/auth @{Basic=\"true\"}"
  }
  account_file = var.account_file_path
}

build {
  sources = ["sources.googlecompute.windows-example"]
}

Plugin and Packer version

Packer v1.7.8

Simplified Packer Buildfile

If the file is longer than a few dozen lines, please include the URL to the
gist of the log or use the Github detailed
format

instead of posting it directly in the issue.

Operating system and Environment details

OSX Monterrey

Log Fragments and crash.log files

2021/11/22 09:36:42 packer-builder-googlecompute plugin: Retryable error: retrying for state DONE, got RUNNING
2021/11/22 09:36:45 packer-builder-googlecompute plugin: Retryable error: retrying for state DONE, got RUNNING
2021/11/22 09:36:47 packer-builder-googlecompute plugin: Retryable error: retrying for state DONE, got RUNNING
2021/11/22 09:36:49 packer-builder-googlecompute plugin: Retryable error: retrying for state DONE, got RUNNING
    googlecompute.windows-example: Instance has been created!
==> googlecompute.windows-example: Waiting for the instance to become running...
    googlecompute.windows-example: IP: 34.86.165.202
2021/11/22 09:36:52 packer-builder-googlecompute plugin: Skipping step launch IAP tunnel; "iap" is false.
==> googlecompute.windows-example: Using WinRM communicator to connect: 34.86.165.202
2021/11/22 09:36:52 packer-builder-googlecompute plugin: Waiting for WinRM, up to timeout: 30m0s
==> googlecompute.windows-example: Waiting for WinRM to become available...
2021/11/22 09:36:52 packer-builder-googlecompute plugin: [INFO] Attempting WinRM connection...
2021/11/22 09:36:52 packer-builder-googlecompute plugin: [DEBUG] connecting to remote shell using WinRM
2021/11/22 09:37:22 packer-builder-googlecompute plugin: [ERROR] connection error: unknown error Post "https://34.86.165.202:5986/wsman": dial tcp 34.86.165.202:5986: i/o timeout
2021/11/22 09:37:22 packer-builder-googlecompute plugin: [ERROR] WinRM connection err: unknown error Post "https://34.86.165.202:5986/wsman": dial tcp 34.86.165.202:5986: i/o timeout
2021/11/22 09:37:27 packer-builder-googlecompute plugin: [INFO] Attempting WinRM connection...
2021/11/22 09:37:27 packer-builder-googlecompute plugin: [DEBUG] connecting to remote shell using WinRM
2021/11/22 09:37:32 packer-builder-googlecompute plugin: [ERROR] connection error: unknown error Post "https://34.86.165.202:5986/wsman": dial tcp 34.86.165.202:5986: connect: connection refused
2021/11/22 09:37:32 packer-builder-googlecompute plugin: [ERROR] WinRM connection err: unknown error Post "https://34.86.165.202:5986/wsman": dial tcp 34.86.165.202:5986: connect: connection refused
2021/11/22 09:37:37 packer-builder-googlecompute plugin: [INFO] Attempting WinRM connection...
2021/11/22 09:37:37 packer-builder-googlecompute plugin: [DEBUG] connecting to remote shell using WinRM
2021/11/22 09:37:38 packer-builder-googlecompute plugin: [ERROR] connection error: unknown error Post "https://34.86.165.202:5986/wsman": dial tcp 34.86.165.202:5986: connect: connection refused
2021/11/22 09:37:38 packer-builder-googlecompute plugin: [ERROR] WinRM connection err: unknown error Post "https://34.86.165.202:5986/wsman": dial tcp 34.86.165.202:5986: connect: connection refused
2021/11/22 09:37:43 packer-builder-googlecompute plugin: [INFO] Attempting WinRM connection...
2021/11/22 09:37:43 packer-builder-googlecompute plugin: [DEBUG] connecting to remote shell using WinRM
2021/11/22 09:37:43 packer-builder-googlecompute plugin: [ERROR] connection error: unknown error Post "https://34.86.165.202:5986/wsman": dial tcp 34.86.165.202:5986: connect: connection refused
2021/11/22 09:37:43 packer-builder-googlecompute plugin: [ERROR] WinRM connection err: unknown error Post "https://34.86.165.202:5986/wsman": dial tcp 34.86.165.202:5986: connect: connection refused
2021/11/22 09:37:48 packer-builder-googlecompute plugin: [INFO] Attempting WinRM connection...
2021/11/22 09:37:48 packer-builder-googlecompute plugin: [DEBUG] connecting to remote shell using WinRM
2021/11/22 09:38:18 packer-builder-googlecompute plugin: [ERROR] connection error: unknown error Post "https://34.86.165.202:5986/wsman": dial tcp 34.86.165.202:5986: i/o timeout
2021/11/22 09:38:18 packer-builder-googlecompute plugin: [ERROR] WinRM connection err: unknown error Post "https://34.86.165.202:5986/wsman": dial tcp 34.86.165.202:5986: i/o timeout
2021/11/22 09:38:23 packer-builder-googlecompute plugin: [INFO] Attempting WinRM connection...
2021/11/22 09:38:23 packer-builder-googlecompute plugin: [DEBUG] connecting to remote shell using WinRM
2021/11/22 09:38:53 packer-builder-googlecompute plugin: [ERROR] connection error: unknown error Post "https://34.86.165.202:5986/wsman": dial tcp 34.86.165.202:5986: i/o timeout
2021/11/22 09:38:53 packer-builder-googlecompute plugin: [ERROR] WinRM connection err: unknown error Post "https://34.86.165.202:5986/wsman": dial tcp 34.86.165.202:5986: i/o timeout
2021/11/22 09:38:58 packer-builder-googlecompute plugin: [INFO] Attempting WinRM connection...
2021/11/22 09:38:58 packer-builder-googlecompute plugin: [DEBUG] connecting to remote shell using WinRM
2021/11/22 09:39:28 packer-builder-googlecompute plugin: [ERROR] connection error: unknown error Post "https://34.86.165.202:5986/wsman": dial tcp 34.86.165.202:5986: i/o timeout
2021/11/22 09:39:28 packer-builder-googlecompute plugin: [ERROR] WinRM connection err: unknown error Post "https://34.86.165.202:5986/wsman": dial tcp 34.86.165.202:5986: i/o timeout
2021/11/22 09:39:33 packer-builder-googlecompute plugin: [INFO] Attempting WinRM connection...
2021/11/22 09:39:33 packer-builder-googlecompute plugin: [DEBUG] connecting to remote shell using WinRM
2021/11/22 09:39:33 packer-builder-googlecompute plugin: [ERROR] connection error: unknown error Post "https://34.86.165.202:5986/wsman": dial tcp 34.86.165.202:5986: connect: connection refused
2021/11/22 09:39:33 packer-builder-googlecompute plugin: [ERROR] WinRM connection err: unknown error Post "https://34.86.165.202:5986/wsman": dial tcp 34.86.165.202:5986: connect: connection refused
2021/11/22 09:39:38 packer-builder-googlecompute plugin: [INFO] Attempting WinRM connection...
2021/11/22 09:39:38 packer-builder-googlecompute plugin: [DEBUG] connecting to remote shell using WinRM
2021/11/22 09:39:38 packer-builder-googlecompute plugin: [ERROR] connection error: unknown error Post "https://34.86.165.202:5986/wsman": dial tcp 34.86.165.202:5986: connect: connection refused
2021/11/22 09:39:38 packer-builder-googlecompute plugin: [ERROR] WinRM connection err: unknown error Post "https://34.86.165.202:5986/wsman": dial tcp 34.86.165.202:5986: connect: connection refused
2021/11/22 09:39:43 packer-builder-googlecompute plugin: [INFO] Attempting WinRM connection...
2021/11/22 09:39:43 packer-builder-googlecompute plugin: [DEBUG] connecting to remote shell using WinRM
2021/11/22 09:39:43 packer-builder-googlecompute plugin: [ERROR] connection error: unknown error Post "https://34.86.165.202:5986/wsman": dial tcp 34.86.165.202:5986: connect: connection refused
2021/11/22 09:39:43 packer-builder-googlecompute plugin: [ERROR] WinRM connection err: unknown error Post "https://34.86.165.202:5986/wsman": dial tcp 34.86.165.202:5986: connect: connection refused
2021/11/22 09:39:48 packer-builder-googlecompute plugin: [INFO] Attempting WinRM connection...
2021/11/22 09:39:48 packer-builder-googlecompute plugin: [DEBUG] connecting to remote shell using WinRM
2021/11/22 09:39:48 packer-builder-googlecompute plugin: [ERROR] connection error: unknown error Post "https://34.86.165.202:5986/wsman": dial tcp 34.86.165.202:5986: connect: connection refused
2021/11/22 09:39:48 packer-builder-googlecompute plugin: [ERROR] WinRM connection err: unknown error Post "https://34.86.165.202:5986/wsman": dial tcp 34.86.165.202:5986: connect: connection refused
2021/11/22 09:39:53 packer-builder-googlecompute plugin: [INFO] Attempting WinRM connection...
2021/11/22 09:39:53 packer-builder-googlecompute plugin: [DEBUG] connecting to remote shell using WinRM
2021/11/22 09:39:56 packer-builder-googlecompute plugin: [ERROR] connection error: http response error: 401 - invalid content type
2021/11/22 09:39:56 packer-builder-googlecompute plugin: [ERROR] WinRM connection err: http response error: 401 - invalid content type
2021/11/22 09:40:01 packer-builder-googlecompute plugin: [INFO] Attempting WinRM connection...
2021/11/22 09:40:01 packer-builder-googlecompute plugin: [DEBUG] connecting to remote shell using WinRM
2021/11/22 09:40:01 packer-builder-googlecompute plugin: [ERROR] connection error: http response error: 401 - invalid content type
2021/11/22 09:40:01 packer-builder-googlecompute plugin: [ERROR] WinRM connection err: http response error: 401 - invalid content type
2021/11/22 09:40:06 packer-builder-googlecompute plugin: [INFO] Attempting WinRM connection...
2021/11/22 09:40:06 packer-builder-googlecompute plugin: [DEBUG] connecting to remote shell using WinRM
2021/11/22 09:40:06 packer-builder-googlecompute plugin: [ERROR] connection error: http response error: 401 - invalid content type
2021/11/22 09:40:06 packer-builder-googlecompute plugin: [ERROR] WinRM connection err: http response error: 401 - invalid content type
2021/11/22 09:40:11 packer-builder-googlecompute plugin: [INFO] Attempting WinRM connection...
2021/11/22 09:40:11 packer-builder-googlecompute plugin: [DEBUG] connecting to remote shell using WinRM
2021/11/22 09:40:11 packer-builder-googlecompute plugin: [ERROR] connection error: http response error: 401 - invalid content type
2021/11/22 09:40:11 packer-builder-googlecompute plugin: [ERROR] WinRM connection err: http response error: 401 - invalid content type
2021/11/22 09:40:16 packer-builder-googlecompute plugin: [INFO] Attempting WinRM connection...
2021/11/22 09:40:16 packer-builder-googlecompute plugin: [DEBUG] connecting to remote shell using WinRM
2021/11/22 09:40:16 packer-builder-googlecompute plugin: [ERROR] connection error: http response error: 401 - invalid content type
2021/11/22 09:40:16 packer-builder-googlecompute plugin: [ERROR] WinRM connection err: http response error: 401 - invalid content type
2021/11/22 09:40:21 packer-builder-googlecompute plugin: [INFO] Attempting WinRM connection...
2021/11/22 09:40:21 packer-builder-googlecompute plugin: [DEBUG] connecting to remote shell using WinRM
2021/11/22 09:40:21 packer-builder-googlecompute plugin: [ERROR] connection error: http response error: 401 - invalid content type
2021/11/22 09:40:21 packer-builder-googlecompute plugin: [ERROR] WinRM connection err: http response error: 401 - invalid content type
2021/11/22 09:40:26 packer-builder-googlecompute plugin: [INFO] Attempting WinRM connection...
2021/11/22 09:40:26 packer-builder-googlecompute plugin: [DEBUG] connecting to remote shell using WinRM
2021/11/22 09:40:26 packer-builder-googlecompute plugin: [ERROR] connection error: http response error: 401 - invalid content type
2021/11/22 09:40:26 packer-builder-googlecompute plugin: [ERROR] WinRM connection err: http response error: 401 - invalid content type
2021/11/22 09:40:31 packer-builder-googlecompute plugin: [INFO] Attempting WinRM connection...
2021/11/22 09:40:31 packer-builder-googlecompute plugin: [DEBUG] connecting to remote shell using WinRM
2021/11/22 09:40:31 packer-builder-googlecompute plugin: [ERROR] connection error: http response error: 401 - invalid content type
2021/11/22 09:40:31 packer-builder-googlecompute plugin: [ERROR] WinRM connection err: http response error: 401 - invalid content type
2021/11/22 09:40:36 packer-builder-googlecompute plugin: [INFO] Attempting WinRM connection...
2021/11/22 09:40:36 packer-builder-googlecompute plugin: [DEBUG] connecting to remote shell using WinRM
2021/11/22 09:40:36 packer-builder-googlecompute plugin: [ERROR] connection error: http response error: 401 - invalid content type
2021/11/22 09:40:36 packer-builder-googlecompute plugin: [ERROR] WinRM connection err: http response error: 401 - invalid content type
2021/11/22 09:40:41 packer-builder-googlecompute plugin: [INFO] Attempting WinRM connection...


builder `googlecompute` uses hostname instead of instance name to set instance metadata

This issue was originally opened by @alexfouche as hashicorp/packer#7789. It was migrated here as a result of the Packer plugin split. The original body of the issue is below.


  • Packer version 1.4.1
  • Host Linux Centos 7

This issue applies to the googlecompute builder

The issue appears when the hostname or FQDN of the linux instance does not match the instance name set when creating the instance. Or when hostname is modified (via a custom startup script or whatever at linux start, ...) or is set with "instance_name": in the builder json block

The builder, when instanciating a VM adds a metadata startup-script. In this script, there is a shell function SetMetadata(), which is called at the end of the startup script to set instance metadata startup-script-status=done

SetMetadata () {
  gcloud compute instances add-metadata ${HOSTNAME} --metadata ${1}=${2} --zone ${ZONE}
}

See startup.go#L27

The problem lies in the fact that ${HOSTNAME} is used. The Google instance name should be used, not the hostname.

Using the GetMetadata() function of the script, the instance name can be retrieved with

GetMetadata name

Unable to build a new AMI due to fact that IAP gives 4047 error

Hi,

We are building new AMI's monthly through a pipeline each month, which on last month we successfully did it.
This month it fails with the following error:

2021/09/02 11:48:24 1630572504,,ui,say,==> googlecompute: Step Launch IAP Tunnel...
2021/09/02 11:48:24 packer-builder-googlecompute plugin: Finding an available TCP port for IAP proxy
1630572504,,ui,say,==> googlecompute: Step Launch IAP Tunnel...
2021/09/02 11:48:24 packer-builder-googlecompute plugin: Found available port: 8144 on IP: 0.0.0.0
2021/09/02 11:48:24 packer-builder-googlecompute plugin: Setting up proxy to listen on localhost at 8144
2021/09/02 11:48:24 packer-builder-googlecompute plugin: Creating tunnel launch script with args []string{"compute", "start-iap-tunnel", "packer-61308fc5-8a55-bd3a-ac52-xxxx", "22", "--local-host-port=localhost:8144", "--zone", "europe-west2-c", "--project", "xxxxxx"}
2021/09/02 11:48:24 packer-builder-googlecompute plugin: [INFO] (google): Prepending inline gcloud setup script with #!/bin/sh
2021/09/02 11:48:25 packer-builder-googlecompute plugin: stderr: Testing if tunnel connection works.
2021/09/02 11:48:26 packer-builder-googlecompute plugin: stderr: ERROR: (gcloud.compute.start-iap-tunnel) While checking if a connection can be made: Error while connecting [4047: 'Failed to lookup instance'].
2021/09/02 11:48:26 packer-builder-googlecompute plugin: NOT RETRYABLE: ERROR: (gcloud.compute.start-iap-tunnel) While checking if a connection can be made: Error while connecting [4047: 'Failed to lookup instance'].
2021/09/02 11:48:26 1630572506,,ui,error,==> googlecompute: Non-retryable tunnel error: ERROR: (gcloud.compute.start-iap-tunnel) While checking if a connection can be made: Error while connecting [4047: 'Failed to lookup instance'].\n==> googlecompute:
2021/09/02 11:48:26 packer-builder-googlecompute plugin: Couldn't find IAP tunnel process to kill. Continuing.
2021/09/02 11:48:26 packer-builder-googlecompute plugin: Error asking for input: machine-readable UI can't ask
1630572506,,ui,error,==> googlecompute: Non-retryable tunnel error: ERROR: (gcloud.compute.start-iap-tunnel) While checking if a connection can be made: Error while connecting [4047: 'Failed to lookup instance'].\n==> googlecompute:
2021/09/02 11:48:26 packer-builder-googlecompute plugin: Error asking for input: machine-readable UI can't ask
2021/09/02 11:48:26 packer-builder-googlecompute plugin: Error asking for input: machine-readable UI can't ask
2021/09/02 11:48:26 1630572506,,ui,say,==> googlecompute: Deleting instance...
1630572506,,ui,say,==> googlecompute: Deleting instance...
2021/09/02 11:48:27 packer-builder-googlecompute plugin: Retryable error: retrying for state DONE, got RUNNING
2021/09/02 11:48:29 packer-builder-googlecompute plugin: Retryable error: retrying for state DONE, got RUNNING
2021/09/02 11:48:31 packer-builder-googlecompute plugin: Retryable error: retrying for state DONE, got RUNNING

I tried to run it from locally but i have the same error.

"builders": [
    {
      "type": "googlecompute",
      "project_id": "xxxxxxxxxx",
      "source_image_project_id": "cis-public",
      "source_image_family": "cis-rhel7-l1",
      "ssh_username": "cxxxx",
      "account_file": "packer-sa.json",
      "zone": "europe-west2-c",
      "image_name": "jlr-gcp-cloudimages-cis-redhat78-{{timestamp}}",
      "image_family": "jlr-gcp-cloudimages-cis-redhat78",
      "machine_type": "c2-standard-4",
      "disk_size": "20",
      "network": "https://www.googleapis.com/compute/v1/projects/xxxxxxglobal/networks/xxxxxxxxx",
      "subnetwork": "https://www.googleapis.com/compute/v1/projects/xxxxxxxxxx/regions/europe-west2/subnetworks/xxxxxxxxx",
      "tags": "allow-ssh-build",
      "wrap_startup_script": "false",
      "use_iap": "true",
      "omit_external_ip": "true",
      "use_internal_ip": "true",
      "enable_secure_boot": "true",

Packer issue: Non-retryable tunnel error: ERROR: (gcloud.auth.activate-service-account)

This issue was originally opened by @ketanjoshi10 in hashicorp/packer#11245 and has been migrated to this repository. The original issue description is below.


Overview of the Issue

I am trying to create a simple image using Packer in GCP. I have all the required access to GCP console through CLI.
On triggering the Packer.json script it fails with below error:

==> googlecompute: Step Launch IAP Tunnel...
==> googlecompute: Non-retryable tunnel error: ERROR: (gcloud.auth.activate-service-account) Unable to read file []: [Errno 2] No such file or directory: ''
==> googlecompute:

Can anyone suggest a resolution for this?

Reproduction Steps

  • First created the VPC, subnet and firewall rule to allow ssh IAP access in this VPC.

  • I have created a service account with the following permissions:

Compute Admin
Compute Instance Admin (v1)
IAP-secured Tunnel User
Monitoring Metric Writer
Secret Manager Secret Accessor
Storage Object Viewer

  • The same packer.json was running fine 2 weeks ago. Suddenly it started to fail with the specified error on triggering.

Packer version

Tried on 1.7.4 as well as 1.6.6

Simplified Packer Buildfile

{
"variables": {
"project_id": "my-gcp-project",
"image_name": "my-packer-image",
"instance_name": "my-packer-instance",
"service_account_email": "[email protected]",
"zone": "us-east4-c",
"subnetwork": "my-gcp-subnet"
},

"builders": [
  {
    "type": "googlecompute",
    "image_name": "{{user `image_name`}}",
    "project_id": "{{user `project_id`}}",
    "source_image": "debian-10-buster-v20210701",
    "instance_name": "{{user `instance_name`}}",
    "machine_type": "e2-micro",
    "preemptible": true,
    "disk_size": "30",
    "disk_type": "pd-standard",
    "ssh_username": "packer",
    "zone": "{{user `zone`}}",
    "service_account_email": "{{user `service_account_email`}}",
    "use_iap": true,
    "omit_external_ip": true,
    "use_internal_ip": true,
    "subnetwork": "{{user `subnetwork`}}",
    "labels": {"environment":"prod", "group_name": "mgmt-group", "purpose": "baseimage"},
    "tags": ["allow-iap-ssh"],
    "scopes":  [
        "https://www.googleapis.com/auth/cloud-platform"
      ]
  }
],

"provisioners": [
  {
  "type": "file",
  "source": "metadata.sh",
  "destination": "/tmp/metadata.sh"
  },
  {
    "type": "shell",
    "inline": [
      "sudo bash /tmp/metadata.sh"
    ]
  }

GCS Data Source

Community Note

Please vote on this issue by adding a ๐Ÿ‘ reaction to the original issue to help the community and maintainers prioritize this request.
Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request.
If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Description

It would be nice if a GCS data source existed that would allow one to download GCS objects during packer builds. These could then be referenced in file provisioners for upload to the build instance.

Use Case(s)

This would be useful when using non-GCP builders that need access to private data stored in a GCS bucket.

Potential configuration

data "googlestorage" "my_file" {
  bucket = "a-bucket"
  object = "path/to/a.file"
}

...

build {
  ...
  provisioner "file" {
    sources     = data.googlestorage.my_file.local_path
    destination = "/tmp/a.file"
  }
}

If there isn't already an accepted solution for this, and there is also interest, I am happy to work on a PR for this feature.

`disk_name` value not used when creating disk instance

Overview of the Issue

The disk_name value isn't used by Packer when creating the VM instance's boot disk.

Reproduction Steps

Plugin and Packer version

Packer v1.7.6
googlecompute = 1.0.5

Simplified Packer Buildfile

source "googlecompute" "windows" {
  # Google Cloud parameters
  project_id   = var.gcp_project_id
  zone         = var.gcp_zone
  subnetwork   = var.gcp_subnetwork
  account_file = var.gcp_account_file

  # Builder VM parameters
  instance_name = var.builder_instance_name
  source_image  = var.builder_image
  machine_type  = var.builder_machine_type
  disk_name     = "${var.builder_instance_name}-c"
  disk_size     = var.builder_disk_size
}

Operating system and Environment details

macOS 11.6 (20G165)

Log Fragments and crash.log files

No relevant information in logs

Checksum failing

Hello there,

I have checksum failing for this plugin, any idea what might have gone wrong:

$ packer init .
Failed getting the "github.com/hashicorp/googlecompute" plugin:
1 error occurred:
	* could not get sha256 checksum file for github.com/hashicorp/googlecompute version 1.0.6. Is the file present on the release and correctly named ? Get "https://objects.githubusercontent.com/github-production-release-asset-2e65be/355855549/7cd9422a-c807-4b12-bb2e-84a2385bf584?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20211109%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20211109T082244Z&X-Amz-Expires=300&X-Amz-Signature=e85f16378f90705ff4eb9cab3c2954d15e024456d94967f9a836728c7a99c8e2&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=355855549&response-content-disposition=attachment%3B%20filename%3Dpacker-plugin-googlecompute_v1.0.6_SHA256SUMS&response-content-type=application%2Foctet-stream": EOF
packer {
  required_plugins {
    googlecompute = {
      version = ">= 1.0.6"
      source  = "github.com/hashicorp/googlecompute"
    }
  }
}

IAP tunnel process never stops if cleanup is aborted

Overview of the Issue

When -on-error=abort is used with packer build (so that the VM can be inspected if something fails) and a provisioning error occurs, the IAP tunnel process never stops.

Reproduction Steps

  1. Create a build file with source googlecompute and a provisioner config that will fail
  2. run "packer build -on-error=abort /path/to/build/file"
  3. wait for build to fail and abort
  4. run "ps -ef | grep gcloud-setup"

Plugin and Packer version

Packer v1.7.5

Operating system and Environment details

Running from gitlab on a Centos 8 gitlab runner.

Log Fragments and crash.log files

2022-05-26T17:41:49Z: ==> googlecompute.image-source: Error executing Ansible: Non-zero exit status: exit status 2
2022-05-26T17:41:49Z: ==> googlecompute.image-source: Step "StepProvision" failed, aborting...
2022-05-26T17:41:49Z: ==> googlecompute.image-source: aborted: skipping cleanup of step "StepConnect"
2022-05-26T17:41:49Z: ==> googlecompute.image-source: aborted: skipping cleanup of step "StepStartTunnel"
2022-05-26T17:41:49Z: ==> googlecompute.image-source: aborted: skipping cleanup of step "StepInstanceInfo"
2022-05-26T17:41:49Z: ==> googlecompute.image-source: aborted: skipping cleanup of step "StepCreateWindowsPassword"
2022-05-26T17:41:49Z: ==> googlecompute.image-source: aborted: skipping cleanup of step "StepCreateInstance"
2022-05-26T17:41:49Z: ==> googlecompute.image-source: aborted: skipping cleanup of step "StepImportOSLoginSSHKey"
2022-05-26T17:41:49Z: ==> googlecompute.image-source: aborted: skipping cleanup of step "nullStep"
2022-05-26T17:41:49Z: ==> googlecompute.image-source: aborted: skipping cleanup of step "StepSSHKeyGen"
2022-05-26T17:41:49Z: ==> googlecompute.image-source: aborted: skipping cleanup of step "StepCheckExistingImage"
2022-05-26T17:41:49Z: Build 'googlecompute.image-source' errored after 17 minutes 25 seconds: Error executing Ansible: Non-zero exit status: exit status 2
==> Wait completed after 17 minutes 25 seconds
==> Some builds didn't complete successfully and had errors:
2022/05/26 17:41:49 [INFO] (telemetry) ending googlecompute.image-source
==> Wait completed after 17 minutes 25 seconds
2022/05/26 17:41:49 machine readable: error-count []string{"1"}
==> Some builds didn't complete successfully and had errors:
2022/05/26 17:41:49 machine readable: googlecompute.image-source,error []string{"Error executing Ansible: Non-zero exit status: exit status 2"}
==> Builds finished but no artifacts were created.
--> googlecompute.image-source: Error executing Ansible: Non-zero exit status: exit status 2
==> Builds finished but no artifacts were created.
2022/05/26 17:41:49 [INFO] (telemetry) Finalizing.
2022/05/26 17:41:50 waiting for all plugin processes to complete...
2022/05/26 17:41:50 .packer.d/.packer.d/plugins/github.com/hashicorp/googlecompute/packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64: plugin process exited
2022/05/26 17:41:50 /usr/bin/packer: plugin process exited

Followed by a wait until the pipeline is timed out or someone logs in and manually kills the tunnel process.

Invalid value for field 'resource.sourceDisk'

This issue was originally opened by @wurde as hashicorp/packer#11089. It was migrated here as a result of the Packer plugin split. The original body of the issue is below.


Hi. I'm trying to create a GCE image using the googlecompute builder.

Configuration:

source "googlecompute" "consul-test" {
  account_file = "xxx.json"
  project_id = "xxx"
  source_image = "ubuntu-minimal-2104-hirsute-v20210611"
  ssh_username = "root"
  zone = "us-central1-a"
}

Packer v1.7.3
Ubuntu 20.04 x86_64

Log output with the error:

googlecompute.consul-test: output will be in this color.

==> googlecompute.consul-test: Checking image does not exist...
==> googlecompute.consul-test: Creating temporary RSA SSH key for instance...
==> googlecompute.consul-test: Using image: ubuntu-minimal-2104-hirsute-v20210611
==> googlecompute.consul-test: Creating instance...
    googlecompute.consul-test: Loading zone: us-central1-a
    googlecompute.consul-test: Loading machine type: n1-standard-1
    googlecompute.consul-test: Requesting instance creation...
    googlecompute.consul-test: Waiting for creation operation to complete...
    googlecompute.consul-test: Instance has been created!
==> googlecompute.consul-test: Waiting for the instance to become running...
    googlecompute.consul-test: IP: xxx
==> googlecompute.consul-test: Using SSH communicator to connect: xxx
==> googlecompute.consul-test: Waiting for SSH to become available...
==> googlecompute.consul-test: Connected to SSH!
==> googlecompute.consul-test: Deleting instance...
    googlecompute.consul-test: Instance has been deleted!
==> googlecompute.consul-test: Creating image...
==> googlecompute.consul-test: Error waiting for image: googleapi: Error 400: Invalid value for field 'resource.sourceDisk': 'https://compute.googleapis.com/compute/v1/xxx/zones/us-central1-a/disks/packer-60c7f60e-a85b-8f2b-15dc-da7f93554984'. The URL is malformed., invalid

builder/googlecompute: Disk not deleted when using custom `disk_name` option

This issue was originally opened by @vmoravec in hashicorp/packer#9960 and has been migrated to this repository. The original issue description is below.


Overview of the Issue

While using the googlecompute builder together with the option disk_name, such a disk resource is not deleted when an instance is going to be deleted. Packer ignores the given configuration and creates a VM disk with the name of the instance. However, when deleting the instance, it is looking for the disk set by disk_name although it hasn't been created in the first place . In the end the disk named by the instance, must be deleted manually.

Reproduction Steps

Set disk_name option for the googlecompute builder

Packer version

Packer version: 1.6.2 [go1.13.15 linux amd64]

Simplified Packer Buildfile

{
    "variables": {
      "username": "{{ env `USER` }}",
      "project": "{{ env `GCP_PROJECT` }}",
      "zone": "{{ env `ZONE` }}",
      "subnet": "{{ env `SUBNETWORK` }}"
    },
"builders": [
      {
        "type": "googlecompute",
        "account_file": "/etc/path/{{ user `project` }}-{{ user `username` }}.json",
        "project_id": "{{ user `project` }}",
        "disable_default_service_account": true,
        "source_image": "sles-15-sp2-v20200804",
        "source_image_family": "suse-cloud",
        "ssh_username": "{{ user `username` }}",
        "subnetwork": "{{ user `subnet` }}",
        "zone": "{{ user `zone` }}",
        "tags": [ "packer" ],
        "use_os_login": true,
        "disk_name": "fde-boot-{{ timestamp }}",
        "image_name": "fde-image-{{ timestamp }}",
        "instance_name": "fde-packer-{{ uuid }}",
        "use_internal_ip": true,
        "omit_external_ip": true
      }
    ]
}

Operating system and Environment details

SUSE Linux Enterprise Server 12 SP5

Log Fragments and crash.log files

googlecompute: Instance has been deleted!
googlecompute: Deleting disk...
==> googlecompute:
==> googlecompute: Name: fde-packer-5f648664-fdd4-7c62-7474-2358ee05bdd9
==> googlecompute: Error: googleapi: Error 404: The resource 'projects/project-name/zones/us-central1-a/disks/fde-boot-1600423524' was not found, notFound
==> googlecompute: Error deleting disk. Please delete it manually.
==> googlecompute:
==> googlecompute: Name: fde-packer-5f648664-fdd4-7c62-7474-2358ee05bdd9
==> googlecompute: Error: googleapi: Error 404: The resource 'projects/project-name/zones/us-central1-a/disks/fde-boot-1600423524' was not found, notFound
googlecompute: Disk has been deleted!

GCP, OS Login, and Ansible

Overview of the Issue

I'm trying to enable OS Login on a previously working Packer + Ansible setup.

It appears that when you use the Ansible user task for the user packer is using in the Ansible provisioner, login breaks.

Reproduction Steps

Put the files below in the same directory and run packer build packer.json
There are a few variables that you may want to change.

If you remove either of the following... the image will build

  • the OS Login lines
  • the user field in the provisioner

Packer version

Packer v1.7.4

Simplified Packer Template

packer.json
{
  "variables": {
    "gcp_project": "ferrum-dev"
  },
  "builders": [
    {
      "image_name": "repro-{{isotime | clean_resource_name}}",
      "image_family": "packer-repro",
      "type": "googlecompute",
      "project_id": "{{ user `gcp_project` }}",
      "source_image": "centos-7-v20211105",
      "ssh_username": "centos",
      "zone": "us-central1-a",

      "machine_type": "n1-standard-2",

      "service_account_email": "devops-bot@{{ user `gcp_project` }}.iam.gserviceaccount.com",
      "scopes": ["https://www.googleapis.com/auth/cloud-platform"],

      "use_internal_ip": true,
      "omit_external_ip": true,
      "metadata": {
        "enable-oslogin": "True"
      },
      "use_os_login": true,

      "network": "projects/{{ user `gcp_project` }}/global/networks/{{ user `gcp_project` }}",
      "subnetwork": "projects/{{ user `gcp_project` }}/regions/us-central1/subnetworks/{{ user `gcp_project` }}-central-subnet"
    }
  ],

  "provisioners": [
    {
      "type": "ansible",
      "user": "centos",
      "ansible_env_vars": [
          "ANSIBLE_HOST_KEY_CHECKING=False",
          "ANSIBLE_SSH_ARGS='-o ForwardAgent=yes -o ControlMaster=auto -o ControlPersist=60s'",
          "ANSIBLE_NOCOLOR=True",
          "ANSIBLE_DEBUG=false",
          "ANSIBLE_VERBOSITY=1"
      ],
      "playbook_file": "./playbook.yml"
    }
  ]

}
playbook.yml
---
- name: Packer OS Login repro
  hosts: all
  become: true
  become_method: sudo
  vars:
    GO_VERSION: "1.17.5"
  tasks:
  - name: Ensure Centos User
    user:
      name: centos
      state: present

  - name: Download Golang
    get_url:
      url: https://dl.google.com/go/go{{ GO_VERSION }}.linux-amd64.tar.gz
      dest: /tmp/go{{ GO_VERSION }}.linux-amd64.tar.gz

Operating system and Environment details

Running from debian-10, against a centos-7 host

Log Fragments and crash.log files

    googlecompute: TASK [Download Golang] *********************************************************
    googlecompute: fatal: [default]: UNREACHABLE! => {"changed": false, "msg": "Failed to create temporary directory.In some cases, you may have been able to authenticate and did not have permissions on the target directory. Consider changing the remote tmp path in ansible.cfg to a path rooted in \"/tmp\", for more error information use -vvv. Failed command was: ( umask 77 && mkdir -p \"` echo /home/centos/.ansible/tmp `\"&& mkdir /home/centos/.ansible/tmp/ansible-tmp-1641501772.3634222-603-133097428795282 && echo ansible-tmp-1641501772.3634222-603-133097428795282=\"` echo /home/centos/.ansible/tmp/ansible-tmp-1641501772.3634222-603-133097428795282 `\" ), exited with result 1", "unreachable": true}

IAP Cloud Build: SSH Permission Denied

Overview of the Issue

I am trying to use Google Cloud Build to create Packer images, but with the machines being configured to have no external IP. The IAP options seem perfect for this, but I have yet to get a standard build to finish with those options being set. It always fails when trying to establish the SSH connection.

I have verified that it is not a permissions issue with the firewall rules or the service account IAM permissions as I can impersonate it on the CLI and there is no problem connecting through SSH to the private machines.

Reproduction Steps

  1. Prepare a Google Cloud Build run, with the relevant steps to execute Packer with this plugin (example below).
  2. Supply Packer with the config file described below (I do it through a cloud source repo).
  3. Assign the proper permissions to the cloud build service account (I use a custom one). Most notable is IAP-secured Tunnel User but others will probably be required.
  4. Configure your VPC firewall rules to allow the IAP CIDR (35.235.240.0/20) into all the instances in the VPC.
  5. Trigger the build step and see it hang and timeout on this message: "Waiting for SSH to become available...".

Plugin and Packer version

Plugin: 1.0.13
Packer: Docker image, light-1.8.2

Simplified Packer Buildfile

Note: I have tried with a dynamic and static IAP localhost port, with no setting making a difference.

source "googlecompute" "base-deb11" {
  source_image = "a custom Debian 11 image"
  enable_secure_boot = true
  enable_vtpm = true
  enable_integrity_monitoring = true
  
  network = "network"
  subnetwork = "subnet"
  omit_external_ip = true
  use_internal_ip = true
  use_iap = true
  # iap_localhost_port = 22

  service_account_email = "cloud-build@${var.project_id}.iam.gserviceaccount.com"
  impersonate_service_account = "cloud-build@${var.project_id}.iam.gserviceaccount.com"

  temporary_key_pair_type = "ed25519"
  ssh_username = "auto-replaced"
  use_os_login = false
}

Operating system and Environment details

  • Running in Google Cloud Build. I have tried both the default worker space and private worker pools.
  • VM image is a lightly modified version of Debian 11.3. The firewall allows SSH (port 22) and works fine when an external IP is attached, so this is also not the issue.
source:
  repoSource:
    projectId: projects/redacted
    repoName: redacted
    branchName: base-deb11
    dir: base-deb11
steps:
  - name: 'hashicorp/packer:light'
    args:
      - '-c'
      - packer init base-deb11.gcloud.pkr.hcl
    dir: /workspace/base-deb11
    entrypoint: bash
  - name: 'hashicorp/packer:light'
    env:
      - PACKER_LOG=1
      - PACKER_LOG_PATH=/workspace/packer.log
    args:
      - '-c'
      - packer build base-deb11.gcloud.pkr.hcl
    dir: /workspace/base-deb11
    entrypoint: bash

Log Fragments and crash.log files

These are the relevant lines from packer.log, with the entire gist still being linked:

2022/06/30 00:04:08 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/06/30 00:04:08 Finding an available TCP port for IAP proxy
2022/06/30 00:04:08 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/06/30 00:04:08 Found available port: 8290 on IP: 0.0.0.0
2022/06/30 00:04:08 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/06/30 00:04:08 Setting up proxy to listen on localhost at 8290
2022/06/30 00:04:08 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/06/30 00:04:08 Creating tunnel launch script with args []string{"compute", "start-iap-tunnel", "base-deb11", "22", "--local-host-port=localhost:8290", "--zone", "redacted", "--project", "redacted", "--impersonate-service-account='[email protected]'"}
2022/06/30 00:04:08 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/06/30 00:04:08 [INFO] (google): Prepending inline gcloud setup script with #!/bin/sh
2022/06/30 00:04:09 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/06/30 00:04:09 stderr: /tmp/gcloud-setup3357350656: line 2: gcloud: not found
2022/06/30 00:04:38 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/06/30 00:04:38 No error detected after tunnel launch; continuing...
2022/06/30 00:04:38 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/06/30 00:04:38 Using host value: localhost
2022/06/30 00:04:38 ui: ๏ฟฝ[1;32m==> googlecompute.base-deb11: Using SSH communicator to connect: localhost๏ฟฝ[0m
2022/06/30 00:04:38 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/06/30 00:04:38 [INFO] Waiting for SSH, up to timeout: 5m0s
2022/06/30 00:04:38 ui: ๏ฟฝ[1;32m==> googlecompute.base-deb11: Waiting for SSH to become available...๏ฟฝ[0m
2022/06/30 00:04:38 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/06/30 00:04:38 Using host value: localhost
2022/06/30 00:04:38 packer-plugin-googlecompute_v1.0.13_x5.0_linux_amd64 plugin: 2022/06/30 00:04:38 [DEBUG] TCP connection to SSH ip/port failed: dial tcp 127.0.0.1:8290: connect: connection refused

Potential Workarounds

Internally, it appears that this plugin is using this command, which is causing the issue:

gcloud compute start-iap-tunnel <instance> 22 --local-host-port=localhost:<locahost port> --zone <zone> --project <project> --impersonate-service-account='<service account>'

I have been able to get the build to work using these two alternatives:

  1. Using tunnel-though
gcloud compute ssh --tunnel-through-iap <instance> --project <project> --zone <zone>
  1. Using private worker pools. This replaces IAP (ie you disable it) and makes the cloud build node apart of a private worker pool that directly has access to the local IPs of the machines that it creates. This requires some extra firewall rules, IAM permissions, peering, and private service connections.

Add image_signatures_db to googlecompute builder

This issue was originally opened by @sas1su in hashicorp/packer#11965 and has been migrated to this repository. The original issue description is below.


Community Note

  • Please vote on this issue by adding a ๐Ÿ‘ reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Please search the existing issues for relevant feature requests, and use the
reaction feature
(https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/)
to add upvotes to pre-existing requests.

Description

We have some requirement to build custom GCP images with additional trusted certificate to sign the boot file. Currently the process seems to be 1) googlecompute builder to build an image 2) googlecompute-export to cloud storage 3) googlecompute-import to add certificates [1] .

Use Case(s)

Step 2) and 3) can be avoided

Potential configuration

source "googlecompute" "basic-example" {
  project_id = "my project"
  source_image = "debian-9-stretch-v20200805"
  ssh_username = "packer"
  zone = "us-central1-a"
image_signatures_db = ["cert1","cert2"]
}

Potential References

[1] https://www.packer.io/plugins/post-processors/googlecompute/googlecompute-import#image_signatures_db
[2] https://cloud.google.com/sdk/gcloud/reference/compute/images/create#--signature-database-file

Customer-managed Encryption Key for Remote VM's Boot Disk

Community Note

Please vote on this issue by adding a ๐Ÿ‘ reaction to the original issue to help the community and maintainers prioritize this request.
Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request.
If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Description

Current Packer version (<=v1.7.2) and packer-plugin-googlecompute use google-managed encryption key for remote VM's boot disk. We should add a new feature in packer to allow user to specify customer-managed encryption key on remote VM's boot disk.

Proposed new behavior would be:

  • if value is provided, use customer-managed encryption key for remote VM's boot disk
  • if value is absent, use google-managed encryption key for remote VM's boot disk. This is GCP default behavior.

Note that this is different to existing Packer builder googlecompute's configuration image_encryption_key. image_encryption_key is used to configure encryption key on final artifact (the compute image). This new feature is to configure encryption key on packer temporary remote VM's boot disk.

Use Case(s)

Allow user to add customer-managed encryption key to packer remote VM's boot disk.

Potential configuration

  disk_encryption_key {
    kmsKeyName = "projects/${var.project_id}/locations/${var.location}/keyRings/${var.key_ring}/cryptoKeys/${var.key}"
  }

Potential References

googlecompute-export uses a random image after it has built a custom image

This issue was originally opened by @saeeda as hashicorp/packer#8376. It was migrated here as a result of the Packer plugin split. The original body of the issue is below.


Overview of the Issue

When exporting a custom built image using googlecompute-export, it uses a different image to build the temporary instance in googlecompute-export): Using image step.

Reproduction Steps

Create a custom image using the googlecompute similar to following:
Sample-packer-config.md

Packer version

From PACKER_VERSION=1.4.4

Simplified Packer Buildfile

Sample-packer-config.md

Operating system and Environment details

Running by Jenkins() inside a docker agent, running docker.
CentOS Linux 7
Docker version 18.09.6
Jenkins ver. 2.164.2

Log Fragments and crash.log files

As shown in the gist above, packer uses an image for creating an image, that does not reflect the custom image being created by packer.
The image name neither exists in the google project where packer is run, nor where custom image is built.

==> googlecompute (googlecompute-export): Using image: random-image-name

Google Cloud - Support for CMEK for VM disk which are created for image creation

This issue was originally opened by @kamaltherocky in hashicorp/packer#11272 and has been migrated to this repository. The original issue description is below.


Please search the existing issues for relevant feature requests, and use the
reaction feature
(https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/)
to add upvotes to pre-existing requests.

Community Note

Please vote on this issue by adding a ๐Ÿ‘ reaction to the original issue to help the community and maintainers prioritize this request.
Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request.
If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Description

Currently, Packer only supports creating the new image using CMEK but for disks which are created in the VM used for creating the image.

We have enforced CMEK key for all disks in GCP, so when we run the packer to create an image, the VM is created with a Disk that is not encrypted with CMEK, so security control detects and deletes those VM and disk.

It would be good if the VM created by Packer can build the VM disk with the CMEK key passed to the builder.

Use Case(s)

Any relevant use-cases that you see.

Potential configuration

disk_encryption_key = "CMEK Key Resource ID"

Potential References

Current support for CMEK for images - https://www.packer.io/docs/builders/googlecompute#image_encryption_key

Google Compute Engine cannot start from custom-image created by Packer version 1.6.4

This issue was originally opened by @j-flat as hashicorp/packer#10100. It was migrated here as a result of the Packer plugin split. The original body of the issue is below.


We have an issue on our Google project, where we are attempting to use Packer baked custom-image to spin up Google Compute Engine instances and the instance doesn't go beyond very first seconds of UEFI boot.

Nothing on Packer logs (with PACKER_LOG set to 1) states that something has gone wrong with the provisioning or other parts of Packer process, but on Google end there are also no issues.

If new instance is created from this custom-image, UEFI boot doesn't go beyond this point, if monitored on Serial Port 1 logs:

UEFI: Attempting to start image.
Description: UEFI Google PersistentDisk
FilePath: PciRoot(0x0)/Pci(0x3,0x0)/Scsi(0x1,0x0)
OptionNumber: 1.
[1m[37m[40m[01;01H[2J[01;01H2020/10/09 10:41:37 GCEGuestAgent: GCE Agent Started (version 20200813.01)
2020-10-09T10:44:00.5273Z OSConfigAgent Info: OSConfig Agent (version 20200901.01) started.

We are using public image from Windows 2019 Server family and this has been tested with both Packer v1.6.2 and Packer v1.6.4 for Windows 64bit Packer.

What Packer is doing on provisioning state is:

  • installs & pre-configures IIS on the instance
  • downloads Stackdriver Logging and Monitoring Agents
  • installs MS Web Deploy 3.6. in order to later deploy .NET Web Application on the instances created from this custom image
  • generalizes the image running gcesysprep at the end of the Packer process

We are attempting to generate these custom-images with both Packer v1.6.2 & newer Packer v1.6.4

What I can see is that Packer creates the temporary instance successfully and Google Compute Engine instance details page states that the source-disk should not be deleted when this temporary instance is deleted. However at the end of the Packer process when Packer deletes the temporary instance, also the source disk associated with the custom image gets deleted.

I add here Azure DevOps pipeline yaml configuration, packer.json as well as Azure DevOps logs from packer process to help to further describe how the process is now setup.

Packer Support.zip

Allow choosing nic-type on instance creation

Description

Google Virtual NIC (gVNIC) is a virtual network interface designed specifically for Compute Engine.
It was released as GA early this year, and the compute API now allows you to choose which nic-type to use when creating a VM
https://cloud.google.com/compute/docs/networking/using-gvnic

gcloud compute instances create xxxx --zone=us-west1-b --image=my-image --image-project=my-project-12345 --network-interface=nic-type=GVNIC

Use Case(s)

If a customer is only using gVNIC in their images, they want the builder created by packer with this flag
If a VM is created from an image that only has the gvnic driver without specifying the nic-type, it will not work.

Potential configuration

Optional configuration option: "nic_type" : "gvnic"

Potential References

Already implemented in Terraform
https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_instance#nic_type

OS Login doesn't work with Service Account Impersonation

OS Login doesn't work with service account impersonation.

Error Log

 REDACTED ๎‚ฐ MCW0CDP3YY ๎‚ฐ ~ ๎‚ฐ Desktop ๎‚ฑ Git ๎‚ฑ REDACTED-image-pipeline-ccoe ๎‚ฑ linux ๎‚ฐ ๎‚  main ๎‚ฐ 1โœŽ ๎‚ฐ $ ๎‚ฐ  PACKER_LOG=1 packer build --var-file ubuntu.pkrvars.hcl image.pkr.hcl 2021/12/13 14:09:36 [INFO] Packer version: 1.7.8 [go1.17.2 darwin amd64]
2021/12/13 14:09:36 Old default config directory found: /Users/REDACTED/.packer.d
2021/12/13 14:09:36 [TRACE] discovering plugins in /usr/local/bin
2021/12/13 14:09:36 Old default config directory found: /Users/REDACTED/.packer.d
2021/12/13 14:09:36 [TRACE] discovering plugins in /Users/REDACTED/.packer.d/plugins
2021/12/13 14:09:36 [TRACE] discovering plugins in .
2021/12/13 14:09:36 [INFO] PACKER_CONFIG env var not set; checking the default config file path
2021/12/13 14:09:36 [INFO] PACKER_CONFIG env var set; attempting to open config file: /Users/REDACTED/.packerconfig
2021/12/13 14:09:36 [WARN] Config file doesn't exist: /Users/REDACTED/.packerconfig
2021/12/13 14:09:36 Old default config directory found: /Users/REDACTED/.packer.d
2021/12/13 14:09:36 [INFO] Setting cache directory: /Users/REDACTED/.cache/packer
2021/12/13 14:09:36 Old default config directory found: /Users/REDACTED/.packer.d
2021/12/13 14:09:36 [TRACE] listing potential installations for "github.com/hashicorp/googlecompute" that match ">= 1.0.0". plugingetter.ListInstallationsOptions{FromFolders:[]string{"/usr/local/bin/packer", ".", "/Users/REDACTED/.packer.d/plugins"}, BinaryInstallationOptions:plugingetter.BinaryInstallationOptions{APIVersionMajor:"5", APIVersionMinor:"0", OS:"darwin", ARCH:"amd64", Ext:"", Checksummers:[]plugingetter.Checksummer{plugingetter.Checksummer{Type:"sha256", Hash:(*sha256.digest)(0xc00020a080)}}}}
2021/12/13 14:09:36 [TRACE] Found the following "github.com/hashicorp/googlecompute" installations: [{/Users/REDACTED/.packer.d/plugins/github.com/hashicorp/googlecompute/packer-plugin-googlecompute_v1.0.8_x5.0_darwin_amd64 v1.0.8}]
2021/12/13 14:09:37 [INFO] found external [-packer-default-plugin-name-] builders from googlecompute plugin
2021/12/13 14:09:37 [INFO] found external [export import] post-processors from googlecompute plugin
2021/12/13 14:09:37 [TRACE] validateValue: not active for zone, so skipping
2021/12/13 14:09:37 [TRACE] validateValue: not active for project_id, so skipping
2021/12/13 14:09:37 [TRACE] validateValue: not active for script, so skipping
2021/12/13 14:09:37 [TRACE] validateValue: not active for network_project, so skipping
2021/12/13 14:09:37 [TRACE] validateValue: not active for ssh_user, so skipping
2021/12/13 14:09:37 [TRACE] validateValue: not active for region, so skipping
2021/12/13 14:09:37 [TRACE] validateValue: not active for image_name_prefix, so skipping
2021/12/13 14:09:37 [TRACE] validateValue: not active for ssh_key_file, so skipping
2021/12/13 14:09:37 [TRACE] validateValue: not active for labels, so skipping
2021/12/13 14:09:37 [TRACE] validateValue: not active for impersonate_service_account, so skipping
2021/12/13 14:09:37 [TRACE] validateValue: not active for subnetwork, so skipping
2021/12/13 14:09:37 [TRACE] validateValue: not active for environment, so skipping
2021/12/13 14:09:37 [TRACE] validateValue: not active for image_description, so skipping
2021/12/13 14:09:37 [TRACE] validateValue: not active for image_family, so skipping
2021/12/13 14:09:37 [TRACE] validateValue: not active for source_image_family, so skipping
2021/12/13 14:09:37 [TRACE] Starting external plugin /Users/REDACTED/.packer.d/plugins/github.com/hashicorp/googlecompute/packer-plugin-googlecompute_v1.0.8_x5.0_darwin_amd64 start builder -packer-default-plugin-name-
2021/12/13 14:09:37 Starting plugin: /Users/REDACTED/.packer.d/plugins/github.com/hashicorp/googlecompute/packer-plugin-googlecompute_v1.0.8_x5.0_darwin_amd64 []string{"/Users/REDACTED/.packer.d/plugins/github.com/hashicorp/googlecompute/packer-plugin-googlecompute_v1.0.8_x5.0_darwin_amd64", "start", "builder", "-packer-default-plugin-name-"}
2021/12/13 14:09:37 Waiting for RPC address for: /Users/REDACTED/.packer.d/plugins/github.com/hashicorp/googlecompute/packer-plugin-googlecompute_v1.0.8_x5.0_darwin_amd64
2021/12/13 14:09:37 packer-plugin-googlecompute_v1.0.8_x5.0_darwin_amd64 plugin: 2021/12/13 14:09:37 Plugin address: unix /var/folders/b1/dthn83bs2qbcrg38qszm22440000gn/T/packer-plugin803328759
2021/12/13 14:09:37 packer-plugin-googlecompute_v1.0.8_x5.0_darwin_amd64 plugin: 2021/12/13 14:09:37 Waiting for connection...
2021/12/13 14:09:37 Received unix RPC address for /Users/REDACTED/.packer.d/plugins/github.com/hashicorp/googlecompute/packer-plugin-googlecompute_v1.0.8_x5.0_darwin_amd64: addr is /var/folders/b1/dthn83bs2qbcrg38qszm22440000gn/T/packer-plugin803328759
2021/12/13 14:09:37 packer-plugin-googlecompute_v1.0.8_x5.0_darwin_amd64 plugin: 2021/12/13 14:09:37 Serving a plugin connection...
2021/12/13 14:09:37 packer-plugin-googlecompute_v1.0.8_x5.0_darwin_amd64 plugin: 2021/12/13 14:09:37 [TRACE] starting builder -packer-default-plugin-name-
2021/12/13 14:09:37 [TRACE] Starting internal plugin packer-provisioner-shell
2021/12/13 14:09:37 Starting plugin: /usr/local/bin/packer []string{"/usr/local/bin/packer", "plugin", "packer-provisioner-shell"}
2021/12/13 14:09:37 Waiting for RPC address for: /usr/local/bin/packer
2021/12/13 14:09:37 packer-provisioner-shell plugin: [INFO] Packer version: 1.7.8 [go1.17.2 darwin amd64]
2021/12/13 14:09:37 packer-provisioner-shell plugin: Old default config directory found: /Users/REDACTED/.packer.d
2021/12/13 14:09:37 packer-provisioner-shell plugin: [INFO] PACKER_CONFIG env var not set; checking the default config file path
2021/12/13 14:09:37 packer-provisioner-shell plugin: [INFO] PACKER_CONFIG env var set; attempting to open config file: /Users/REDACTED/.packerconfig
2021/12/13 14:09:37 packer-provisioner-shell plugin: [WARN] Config file doesn't exist: /Users/REDACTED/.packerconfig
2021/12/13 14:09:37 packer-provisioner-shell plugin: Old default config directory found: /Users/REDACTED/.packer.d
2021/12/13 14:09:37 packer-provisioner-shell plugin: [INFO] Setting cache directory: /Users/REDACTED/.cache/packer
2021/12/13 14:09:37 packer-provisioner-shell plugin: args: []string{"packer-provisioner-shell"}
2021/12/13 14:09:37 packer-provisioner-shell plugin: Old default config directory found: /Users/REDACTED/.packer.d
2021/12/13 14:09:37 packer-provisioner-shell plugin: Plugin address: unix /var/folders/b1/dthn83bs2qbcrg38qszm22440000gn/T/packer-plugin726205717
2021/12/13 14:09:37 packer-provisioner-shell plugin: Waiting for connection...
2021/12/13 14:09:37 Received unix RPC address for /usr/local/bin/packer: addr is /var/folders/b1/dthn83bs2qbcrg38qszm22440000gn/T/packer-plugin726205717
2021/12/13 14:09:37 packer-provisioner-shell plugin: Serving a plugin connection...
2021/12/13 14:09:37 Build debug mode: false
2021/12/13 14:09:37 Force build: false
2021/12/13 14:09:37 On error: 
2021/12/13 14:09:37 Waiting on builds to complete...
googlecompute.packer: output will be in this color.

2021/12/13 14:09:37 Starting build run: googlecompute.packer
2021/12/13 14:09:37 Running builder: 
2021/12/13 14:09:37 [INFO] (telemetry) Starting builder googlecompute.packer
2021/12/13 14:09:37 packer-plugin-googlecompute_v1.0.8_x5.0_darwin_amd64 plugin: 2021/12/13 14:09:37 [INFO] Instantiating GCE client...
2021/12/13 14:09:37 packer-plugin-googlecompute_v1.0.8_x5.0_darwin_amd64 plugin: 2021/12/13 14:09:37 [INFO] Instantiating OS Login client...
==> googlecompute.packer: Checking image does not exist...
==> googlecompute.packer: Creating temporary RSA SSH key for instance...
==> googlecompute.packer: Importing SSH public key for OSLogin...
2021/12/13 14:09:44 packer-plugin-googlecompute_v1.0.8_x5.0_darwin_amd64 plugin: 2021/12/13 14:09:44 [INFO] OSLogin: Could not derive a GCE service account from google metadata server after 5s
==> googlecompute.packer: Error importing SSH public key for OSLogin: googleapi: Error 403: End user credentials must match the user specified in the request., forbidden
==> googlecompute.packer: Deleting SSH public key for OSLogin...
==> googlecompute.packer: 
==> googlecompute.packer: Error: googleapi: Error 403: End user credentials must match the user specified in the request., forbidden
==> googlecompute.packer: Error deleting SSH public key for OSLogin. Please delete it manually.
==> googlecompute.packer: 
2021/12/13 14:09:44 [INFO] (telemetry) ending googlecompute.packer
==> googlecompute.packer: Error: googleapi: Error 403: End user credentials must match the user specified in the request., forbidden
==> Wait completed after 7 seconds 586 milliseconds
2021/12/13 14:09:44 machine readable: error-count []string{"1"}
==> Some builds didn't complete successfully and had errors:
2021/12/13 14:09:44 machine readable: googlecompute.packer,error []string{"Error importing SSH public key for OSLogin: googleapi: Error 403: End user credentials must match the user specified in the request., forbidden"}
==> Builds finished but no artifacts were created.
2021/12/13 14:09:44 [INFO] (telemetry) Finalizing.
Build 'googlecompute.packer' errored after 7 seconds 586 milliseconds: Error importing SSH public key for OSLogin: googleapi: Error 403: End user credentials must match the user specified in the request., forbidden

==> Wait completed after 7 seconds 586 milliseconds

==> Some builds didn't complete successfully and had errors:
--> googlecompute.packer: Error importing SSH public key for OSLogin: googleapi: Error 403: End user credentials must match the user specified in the request., forbidden

==> Builds finished but no artifacts were created.
2021/12/13 14:09:45 waiting for all plugin processes to complete...
2021/12/13 14:09:45 /Users/REDACTED/.packer.d/plugins/github.com/hashicorp/googlecompute/packer-plugin-googlecompute_v1.0.8_x5.0_darwin_amd64: plugin process exited
2021/12/13 14:09:45 /usr/local/bin/packer: plugin process exited

Packer version

Packer v1.7.8
googlecompute v1.0.8

Config

packer {
  required_plugins {
    googlecompute = {
      version = ">= 1.0.8"
      source  = "github.com/hashicorp/googlecompute"
    }
  }
}

variable "project_id"{
  type = string
}

source "googlecompute" "test" {
  project_id   = var.project_id
  impersonate_service_account = "email.com"
  zone = "us-central1-a"
  source_image = "rocky-linux-8-v20211105"
  ssh_username = "test"
  image_name   = "test-rocky-1"
  image_family = "test-rocky"
  use_os_login = true
}

build {
  sources = [
    "source.googlecompute.test"
  ]
  provisioner "shell" {
    inline = ["echo foo"]
  }
}

feat: `enable_nested_virtualization` on ephemeral instance

Description

Actually, the Google Compute Builder is only able to create a image with nested licenses to build a Google Compute image but
in my case, I need to use Packer in Packer to create a legacy image (qcow2) inside the Google Compute Builder.

But we get this error:

qemu-system-x86_64: failed to initialize KVM

The Google Compute Builder doesn't be able to use the enable_nested_virtualization on ephemeral instance.

Use Case(s)

  • for factory image builder, It could be interesting to activate this option to be able to craft legacy image like raw or qcow2 instead of creating a custom image with the license activated:
    • And after using terraform to start a new VM with this image to be able to craft the artifacts wanted
    • Or using the special image with the Google Compute Builder.

It force to maintain a special image apart this section whereas Google Compute Engine have a recommended option for that.

Potential configuration

It could be great to use like terraform:

  advanced_machine_features {
    enable_nested_virtualization = true
  }

Potential References

Recommended. Enable nested virtualization directly on a new or existing VM by setting the enableNestedVirtualization field to true while creating the VM or by updating the VM. 

This is the recommended method because it doesn't require that you create a custom image or use the special license key.

Wrapper startup-script sets startup-script-status to "done" instead of "error" when a wrapped startup script fails.

Overview of the Issue

The Wrapper startup-script defined in startup.go:

var StartupScriptLinux string = fmt.Sprintf(`#!/usr/bin/env bash

sets the metadata startup-script-status to "done" instead of "error" when the wrapped script fails.

To fix it change:

echo "Packer startup script done."
SetMetadata %s %s
exit $RETVAL
`, StartupWrappedScriptKey, StartupScriptStatusKey, StartupScriptStatusDone)

To something like:

if [ "$RETVAL" == "0" ]; then
  echo "Packer startup script done."
  SetMetadata %[2]s %[3]s
else
  echo "Packer startup script failed with return value: $RETVAL"
  SetMetadata %[2]s %[4]s
fi
exit $RETVAL
`, StartupWrappedScriptKey, StartupScriptStatusKey, StartupScriptStatusDone, StartupScriptStatusError)

Reproduction Steps

Create a startup-script that fails and let the builder wrap it.
Trigger a packer build and notice that the startup-script-status is set to "done".

Plugin and Packer version

plugin: googlecompute 1.05

Add support to windows-startup-script-ps1 on Packer GCP (Terraform already supports this feature)

This issue was originally opened by @lmayorga1980 in hashicorp/packer#10342 and has been migrated to this repository. The original issue description is below.


Description

According to https://www.packer.io/docs/builders/googlecompute.html#windows, is only possible to use the windows-startup-script-cmd when using GCP as the builder. Would it be possible to use an existing powershell script?

Use Case(s)

Powershell script uses a combination of cmdlets and native windows executables.

Potential configuration

metadata": { "windows-startup-script-ps1":  "scripts/user_data.ps1" },

Add "--no-guest-environment" boolean option to google compute import post-processor

Would like to be able to add the "--no-guest-environment" flag via the google compute import post-processor so that google does not attempt to install the Google guest environment on my imported image.

https://cloud.google.com/sdk/gcloud/reference/compute/images/import#--guest-environment

Google recommends that we install the guest environment ourselves in our image rather than have it added during import. Not sure why Google defaults to installing the guest environment during import, but it is breaking my guest environment. Many of the scripts that are part of the guest environment are getting overwritten with nothing and leaving me with a bunch of blank files - hence I want the option to not have the guest environment installed during import.

A boolean field/option in this plugin would be great.

User created custom image is not found error while running the packer code on GCP

I have created the custom image using packer from the public image ubuntu-1804-bionic-v20210825 and try to create the next custom image from the custom image but getting the error Error getting source image for instance creation: Could not find image. The issue is intermittent and it's succeed sometime but getting failed most of the times.

I am using the latest packer and gcloud version on my Mac. I try the same on both gcloud version 355 and 356 version. Please find the details below:

$ packer --version
1.7.4

$ gcloud --version

  • Google Cloud SDK 356.0.0
  • beta 2021.09.03
  • bq 2.0.71
  • core 2021.09.03
  • gsutil 4.67

Used packer code:
{ "type": "googlecompute", "account_file": "/Users/someshp/key.json", "project_id": "{{ user gcp_project_id}}", "source_image": "{{ usergcp_source_image}}", "source_image_family": "{{ usergcp_image_family}}", "source_image_project_id": "{{ usergcp_project_id}}", "machine_type": "{{ usergcp_machine_type}}", "ssh_username": "ubuntu", "ssh_timeout": "5m", "region": "{{ usergcp_region}}", "zone": "{{ usergcp_zone}}", "network": "{{ usergcp_network}}", "subnetwork": "{{ usergcp_subnetwork}}", "image_name": "{{ userprefix}}-ami-ubuntu-{{ userubuntu_codename}}-{{ userubuntu_version}}-{{ usergolden_image_version}}-{{ isotime | clean_resource_name }}", "image_family": "{{ usergcp_image_family}}", "image_description": "{{ userimage_description}}", "image_labels": { "os_version": "ubuntu", "release": "{{ userubuntu_codename}}-{{ userubuntu_version}}" } }

Getting the below error while try to fetch the existing custom image which is created by packer.

==> googlecompute: Checking image does not exist...
==> googlecompute: Creating temporary RSA SSH key for instance...
==> googlecompute: Error getting source image for instance creation: Could not find image, golden-gcp-ami-ubuntu-bionic-1804-v1-0-1-2021-09-08t06-39-45z, in projects, [mist-freestyle-staging]: 1 error(s) occurred:
==> googlecompute:
==> googlecompute: * Get "https://compute.googleapis.com/compute/v1/projects/mist-freestyle-staging/global/images/golden-gcp-ami-ubuntu-bionic-1804-v1-0-1-2021-09-08t06-39-45z?alt=json&prettyPrint=false": oauth2: cannot fetch token: unexpected EOF
Build 'googlecompute' errored after 1 second 867 milliseconds: Error getting source image for instance creation: Could not find image, golden-gcp-ami-ubuntu-bionic-1804-v1-0-1-2021-09-08t06-39-45z, in projects, [mist-freestyle-staging]: 1 error(s) occurred:

==> Wait completed after 1 second 867 milliseconds
==> Some builds didn't complete successfully and had errors:
--> googlecompute: Error getting source image for instance creation: Could not find image, golden-gcp-ami-ubuntu-bionic-1804-v1-0-1-2021-09-08t06-39-45z, in projects, [mist-freestyle-staging]: 1 error(s) occurred:

==> Builds finished but no artifacts were created.

Infinite loop when a service account that doesn't exist is specified.

Overview of the Issue

When using the Google source, if a service_account is specified which does not exist, then instance creation times out. Logs make it look like it is infinitely retrying in spite of a non-retryable error state.

Reproduction Steps

Use the "googlecompute" source, with service_account set to an account that doesn't exist.

Plugin and Packer version

-> % packer version
Packer v1.7.3

Simplified Packer Buildfile

packer {
  required_plugins {
    googlecompute = {
      version = ">= 0.0.1"
      source  = "github.com/hashicorp/googlecompute"
    }
  }
}

source "googlecompute" "packer-bug-demo" {
  project_id = "..."

  image_name            = "packer-bug-demo"
  source_image_family   = "ubuntu-2004-lts"
  ssh_username          = "packer"
  zone                  = "us-west1-a"
  instance_name         = "packer-bug-demo-packerbuild"
  service_account_email = "notreal"
  machine_type          = "e2-medium"
}

build {
  sources = ["sources.googlecompute.packer-bug-demo"]
}

Operating system and Environment details

-> % uname -a
Linux swnelson-laptop 5.4.0-77-generic #86-Ubuntu SMP Thu Jun 17 02:35:03 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Log Fragments and crash.log files

2021/07/07 21:35:43 packer-plugin-googlecompute_v1.0.0_x5.0_linux_amd64 plugin: 2021/07/07 21:35:43 [INFO] Requesting Google token via GCE API Default Client Token Source...
2021/07/07 21:35:43 packer-plugin-googlecompute_v1.0.0_x5.0_linux_amd64 plugin: 2021/07/07 21:35:43 [INFO] Instantiating GCE client...
2021/07/07 21:35:43 packer-plugin-googlecompute_v1.0.0_x5.0_linux_amd64 plugin: 2021/07/07 21:35:43 [INFO] Instantiating OS Login client...
==> googlecompute.packer-bug-demo: Checking image does not exist...
==> googlecompute.packer-bug-demo: Creating temporary RSA SSH key for instance...
==> googlecompute.packer-bug-demo: Using image: ubuntu-2004-focal-v20210702
2021/07/07 21:35:48 packer-plugin-googlecompute_v1.0.0_x5.0_linux_amd64 plugin: 2021/07/07 21:35:48 [DEBUG] Adding metadata during instance creation...
==> googlecompute.packer-bug-demo: Creating instance...
    googlecompute.packer-bug-demo: Loading zone: us-west1-a
    googlecompute.packer-bug-demo: Loading machine type: e2-medium
    googlecompute.packer-bug-demo: Requesting instance creation...
    googlecompute.packer-bug-demo: Waiting for creation operation to complete...
2021/07/07 21:35:50 packer-plugin-googlecompute_v1.0.0_x5.0_linux_amd64 plugin: 2021/07/07 21:35:50 Retryable error: retrying for state DONE, got RUNNING
2021/07/07 21:35:52 packer-plugin-googlecompute_v1.0.0_x5.0_linux_amd64 plugin: 2021/07/07 21:35:52 Retryable error: retrying for state DONE, got RUNNING
2021/07/07 21:35:54 packer-plugin-googlecompute_v1.0.0_x5.0_linux_amd64 plugin: 2021/07/07 21:35:54 Retryable error: retrying for state DONE, got RUNNING
2021/07/07 21:35:57 packer-plugin-googlecompute_v1.0.0_x5.0_linux_amd64 plugin: 2021/07/07 21:35:57 Retryable error: retrying for state DONE, got RUNNING
2021/07/07 21:35:59 packer-plugin-googlecompute_v1.0.0_x5.0_linux_amd64 plugin: 2021/07/07 21:35:59 Retryable error: 1 error(s) occurred:
2021/07/07 21:35:59 packer-plugin-googlecompute_v1.0.0_x5.0_linux_amd64 plugin: 
2021/07/07 21:35:59 packer-plugin-googlecompute_v1.0.0_x5.0_linux_amd64 plugin: * The user does not have access to service account 'notreal'.  User: '[email protected]'.  Ask a project owner to grant you the iam.serviceAccountUser role on the service account
2021/07/07 21:36:01 packer-plugin-googlecompute_v1.0.0_x5.0_linux_amd64 plugin: 2021/07/07 21:36:01 Retryable error: 1 error(s) occurred:
2021/07/07 21:36:01 packer-plugin-googlecompute_v1.0.0_x5.0_linux_amd64 plugin: 
2021/07/07 21:36:01 packer-plugin-googlecompute_v1.0.0_x5.0_linux_amd64 plugin: * The user does not have access to service account 'notreal'.  User: '[email protected]'.  Ask a project owner to grant you the iam.serviceAccountUser role on the service account

Default behavior of build variable `-on-error=cleanup` is not being respected

Overview of the Issue

The documented default behavior of the -on-error variable is cleanup. That means that on failure of a packer build, the VM and disk that is created should also be deleted. However, without specifying anything for the -on-error variable in your build, a failure will keep the VM running and disk resource allocated. This leads to resource leakage in the default case, which is in conflict with the documentation:

website/content/docs/commands/build.mdx:- `-on-error=cleanup` (default), `-on-error=abort`, `-on-error=ask`, `-on-error=run-cleanup-provisioner` -

It seems the default behavior is actually abort. I am running the plugin as part of a GitHub action pipeline.

Reproduction Steps

Create a build that errors out. Any error will do that causes the build step to fail without creating any resources (i.e. see the message ==> Builds finished but no artifacts were created.)

Plugin and Packer version

Installed plugin github.com/hashicorp/googlecompute v1.0.15 in "/github/home/.config/packer/plugins/github.com/hashicorp/googlecompute/packer-plugin-googlecompute_v1.0.15_x5.0_linux_amd64"

Operating system and Environment details

My GitHub actions specify unbuntu:

Current runner version: '2.295.0'
Operating System
  Ubuntu
  20.04.4
  LTS
Runner Image
  Image: ubuntu-20.04
  Version: 20220821.1
  Included Software: https://github.com/actions/runner-images/blob/ubuntu20/20220821.1/images/linux/Ubuntu2004-Readme.md
  Image Release: https://github.com/actions/runner-images/releases/tag/ubuntu20%2F20220821.1

Log Fragments and crash.log files

Here is the log if you don't specify -on-error=cleanup:

==> aoc-gcp.googlecompute.aoc-gcp: Error: initializing source docker://nogood.redhat.io/rhel8/redis-6@sha256:d7c7852338717308cbb59e9303e1ea35cc8e5c01ceb2818569be20c15f3f943d: pinging container registry nogood.redhat.io: Get "https://nogood.redhat.io/v2/": dial tcp: lookup nogood.redhat.io on 169.254.169.254:53: no such host
==> aoc-gcp.googlecompute.aoc-gcp: Script exited with non-zero exit status: 125. Allowed exit codes are: [0]
==> aoc-gcp.googlecompute.aoc-gcp: Step "StepProvision" failed, aborting...
==> aoc-gcp.googlecompute.aoc-gcp: aborted: skipping cleanup of step "StepConnect"
==> aoc-gcp.googlecompute.aoc-gcp: aborted: skipping cleanup of step "StepStartTunnel"
==> aoc-gcp.googlecompute.aoc-gcp: aborted: skipping cleanup of step "StepInstanceInfo"
==> aoc-gcp.googlecompute.aoc-gcp: aborted: skipping cleanup of step "StepCreateWindowsPassword"
==> aoc-gcp.googlecompute.aoc-gcp: aborted: skipping cleanup of step "StepCreateInstance"
==> aoc-gcp.googlecompute.aoc-gcp: aborted: skipping cleanup of step "StepImportOSLoginSSHKey"
==> aoc-gcp.googlecompute.aoc-gcp: aborted: skipping cleanup of step "nullStep"
==> aoc-gcp.googlecompute.aoc-gcp: aborted: skipping cleanup of step "StepSSHKeyGen"
==> aoc-gcp.googlecompute.aoc-gcp: aborted: skipping cleanup of step "StepCheckExistingImage"
Build 'aoc-gcp.googlecompute.aoc-gcp' errored after 9 minutes 13 seconds: Script exited with non-zero exit status: 125. Allowed exit codes are: [0]

Here is the log if you explicitly specify -on-error=cleanup:

==> aoc-gcp.googlecompute.aoc-gcp: Error: initializing source docker://nogood.redhat.io/rhel8/redis-6@sha256:d7c7852338717308cbb59e9303e1ea35cc8e5c01ceb2818569be20c15f3f943d: pinging container registry nogood.redhat.io: Get "https://nogood.redhat.io/v2/": dial tcp: lookup nogood.redhat.io on 169.254.169.254:53: no such host
==> aoc-gcp.googlecompute.aoc-gcp: Provisioning step had errors: Running the cleanup provisioner, if present...
==> aoc-gcp.googlecompute.aoc-gcp: Deleting instance...
    aoc-gcp.googlecompute.aoc-gcp: Instance has been deleted!
==> aoc-gcp.googlecompute.aoc-gcp: Deleting disk...
    aoc-gcp.googlecompute.aoc-gcp: Disk has been deleted!
Build 'aoc-gcp.googlecompute.aoc-gcp' errored after 8 minutes 56 seconds: Script exited with non-zero exit status: 125. Allowed exit codes are: [0]

Next Release?

I'm keen to get the changes from #19 released. Is there a scheduled release due soon?

Unable to find images for community projects such as almalinux-cloud

Overview of the Issue

Newer community supported projects are no longer listed

Reproduction Steps

Steps to reproduce this issue

Plugin and Packer version

Packer 1.8.3
Google Compute v1.0.15

Simplified Packer Buildfile

packer {
  required_plugins {
    googlecompute = {
      version = ">= 0.0.1"
      source = "github.com/hashicorp/googlecompute"
    }
  }
}

source "googlecompute" "alma" {
  image_name   = "myalma"
  project_id   = "MYPROJECT"
  source_image = "almalinux-9-v20220920"
  ssh_username = "packer"
  zone         = "us-west1-a"
}

build {
  sources = ["sources.googlecompute.alma"]
}

Operating system and Environment details

happens on both mac and Linux

Log Fragments and crash.log files

* googleapi: Error 404: The resource 'projects/centos-cloud/global/images/almalinux-9-v20220920' was not fou
nd, notFound
* googleapi: Error 404: The resource 'projects/cos-cloud/global/images/almalinux-9-v20220920' was not found, notFoun

but it does not search projects/almalinux-cloud

Packer > GCE Timeout failer.

This issue was originally opened by @tallyhoJericho in hashicorp/packer#11565 and has been migrated to this repository. The original issue description is below.


When filing a bug, please include the following headings if possible. Any
example text in this template can be deleted.

Packer build timing out still after a lot of effort.

A paragraph or two about the issue you're experiencing.

Trying to create a custom image in GCP. Times out every time. Spent hours trying to find the problem. Ended up being reduced down to the simple example in the documentation. Found here: https://www.packer.io/plugins/builders/googlecompute
Still timing out. Cheers

Steps to reproduce this issue

Follow Steps on mac.
Running outside of google option. https://www.packer.io/plugins/builders/googlecompute

Packer version

1.7.10

Simplified Packer Template

packer {
    required_plugins {
        googlecompute = {
            version = "~> 1.0.0"
            source = "github.com/hashicorp/googlecompute"
        }
    }
}

source "googlecompute" "basic-example" {
    project_id = "tftesting-341109"
    source_image_family = "debian-9"
    network = "default"
    ssh_username = "packer"
    zone = "us-central1-a"
}

build {
    sources = ["sources.googlecompute.basic-example"]
}

Operating system and Environment details

Windows 11 & Mac os Monterey

GFR-Intel-HQ@GFRIntelHQ packer % packer build .
googlecompute.basic-example: output will be in this color.

==> googlecompute.basic-example: Checking image does not exist...
==> googlecompute.basic-example: Creating temporary RSA SSH key for instance...
==> googlecompute.basic-example: Using image: debian-9-stretch-v20220118
==> googlecompute.basic-example: Creating instance...
googlecompute.basic-example: Loading zone: us-central1-a
googlecompute.basic-example: Loading machine type: n1-standard-1
googlecompute.basic-example: Requesting instance creation...
googlecompute.basic-example: Waiting for creation operation to complete...
==> googlecompute.basic-example: Error creating instance: time out while waiting for instance to create
Build 'googlecompute.basic-example' errored after 5 minutes 4 seconds: Error creating instance: time out while waiting for instance to create

==> Wait completed after 5 minutes 4 seconds

==> Some builds didn't complete successfully and had errors:
--> googlecompute.basic-example: Error creating instance: time out while waiting for instance to create

==> Builds finished but no artifacts were created.

Set the env var PACKER_LOG=1 for maximum log detail.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.