Я использовал инструменты от HashiCorp (Packer и Terraform) для создания образов, а затем для создания виртуальных машин с использованием Jenkins на AWS. Теперь у меня есть проект, который находится на GCloud, и я успешно настроил Terraform для создания виртуальной машины, но при попытке запустить упаковщик я получаю следующую ошибку root@packer packer] # builder buildImage. json
googlecompute output will be in this color.
==> googlecompute: Checking image does not exist...
==> googlecompute: Creating temporary SSH key for instance...
==> googlecompute: Error getting source image for instance creation: Could not find image, centos-7, in projects, [<PROJECT_ID> centos-cloud coreos-cloud debian-cloud google-containers opensuse-cloud rhel-cloud suse-cloud ubuntu-os-cloud windows-cloud gce-nvme]: 11 error(s) occurred:
==> googlecompute:
==> googlecompute: * googleapi: got HTTP response code 400 with body:
==> googlecompute: * googleapi: got HTTP response code 400 with body:
==> googlecompute: * googleapi: got HTTP response code 400 with body:
==> googlecompute: * googleapi: got HTTP response code 400 with body:
==> googlecompute: * googleapi: got HTTP response code 400 with body:
==> googlecompute: * googleapi: got HTTP response code 400 with body:
==> googlecompute: * googleapi: got HTTP response code 400 with body:
==> googlecompute: * googleapi: got HTTP response code 400 with body:
==> googlecompute: * googleapi: got HTTP response code 400 with body:
==> googlecompute: * googleapi: got HTTP response code 400 with body:
==> googlecompute: * googleapi: got HTTP response code 400 with body:
Build 'googlecompute' errored: Error getting source image for instance creation: Could not find image, centos-7, in projects, [PROJECT_ID centos-cloud coreos-cloud debian-cloud google-containers opensuse-cloud rhel-cloud suse-cloud ubuntu-os-cloud windows-cloud gce-nvme]: 11 error(s) occurred:
* googleapi: got HTTP response code 400 with body:
* googleapi: got HTTP response code 400 with body:
* googleapi: got HTTP response code 400 with body:
* googleapi: got HTTP response code 400 with body:
* googleapi: got HTTP response code 400 with body:
* googleapi: got HTTP response code 400 with body:
* googleapi: got HTTP response code 400 with body:
* googleapi: got HTTP response code 400 with body:
* googleapi: got HTTP response code 400 with body:
* googleapi: got HTTP response code 400 with body:
* googleapi: got HTTP response code 400 with body:
==> Some builds didn't complete successfully and had errors:
--> googlecompute: Error getting source image for instance creation: Could not find image, centos-7, in projects, [PROJECT_ID centos-cloud coreos-cloud debian-cloud google-containers opensuse-cloud rhel-cloud suse-cloud ubuntu-os-cloud windows-cloud gce-nvme]: 11 error(s) occurred:
* googleapi: got HTTP response code 400 with body:
* googleapi: got HTTP response code 400 with body:
* googleapi: got HTTP response code 400 with body:
* googleapi: got HTTP response code 400 with body:
* googleapi: got HTTP response code 400 with body:
* googleapi: got HTTP response code 400 with body:
* googleapi: got HTTP response code 400 with body:
* googleapi: got HTTP response code 400 with body:
* googleapi: got HTTP response code 400 with body:
* googleapi: got HTTP response code 400 with body:
* googleapi: got HTTP response code 400 with body:
==> Builds finished but no artifacts were created.
Это мой createImage. json
{
"variables": {
"project_id": "PROJECT_ID"
},
"builders": [
{
"type": "googlecompute",
"region": "europe-west1",
"zone": "europe-west1-b",
"project_id": "{{user `project_id`}}",
"source_image_family": "centos-7",
"image_name": "My-Test-Image",
"disk_size": 10,
"machine_type": "f1-micro",
"ssh_username": "centos"
}
]
}
Я должен отметить, что используемой учетной записи службы даже дано разрешение владельца, чтобы быть уверенным, что у меня нет проблем с разрешениями. Кто-нибудь знает, почему у меня есть эта проблема, в то время как на AWS она прекрасно работает.