I’m trying to build a GCP Image with Packer registry.
Below is the windows.pkr.hcl file content which I’m using.
source "googlecompute" "windows-example" {
project_id = "MY_PROJECT"
source_image = "windows-server-2019-dc-v20200813"
zone = "us-central1-a"
disk_size = 50
machine_type = "n1-standard-2"
communicator = "winrm"
winrm_username = "packer_user"
winrm_insecure = true
winrm_use_ssl = true
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\"}"
}
}
build {
hcp_packer_registry {
bucket_name = "Images"
description = <<EOT
Packer Windows Images
EOT
labels = {
version = "0.0.2"
}
}
name = "Packer-Images"
sources = [
"sources.googlecompute.windows-example"
]
}
But I get the below error when I run packer build .\windows.pkr.hcl
(this file is under git repo for version controlling as well) as
Error: HCP Packer Registry iteration initialization failed
Failed to initialize iteration for "Images"
This iteration associated to the fingerprint 9CF21B162351427FCAD566F9C1C45 is
complete. If you wish to add a new build to this image a new iteration must be
created by changing the build fingerprint.
Please help me on over coming the issue.