我正在尝试使用 Packer 构建一个 Amazon AMI centos。我正在使用 amazon-chroot 构建器。
ami 存在,但我收到构建错误
[root@ip-10-32-11-16 retel-base]# packer build retel-base.json
amazon-chroot output will be in this color.
==> amazon-chroot: Gathering information about this EC2 instance...
==> amazon-chroot: Inspecting the source AMI...
==> amazon-chroot: Couldn't find root device!
Build 'amazon-chroot' errored: Couldn't find root device!
==> Some builds didn't complete successfully and had errors:
--> amazon-chroot: Couldn't find root device!
==> Builds finished but no artifacts were created.
猫 retel-base.json
{
"variables": {
"ACCESS_KEY_ID": "{{env `ACCESS_KEY_ID`}}",
"SECRET_ACCESS_KEY": "{{env `SECRET_ACCESS_KEY`}}"
},
"builders": [{
"type": "amazon-chroot",
"access_key": "{{user `ACCESS_KEY_ID`}}",
"secret_key": "{{user `SECRET_ACCESS_KEY`}}",
"source_ami":"ami-a40df4cc",
"ami_name": "base image built with packer {{timestamp}}"
}]
}