我正在创建一个带有一些用户数据和 ebs 的自定义 ami(创建 lvm 分区)。Packer 构建步骤包括:
- 旋转一个新实例
- 百胜更新
- 用户数据安装
- 附加 ebs & create lvm , lv...- /tmp 也被重构
- 重启
- 从中创建ami。
它在重新启动步骤失败:
2021/11/18 19:51:42 packer-builder-amazon-ebs plugin: [DEBUG] scp: Uploading script_345.sh: perms=C0644 size=25
2021/11/18 19:51:42 packer-builder-amazon-ebs plugin: [DEBUG] SCP session complete, closing stdin pipe.
2021/11/18 19:51:42 packer-builder-amazon-ebs plugin: [DEBUG] Waiting for SSH session to complete.
2021/11/18 19:51:42 packer-builder-amazon-ebs plugin: [DEBUG] scp stderr (length 29): Sink: C0644 25 script_345.sh
2021/11/18 19:51:42 packer-builder-amazon-ebs plugin: [DEBUG] Opening new ssh session
2021/11/18 19:51:42 packer-builder-amazon-ebs plugin: [DEBUG] starting remote command: chmod 0755 /tmp/script_345.sh
2021/11/18 19:51:43 packer-builder-amazon-ebs plugin: [INFO] RPC endpoint: Communicator ended with: 0
2021/11/18 19:51:43 [INFO] RPC client: Communicator ended with: 0
2021/11/18 19:51:43 [INFO] RPC endpoint: Communicator ended with: 0
2021/11/18 19:51:43 packer-provisioner-shell plugin: [INFO] RPC client: Communicator ended with: 0
2021/11/18 19:51:43 packer-builder-amazon-ebs plugin: [DEBUG] Opening new ssh session
2021/11/18 19:51:43 packer-builder-amazon-ebs plugin: [DEBUG] starting remote command: chmod +x /tmp/script_345.sh; PACKER_BUILDER_TYPE='amazon-ebs' PACKER_BUILD_NAME='base_ami' /tmp/script_345.sh
2021/11/18 07:19:18 packer-builder-amazon-ebs plugin: [DEBUG] starting remote command: chmod +x /tmp/script_4394.sh; PACKER_BUILDER_TYPE='amazon-ebs' PACKER_BUILD_NAME='base_ami' /tmp/script_4394.sh
==> amazon-ebs.base_ami: + sudo /usr/sbin/reboot
2021/11/18 07:19:19 packer-builder-amazon-ebs plugin: [ERROR] Remote command exited with '143': chmod +x /tmp/script_4394.sh; PACKER_BUILDER_TYPE='amazon-ebs' PACKER_BUILD_NAME='base_ami' /tmp/script_4394.sh
2021/11/18 07:19:19 packer-builder-amazon-ebs plugin: [INFO] RPC endpoint: Communicator ended with: 143
使用交互模式检查时,重新启动命令成功执行。需要帮助如何进一步调试 /resolve。