Packer GCP Error creating instance: time out while waiting for instance to create

97 views
Skip to first unread message

prudhviraj p

unread,
Jul 2, 2022, 7:46:56 PMJul 2
to Packer

Hello Packer Community,

This is regarding a timeout issue with packer build. I was trying packer build on GCP using service account with required roles (Compute Instance admin(v1) and ServiceAccountUser) still I am seeing this issue. Please help me if you have already encountered this issue.

Thanks & regards
Prudhvi

Details:
Packer Version: 1.8.2
Googlecompute Provider: 1.0.13


Code:
packer {
required_plugins {
googlecompute = {
version = ">= 1.0.12"
}
}
}


source "googlecompute" "demo-vm-instance" {
project_id = "my project"
source_image = "centos-7-v20220621"
zone = "us-east1-b"
ssh_username = "packer"
communicator = "ssh"
}

build {
sources = ["sources.googlecompute.demo-vm-instance"]
}

Error:
==> googlecompute.autogenerated_1: Checking image does not exist...
==> googlecompute.autogenerated_1: Pausing after run of step 'StepCheckExistingImage'. Press enter to continue.
==> googlecompute.autogenerated_1: Creating temporary RSA SSH key for instance...
==> googlecompute.autogenerated_1: Pausing after run of step 'StepSSHKeyGen'. Press enter to continue.
    googlecompute.autogenerated_1: Saving key for debug purposes: gce_autogenerated_1.pem
==> googlecompute.autogenerated_1: Pausing after run of step 'StepDumpSSHKey'. Press enter to continue.
==> googlecompute.autogenerated_1: Pausing after run of step 'StepImportOSLoginSSHKey'. Press enter to continue.
==> googlecompute.autogenerated_1: Using image: debian-10-buster-v20201112
==> googlecompute.autogenerated_1: Creating instance...
    googlecompute.autogenerated_1: Loading zone: us-east1-d
    googlecompute.autogenerated_1: Loading machine type: n1-standard-2
    googlecompute.autogenerated_1: Requesting instance creation...
    googlecompute.autogenerated_1: Waiting for creation operation to complete...
==> googlecompute.autogenerated_1: Error creating instance: time out while waiting for instance to create
==> googlecompute.autogenerated_1: Pausing before cleanup of step 'StepImportOSLoginSSHKey'. Press enter to continue.
==> googlecompute.autogenerated_1: Pausing before cleanup of step 'StepDumpSSHKey'. Press enter to continue.
==> googlecompute.autogenerated_1: Pausing before cleanup of step 'StepSSHKeyGen'. Press enter to continue.
==> googlecompute.autogenerated_1: Pausing before cleanup of step 'StepCheckExistingImage'. Press enter to continue.
Build 'googlecompute.autogenerated_1' errored after 20 minutes 45 seconds: Error creating instance: time out while waiting for instance to create
Reply all
Reply to author
Forward
0 new messages