今天与Chef,Kitchen,Vagrant和Virtual Box合作时......在尝试使用Hashicorp(https://atlas.hashicorp.com/bento/)托管的便当盒做一些厨师食谱开发/测试时遇到了一个奇怪的问题。 / p>
在制作新的食谱时,我想测试一些新版本的CentOS 7.2和Ubuntu 16.04,这些版本目前还不在我们的环境中。我转向hashicorp的便当盒将它们拉到我的.kitchen.yml配置中。
.kitchen.yml
---
driver:
name: vagrant
provisioner:
name: chef_zero
customize:
memory: 1024
platforms:
- name: ubuntu-16.04
suites:
- name: default
run_list:
- recipe[sandbox::default]
attributes:
使用 chef生成食谱来创建一个新的食谱,正如您在上面所看到的,使用非常香草的厨房配置来开始。
运行 kitchen create 时,在使用Vagrant和Virtual Box配置VM时,我一直遇到以下错误作为SSH超时。
错误:
Timed out while waiting for the machine to boot.
This means that Vagrant was unable to communicate with the guest machine
within the configured ("config.vm.boot_timeout" value) time period.
If you look above, you should be able to see the error(s) that
Vagrant had when attempting to connect to the machine. These errors
are usually good hints as to what may be wrong.
If you're using a custom box, make sure that networking is properly
working and you're able to connect to the machine. It is a common
problem that networking isn't setup properly in these boxes.
Verify that authentication configurations are also setup properly,
as well.
If the box appears to be booting properly, you may want to increase
the timeout ("config.vm.boot_timeout") value.
观察Virtual Box VM控制台时,我注意到以下内容(参见下面的屏幕截图)......
A start job is running for Raise network interfaces (2 min 39s / 5min 3s)
观察Vagrant在开始作业完成之前会超时...我试图通过在我的.kitchen.yml中将boot_timeout从默认的300秒增加到600秒来解决
然而,进一步的测试证明,即使虚拟机在5分钟3秒后成功初始化,也无法解决问题... Kitchen / Vagrant无法通过SSH连接到主机,故障和Vagrant SSH超时仍然存在。
答案 0 :(得分:2)