打包机建设亚马逊 - chroot - 简单的例子不起作用

时间:2014-06-23 22:30:22

标签: amazon-ec2 amazon vagrant packer

我正在尝试使用Packer构建Amazon AMI centos。我正在使用亚马逊 - 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.

cat 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}}"
}]

}

1 个答案:

答案 0 :(得分:0)

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

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

Netflix的Aminator在分区卷方面存在类似问题:https://github.com/Netflix/aminator/issues/129