0

我正在使用打包程序从现有的 OVA 创建一个新的 OVA。为此,我需要在之前的 OVA 中安装补丁并运行一些清理脚本。我的补丁安装需要重启实例,它确实如此,但是,我无法在重启后建立与实例的连接。

我试过用参数

"expect_disconnect": "true", -- for the patch installation script, which reboots machine after successful installation
"start_retry_timeout":"30s",
"pause_before": "10m"--- for cleanup scripts after patch installation.

但是,我收到此错误

2021/09/08 11:18:54 packer-builder-virtualbox-ovf plugin: [ERROR] Remote command exited without exit status or exit signal.
2021/09/08 11:18:54 packer-builder-virtualbox-ovf plugin: [INFO] RPC endpoint: Communicator ended with: 2300218
2021/09/08 11:18:54 [INFO] 0 bytes written for 'stdout'
2021/09/08 11:18:54 [INFO] 233 bytes written for 'stderr'
2021/09/08 11:18:54 [INFO] RPC client: Communicator ended with: 2300218
2021/09/08 11:18:54 [INFO] RPC endpoint: Communicator ended with: 2300218
2021/09/08 11:18:54 packer-provisioner-shell plugin: [INFO] 0 bytes written for 'stdout'
2021/09/08 11:18:54 packer-provisioner-shell plugin: [INFO] 233 bytes written for 'stderr'
2021/09/08 11:18:54 packer-provisioner-shell plugin: [INFO] RPC client: Communicator ended with: 2300218
2021/09/08 11:18:54 packer-builder-virtualbox-ovf plugin: [DEBUG] Opening new ssh session
2021/09/08 11:18:54 packer-builder-virtualbox-ovf plugin: [ERROR] ssh session open error: 'EOF', attempting reconnect
2021/09/08 11:18:54 packer-builder-virtualbox-ovf plugin: [DEBUG] reconnecting to TCP connection for SSH
2021/09/08 11:18:54 packer-builder-virtualbox-ovf plugin: [DEBUG] handshaking with SSH
2021/09/08 11:18:54 packer-provisioner-shell plugin: Retryable error: Error removing temporary script at /tmp/script_6486.sh: ssh: handshake failed: read tcp 127.0.0.1:60824->127.0.0.1:2472: read: connection reset by peer
2021/09/08 11:18:56 packer-builder-virtualbox-ovf plugin: [DEBUG] Opening new ssh session
2021/09/08 11:18:56 packer-builder-virtualbox-ovf plugin: [ERROR] ssh session open error: 'client not available', attempting reconnect
2021/09/08 11:18:56 packer-builder-virtualbox-ovf plugin: [DEBUG] reconnecting to TCP connection for SSH
2021/09/08 11:18:56 packer-builder-virtualbox-ovf plugin: [DEBUG] handshaking with SSH
2021/09/08 11:18:56 packer-provisioner-shell plugin: Retryable error: Error removing temporary script at /tmp/script_6486.sh: ssh: handshake failed: read tcp 127.0.0.1:60826->127.0.0.1:2472: read: connection reset by peer
2021/09/08 11:18:58 packer-builder-virtualbox-ovf plugin: [DEBUG] Opening new ssh session
2021/09/08 11:18:58 packer-builder-virtualbox-ovf plugin: [ERROR] ssh session open error: 'client not available', attempting reconnect
2021/09/08 11:18:58 packer-builder-virtualbox-ovf plugin: [DEBUG] reconnecting to TCP connection for SSH
2021/09/08 11:18:58 packer-builder-virtualbox-ovf plugin: [DEBUG] handshaking with SSH
--> virtualbox-ovf: Error removing temporary script at /tmp/script_3037.sh: Timeout during SSH handshake
4

0 回答 0