vagrant-vsphere
vagrant-vsphere copied to clipboard
parallel startup mode broken
I have a number of mixed windows and linux boxes that I tried bringing up (only two of each so nothing too heavy). One time I ended out with errors about sudo not being found on my Windows boxes (from part of the provisioning scripts). Another time I got errors installing the new ssh keys on a box that didn't support it. Basically it looks like somewhere the concurrently accessed hosts are getting mixed up.
Starting them with the --no-parallel consistently resolved the issue.
I'm fine with the option to use the parallel startup being supported, but I really wish that the change to make it the default could be rolled back.
+1 to this. I have been advocating for the default parallel change to be rolled back ever since it was added. It has never worked.
@ggascoigne Can you include a Vagrantfile, and the full output from Vagrant? There really isn't enough information here to investigate.
Sorry for the slow reply, getting a suitable test was tricky.
First, this doesn't break every time, and second it doesn't always break the same way when it does break.
The keys to make things break (for me) is to mix linux and windows vms. At some point this seems to cause a mix up about which OS is which. I've seen linux boxes unable to detect their OS, and linux boxes failing to respond to winrm commands.
Vagrantfile
Vagrant.require_version '>= 1.5.0'
Vagrant.configure(2) do |config|
config.berkshelf.enabled = true
unless Vagrant.has_plugin?("vagrant-omnibus")
raise "This Vagrantfile requires the vagrant-omnibus plugin"
end
config.omnibus.chef_version = 'latest'
config.vm.provider :vsphere do |vsphere, override|
# vsphere configuration
config.nfs.functional = false
user_name = "#{ENV['VSPHERE_USER']}"
vsphere.user = user_name
vsphere.password = ENV['VSPHERE_PASSWORD']
vsphere.host = XXX'
vsphere.compute_resource_name = 'VAGRANT'
vsphere.data_center_name = 'VAGRANT_DC'
vsphere.vlan = 'VLAN333'
vsphere.insecure = true
# all VMs reside under VAGRANT/Vagrant/<user_name>
short_name=user_name.sub(/@.*|.*\\/, '')
vsphere.vm_base_path = "Vagrant/#{short_name}"
vsphere.custom_attribute('vagrant.user', user_name)
#VM defaults
override.vm.network 'private_network', type: "dhcp"
override.vm.box = 'vsphere-perf'
override.vm.box_url = '.../vsphere-perf-cloud-2.0.box'
vsphere.memory_mb = 2048
vsphere.template_name = 'Templates/vagrant-centos-6.5-x86-64a'
end
(1..3).each do |i|
config.vm.define "windows-node-#{i}" do |node|
node.vm.box = "tw-win7-64-ssh"
config.vm.provider :vsphere do |vsphere, override|
vsphere.template_name = 'Templates/tw-win7-64-ssh'
node.vm.communicator = :winrm
node.vm.guest = :windows
end
end
config.vm.define "linux-node-#{i}" do |node|
node.vm.box = "box-cutter/centos71"
end
end
end
Berksfile
source "https://supermarket.chef.io"
It fails more consistently if the windows VMs come up before the Linux ones, i.e. if I reorder the Vagrantfile so that the linux ones are first then this fails less often.
error log
$ vagrant up --provider=vsphere
Bringing machine 'windows-node-1' up with 'vsphere' provider...
Bringing machine 'linux-node-1' up with 'vsphere' provider...
Bringing machine 'windows-node-2' up with 'vsphere' provider...
Bringing machine 'linux-node-2' up with 'vsphere' provider...
Bringing machine 'windows-node-3' up with 'vsphere' provider...
Bringing machine 'linux-node-3' up with 'vsphere' provider...
linux-node-3: The Berkshelf shelf is at "/Users/ggp/.berkshelf/vagrant-berkshelf/shelves/berkshelf20160303-81813-1cwi2av-linux-node-3"
windows-node-3: The Berkshelf shelf is at "/Users/ggp/.berkshelf/vagrant-berkshelf/shelves/berkshelf20160303-81813-1caiiim-windows-node-3"
linux-node-2: The Berkshelf shelf is at "/Users/ggp/.berkshelf/vagrant-berkshelf/shelves/berkshelf20160303-81813-16rmkqi-linux-node-2"
windows-node-2: The Berkshelf shelf is at "/Users/ggp/.berkshelf/vagrant-berkshelf/shelves/berkshelf20160303-81813-i8a4c7-windows-node-2"
linux-node-1: The Berkshelf shelf is at "/Users/ggp/.berkshelf/vagrant-berkshelf/shelves/berkshelf20160303-81813-1kggprw-linux-node-1"
windows-node-1: The Berkshelf shelf is at "/Users/ggp/.berkshelf/vagrant-berkshelf/shelves/berkshelf20160303-81813-1s1el31-windows-node-1"
==> windows-node-3: Calling vSphere CloneVM with the following settings:
==> windows-node-3: -- Template VM: VAGRANT/vm/Templates/tw-win7-64-ssh
==> windows-node-3: -- Target VM: VAGRANT/vm/Vagrant/ggp/vm_test_windows-node-3_1457045788999_34236
==> linux-node-2: Calling vSphere CloneVM with the following settings:
==> linux-node-2: -- Template VM: VAGRANT/vm/Templates/tw-win7-64-ssh
==> linux-node-3: Calling vSphere CloneVM with the following settings:
==> linux-node-2: -- Target VM: VAGRANT/vm/Vagrant/ggp/vm_test_linux-node-2_1457045789140_51996
==> linux-node-3: -- Template VM: VAGRANT/vm/Templates/tw-win7-64-ssh
==> linux-node-3: -- Target VM: VAGRANT/vm/Vagrant/ggp/vm_test_linux-node-3_1457045789149_21477
==> windows-node-2: Calling vSphere CloneVM with the following settings:
==> windows-node-1: Calling vSphere CloneVM with the following settings:
==> windows-node-2: -- Template VM: VAGRANT/vm/Templates/tw-win7-64-ssh
==> linux-node-1: Calling vSphere CloneVM with the following settings:
==> windows-node-2: -- Target VM: VAGRANT/vm/Vagrant/ggp/vm_test_windows-node-2_1457045789367_36627
==> windows-node-1: -- Template VM: VAGRANT/vm/Templates/tw-win7-64-ssh
==> linux-node-1: -- Template VM: VAGRANT/vm/Templates/tw-win7-64-ssh
==> windows-node-1: -- Target VM: VAGRANT/vm/Vagrant/ggp/vm_test_windows-node-1_1457045789385_32240
==> linux-node-1: -- Target VM: VAGRANT/vm/Vagrant/ggp/vm_test_linux-node-1_1457045789401_79857
==> windows-node-3: New virtual machine successfully cloned
==> windows-node-1: New virtual machine successfully cloned
==> windows-node-1: Waiting for machine to boot. This may take a few minutes...
==> windows-node-3: Waiting for machine to boot. This may take a few minutes...
==> linux-node-1: New virtual machine successfully cloned
==> windows-node-2: New virtual machine successfully cloned
==> linux-node-1: Waiting for machine to boot. This may take a few minutes...
==> windows-node-2: Waiting for machine to boot. This may take a few minutes...
==> linux-node-2: New virtual machine successfully cloned
==> linux-node-3: New virtual machine successfully cloned
==> linux-node-2: Waiting for machine to boot. This may take a few minutes...
==> linux-node-3: Waiting for machine to boot. This may take a few minutes...
windows-node-3: WinRM address: 10.248.93.83:5985
windows-node-3: WinRM username: vagrant
windows-node-3: WinRM execution_time_limit: PT2H
windows-node-3: WinRM transport: plaintext
windows-node-1: WinRM address: 10.248.93.84:5985
windows-node-1: WinRM username: vagrant
windows-node-1: WinRM execution_time_limit: PT2H
windows-node-1: WinRM transport: plaintext
linux-node-1: SSH address: 10.248.93.82:22
linux-node-1: SSH username: vagrant
linux-node-1: SSH auth method: private key
windows-node-2: WinRM address: 10.248.93.85:5985
windows-node-2: WinRM username: vagrant
windows-node-2: WinRM execution_time_limit: PT2H
windows-node-2: WinRM transport: plaintext
linux-node-1:
linux-node-1: Vagrant insecure key detected. Vagrant will automatically replace
linux-node-1: this with a newly generated keypair for better security.
linux-node-3: SSH address: 10.248.93.87:22
linux-node-3: SSH username: vagrant
linux-node-3: SSH auth method: private key
linux-node-2: SSH address: 10.248.93.86:22
linux-node-2: SSH username: vagrant
linux-node-2: SSH auth method: private key
linux-node-3:
linux-node-3: Vagrant insecure key detected. Vagrant will automatically replace
linux-node-3: this with a newly generated keypair for better security.
linux-node-2:
linux-node-2: Vagrant insecure key detected. Vagrant will automatically replace
linux-node-2: this with a newly generated keypair for better security.
==> windows-node-1: Machine booted and ready!
==> windows-node-1: Updating Vagrant's Berkshelf...
==> windows-node-3: Machine booted and ready!
==> windows-node-3: Updating Vagrant's Berkshelf...
==> windows-node-3: Resolving cookbook dependencies...
==> windows-node-1: Resolving cookbook dependencies...
==> linux-node-1: Machine booted and ready!
==> linux-node-1: Updating Vagrant's Berkshelf...
==> linux-node-1: Resolving cookbook dependencies...
==> windows-node-3: Rsyncing folder: /Users/ggp/dev/tw-git/pugbat/vm_test/ => /vagrant
==> windows-node-1: Rsyncing folder: /Users/ggp/dev/tw-git/pugbat/vm_test/ => /vagrant
==> windows-node-2: Machine booted and ready!
==> windows-node-2: Updating Vagrant's Berkshelf...
==> linux-node-3: Machine booted and ready!
==> linux-node-3: Updating Vagrant's Berkshelf...
==> windows-node-2: Resolving cookbook dependencies...
==> linux-node-2: Machine booted and ready!
==> linux-node-2: Updating Vagrant's Berkshelf...
==> linux-node-3: Resolving cookbook dependencies...
==> linux-node-2: Resolving cookbook dependencies...
==> windows-node-2: Rsyncing folder: /Users/ggp/dev/tw-git/pugbat/vm_test/ => /vagrant
==> linux-node-1: An error occurred. The error will be shown after all tasks complete.
==> linux-node-3: An error occurred. The error will be shown after all tasks complete.
==> linux-node-2: An error occurred. The error will be shown after all tasks complete.
==> windows-node-3: Installing Chef 12.7.2 Omnibus package...
==> windows-node-3: Downloading Chef 12.7.2 for Windows...
==> windows-node-1: Installing Chef 12.7.2 Omnibus package...
==> windows-node-1: Downloading Chef 12.7.2 for Windows...
==> windows-node-2: Installing Chef 12.7.2 Omnibus package...
==> windows-node-2: Downloading Chef 12.7.2 for Windows...
==> windows-node-1: Installing Chef 12.7.2
==> windows-node-3: Installing Chef 12.7.2
==> windows-node-2: Installing Chef 12.7.2
An error occurred while executing multiple actions in parallel.
Any errors that occurred are shown below.
An error occurred while executing the action on the 'linux-node-1'
machine. Please handle this error then try again:
The guest operating system of the machine could not be detected!
Vagrant requires this knowledge to perform specific tasks such
as mounting shared folders and configuring networks. Please add
the ability to detect this guest operating system to Vagrant
by creating a plugin or reporting a bug.
An error occurred while executing the action on the 'linux-node-2'
machine. Please handle this error then try again:
The guest operating system of the machine could not be detected!
Vagrant requires this knowledge to perform specific tasks such
as mounting shared folders and configuring networks. Please add
the ability to detect this guest operating system to Vagrant
by creating a plugin or reporting a bug.
An error occurred while executing the action on the 'linux-node-3'
machine. Please handle this error then try again:
The guest operating system of the machine could not be detected!
Vagrant requires this knowledge to perform specific tasks such
as mounting shared folders and configuring networks. Please add
the ability to detect this guest operating system to Vagrant
by creating a plugin or reporting a bug.
Hope that this helps.
Have a look at #210