-
Notifications
You must be signed in to change notification settings - Fork 25
Description
When I have configured provisioning of hosts for all machines in config file before listing machines, vagrant provisioning freezes on hosts provisioning step. Simplified Vagrant config (actually not able to reproduce my problem):
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "vagrant-centos-65-x86_64-minimal"
config.vm.box_url = "http://files.brianbirkinbine.com/vagrant-centos-65-x86_64-minimal.box"
if Vagrant.has_plugin?("vagrant-cachier")
config.cache.scope = :box
end
config.vm.provider "virtualbox" do |v|
v.memory = 1024
v.cpus = 1
end
# provision host name resolutions between vistual machines. uses plugin https://github.com/oscar-stack/vagrant-hosts
if Vagrant.has_plugin?("vagrant-hosts")
config.vm.provision :hosts do |hostsprovisioner|
hostsprovisioner.autoconfigure = true
hostsprovisioner.sync_hosts = true
end
else
config.vm.provision "shell", inline: "echo vagrant-hosts plugin is missing, hostname resolution of other virtual machines will not work."
end
# list of different machines starts here:
config.vm.define "machine1", primary: true do |cfg|
cfg.vm.hostname = "machine1"
cfg.vm.network "private_network", ip: "192.168.101.10"
end
config.vm.define "machine2", autostart: false do |cfg|
cfg.vm.hostname = "machine2"
cfg.vm.network "private_network", ip: "192.168.101.11"
end
end
Running vagrant up with debug points to not ending some ssh connection:
vagrant up --debug --provision vagrant-backend-lbamqp
.... normal startup and provisioning ....
GuestOSType="Linux26_64"
GuestAdditionsRunLevel=2
GuestAdditionsVersion="4.3.4 r91027"
GuestAdditionsFacility_VirtualBox Base Driver=50,1464966035858
GuestAdditionsFacility_VirtualBox System Service=50,1464966048788
GuestAdditionsFacility_Seamless Mode=0,1464966035858
GuestAdditionsFacility_Graphics Mode=0,1464966035858
DEBUG subprocess: Waiting for process to exit. Remaining to timeout: 31999
DEBUG subprocess: Exit status: 0
INFO interface: Machine: metadata ["provider", :virtualbox, {:target=>:"vagrant-backend"}]
DEBUG ssh: Uploading: /tmp/tmp-hosts20160603-29916-1fntcy7 to /tmp/hosts
DEBUG ssh: Re-using SSH connection.
DEBUG ssh: Re-using SSH connection.
INFO ssh: Execute: cat /tmp/hosts > /etc/hosts (sudo=true)
DEBUG ssh: pty obtained for connection
DEBUG ssh: stdout: [root@vagrant-backend-lbamqp ~]#
DEBUG ssh: Sending SSH keep-alive...
DEBUG ssh: Sending SSH keep-alive...
DEBUG ssh: Sending SSH keep-alive...
DEBUG ssh: Sending SSH keep-alive...
DEBUG ssh: Sending SSH keep-alive...
DEBUG ssh: Sending SSH keep-alive...
DEBUG ssh: Sending SSH keep-alive...
DEBUG ssh: Sending SSH keep-alive...
DEBUG ssh: Sending SSH keep-alive...
DEBUG ssh: Sending SSH keep-alive...
DEBUG ssh: Sending SSH keep-alive...
Given simplified version of script does not stuck, like my original vagrant file (I have provisioning of salt stack there and a few minor things). First time it started to stuck while going up after addition of hosts. Now I am not able to simulate it with simplified environment, but on other side, I am not able to get rid of provision freezing on my work vagrant file. I have also tried to delete .vagrant directory (there was some older machine names which are not used now) and also I have tried to delete ~/.vagrant.d/data dir. Nothing have helped.
I hope that debug log will be enough to fix this problem. If no, please instruct me how to provide more help.