I'm using vagrant with the virtualbox driver in a CI environment
(jenkins + test-kitchen). I'm running into problems with spooky errors
when multiple jobs are running at the same time (and there are thus
concurrent vagrant commands running). For example with running 4 jobs
at a time, about 6% of jobs will fail with a transient error (it is
unlikely to occur for the same job if only that job is run again in
isolation). I *think* based on the logs it is a problem with vagrant
or virtualbox, but it could be induced by one of the many other moving
pieces.
Specifically what I am seeing is:
* Test kitchen runs: vagrant up --no-provision --provider virtualbox
* At some point during that vagrant calls VBoxManage showvminfo UUID
* This fails:
STDERR: There was an error while executing `VBoxManage`, a CLI used by
Vagrant for controlling VirtualBox. The command and stderr is shown below.
Command: ["showvminfo", "e622fd71-8aa1-409f-90e0-4df89891454f",
"--machinereadable"]
Stderr: VBoxManage: error: Could not find a registered machine with UUID
{e622fd71-8aa1-409f-90e0-4df89891454f}
VBoxManage: error: Details: code VBOX_E_OBJECT_NOT_FOUND (0x80bb0001),
component VirtualBox, interface IVirtualBox, callee nsISupports
VBoxManage: error: Context: "FindMachine(Bstr(VMNameOrUuid).raw(),
machine.asOutParam())" at line 2611 of file VBoxManageInfo.cpp
When inspecting ~/VirtualBox\ VMs I find a .vbox, .vbox-prev, & .vmdk
file, but no Logs directory. Without the logs I'm unsure where to look
further.
One possible oddity is that the UUID in stdout is
e622fd71-8aa1-409f-90e0-4df89891454f (not in `vms list`) but
.kitchen/kitchen-vagrant/foo-default-centos-66/.vagrant/machines/default/virtualbox/id
has 07b9e760-1fc2-44ac-b70a-fca527111b10 which *is* in `vms list`.
Since I think the problem occurs during a single vagrant provision
command I'm unsure what to make of that.
Versions:
* centos: 2.6.32-504.23.4.el6.x86_64
* test-kitchen: 1.4.0
* vagrant: 1.7.2
* vitualbox: 4.3.28r100309
Example Vagrantfile:
Vagrant.configure("2") do |c|
c.berkshelf.enabled = false if Vagrant.has_plugin?("vagrant-berkshelf")
c.vm.box = "internal-centos-6.6-base"
c.vm.box_url = "
http://example.com.foo.box"
c.vm.hostname = "default-centos-66"
c.vm.synced_folder ".", "/vagrant", disabled: true
c.vm.provider :virtualbox do |p|
p.customize ["modifyvm", :id, "--memory", "512"]
p.customize ["modifyvm", :id, "--cpus", "1"]
end
end
Log snippet:
+ chef exec 'kitchen test --destroy=always'
-----> Starting Kitchen (v1.4.0)
-----> Cleaning up any prior instances of <default-centos-66>
-----> Destroying <default-centos-66>...
Finished destroying <default-centos-66> (0m0.00s).
-----> Testing <default-centos-66>
-----> Creating <default-centos-66>...
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'addthis-centos-6.6-iad-base-v1'...
Progress: 10%
Progress: 20%
Progress: 30%
Progress: 40%
Progress: 50%
Progress: 60%
Progress: 70%
Progress: 90%
==> default: Matching MAC address for NAT networking...
==> default: Setting the name of the VM:
kitchen-addthis-hastebin-default-centos-66_default_1436302236546_22072
There was an error while executing `VBoxManage`, a CLI used by
Vagrant
for controlling VirtualBox. The command and stderr is shown below.
Command: ["showvminfo", "e622fd71-8aa1-409f-90e0-4df89891454f",
"--machinereadable"]
Stderr: VBoxManage: error: Could not find a registered machine
with UUID {e622fd71-8aa1-409f-90e0-4df89891454f}
VBoxManage: error: Details: code VBOX_E_OBJECT_NOT_FOUND
(0x80bb0001), component VirtualBox, interface IVirtualBox, callee
nsISupports
VBoxManage: error: Context:
"FindMachine(Bstr(VMNameOrUuid).raw(), machine.asOutParam())" at line
2611 of file VBoxManageInfo.cpp