0

我正在尝试使用 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}}"
}]

}

4

1 回答 1

0

我认为这可能与根设备的名称和块设备映射之间的不匹配有关。

在 CentOS 官方的 AMI 中,根设备是命名/dev/sda的,但块设备映射只列出/dev/sda1,这显然是根设备上的一个分区。

Netflix 的 Aminator 对分区卷有类似的问题:https ://github.com/Netflix/aminator/issues/129

于 2014-09-23T14:27:38.343 回答