Continuous integration 封隔器赢得';t在GCloud上创建图像
我一直在使用HashiCorp(Packer和Terraform)的工具创建图像,然后在AWS上使用Jenkins构建VM。现在我有一个在GCloud上的项目,我已经成功地配置了Terraform来创建VM,但是当我尝试运行packer时,我得到了以下错误 root@packer打包器]#打包器构建createImage.jsonContinuous integration 封隔器赢得';t在GCloud上创建图像,continuous-integration,devops,gcloud,packer,Continuous Integration,Devops,Gcloud,Packer,我一直在使用HashiCorp(Packer和Terraform)的工具创建图像,然后在AWS上使用Jenkins构建VM。现在我有一个在GCloud上的项目,我已经成功地配置了Terraform来创建VM,但是当我尝试运行packer时,我得到了以下错误 root@packer打包器]#打包器构建createImage.json googlecompute output will be in this color. ==> googlecompute: Checking image d
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.
我应该提到,我正在使用的服务帐户甚至被授予所有者权限,以确保我没有权限问题。
有人知道为什么我在AWS上遇到这个问题吗?它工作得很好。由于您没有使用“account\u file”
来,我假设您正在从GCP中的VM实例运行packer,也就是说,这样的服务帐户是具有所有者
角色的帐户
我将首先检查服务帐户是否在VM详细信息中正确配置,以及是否按照以下所述定义了服务帐户:
- 计算引擎的“读写”
- “满”表示“存储”
f1 micro
或g1 small
机器类型构建图像
最后,我建议将此问题也发布在中或任何其他中。因为您没有使用的“account\u file”
到,我假设您正在从GCP中的VM实例运行packer,也就是说,这样的服务帐户是具有所有者
角色的帐户
我将首先检查服务帐户是否在VM详细信息中正确配置,以及是否按照以下所述定义了服务帐户:
- 计算引擎的“读写”
- “满”表示“存储”
f1 micro
或g1 small
机器类型构建图像
最后,我建议将这个问题也发布在或任何其他的中。最终解决了它。我使用的是旧版本的packer,因此出现了所有问题。更新后的打包机现在工作得很好,最终解决了它。我使用的是旧版本的packer,因此出现了所有问题。更新后的封隔器现在工作得很好
{
"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"
}
]
}