【问题标题】:packer building amazon-chroot - simple example does not work打包机构建 amazon-chroot - 简单示例不起作用
【发布时间】:2014-06-23 22:30:22
【问题描述】:

我正在尝试使用 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.

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

}

【问题讨论】:

    标签: amazon-ec2 amazon vagrant packer


    【解决方案1】:

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

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

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

    【讨论】:

    • 好的,我在这里做错了吗?我可以再试一次。
    • 在当前状态下,该 AMI 与 Packer 不兼容。我不知道如何将其转换为一个。您可以尝试不同的,例如aws.amazon.com/marketplace/pp/B00JV9JBDS
    猜你喜欢
    • 1970-01-01
    • 2012-07-01
    • 2015-11-23
    • 2016-03-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多