2016-11-29 173 views
1

今天與廚師,廚房,Vagrant和Virtual Box一起工作時...當嘗試使用由Hashicorp主持的便當盒(https://atlas.hashicorp.com/bento/)做一些廚師烹飪書開發時,我遇到了一個奇怪的問題/測試。廚師測試廚房超時期間

在轉向新的烹飪書時,我想測試一些目前不在我們的環境中的新版本的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: 

使用廚師生成菜譜創建一個新的菜譜,正如你可以在上面看到,用一個非常香草廚房配置得到的東西開始。

運行時廚房創建當使用Vagrant和Virtual Box配置虛擬機時,我一直遇到以下錯誤作爲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. 

當觀察虛擬盒虛擬機控制檯,我注意到以下(參見下面的屏幕截圖)...

A start job is running for Raise network interfaces (2 min 39s/5min 3s) 

VM Console Output

覺察到流浪者會在開始工作完成之前超時...我試圖通過增加boot_timeout fr來解決om在我的.kitchen.yml中默認爲300秒到600秒

但是,進一步的測試證明,即使VM在5分鐘3秒後成功初始化,這也不能解決問題。Kitchen/Vagrant無法SSH連接到主機,並且失敗和Vagrant SSH超時仍然存在。

+0

相關的問題:https://github.com/test-kitchen/kitchen-vagrant/issues/245 – Sathya

回答

2

最終,爲了解決此問題,我將ChefDK,Vagrant和VirtualBox升級到了最新版本。

經歷的問題與...

Virtual Box 5.0.30 r112061 
Vagrant 1.8.6 
Chef Development Kit 0.19.6 

通過升級來解決該問題...

Virtual Box 5.1.10 r112026 
Vagrant 1.9.0 
Chef Development Kit Version: 1.0.3 

繼版本升級,流浪SSH超時完全消失,該框在幾秒鐘內成功創建。

虛擬盒虛擬機控制檯

enter image description here

相關問題