Open seongyongkim opened 8 years ago
Try running with debug logging add ing -l debug
to the kitchen command. This will spit out all the device spec info fed to vmware and also a stack trace.
Here's the output of debug.
------Exception------- Class: Kitchen::ActionFailed
Message: Failed to complete #create action: [InvalidDeviceSpec: Invalid configuration for device '0'.]
Please see .kitchen/logs/kitchen.log for more details Also try running
kitchen diagnose --all
for configuration
D ------Exception-------
D Class: Kitchen::ActionFailed
D Message: Failed to complete #create action: [InvalidDeviceSpec: Invalid configuration for device '0'.]
D ---Nested Exception---
D Class: RbVmomi::Fault
D Message: InvalidDeviceSpec: Invalid configuration for device '0'.
D ------Backtrace-------
D /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/rbvmomi-1.8.2/lib/rbvmomi/vim/Task.rb:11:in wait_for_completion' D /home/skim/.chefdk/gem/ruby/2.1.0/gems/chef-provisioning-vsphere-0.8.4/lib/chef/provisioning/vsphere_driver/driver.rb:541:in
block in clone_vm'
D /home/skim/.chefdk/gem/ruby/2.1.0/gems/chef-provisioning-vsphere-0.8.4/lib/chef/provisioning/vsphere_driver/driver.rb:524:in each' D /home/skim/.chefdk/gem/ruby/2.1.0/gems/chef-provisioning-vsphere-0.8.4/lib/chef/provisioning/vsphere_driver/driver.rb:524:in
clone_vm'
D /home/skim/.chefdk/gem/ruby/2.1.0/gems/chef-provisioning-vsphere-0.8.4/lib/chef/provisioning/vsphere_driver/driver.rb:177:in find_or_create_vm' D /home/skim/.chefdk/gem/ruby/2.1.0/gems/chef-provisioning-vsphere-0.8.4/lib/chef/provisioning/vsphere_driver/driver.rb:135:in
allocate_machine'
D /home/skim/.chefdk/gem/ruby/2.1.0/gems/chef-provisioning-vsphere-0.8.4/lib/kitchen/driver/vsphere.rb:41:in block in create' D /home/skim/.chefdk/gem/ruby/2.1.0/gems/chef-provisioning-vsphere-0.8.4/lib/kitchen/driver/vsphere.rb:73:in
call'
D /home/skim/.chefdk/gem/ruby/2.1.0/gems/chef-provisioning-vsphere-0.8.4/lib/kitchen/driver/vsphere.rb:73:in with_provisioning_driver' D /home/skim/.chefdk/gem/ruby/2.1.0/gems/chef-provisioning-vsphere-0.8.4/lib/kitchen/driver/vsphere.rb:40:in
create'
D /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.5.0/lib/kitchen/instance.rb:431:in public_send' D /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.5.0/lib/kitchen/instance.rb:431:in
block in perform_action'
D /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.5.0/lib/kitchen/instance.rb:495:in call' D /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.5.0/lib/kitchen/instance.rb:495:in
synchronize_or_call'
D /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.5.0/lib/kitchen/instance.rb:460:in block in action' D /opt/chefdk/embedded/lib/ruby/2.1.0/benchmark.rb:279:in
measure'
D /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.5.0/lib/kitchen/instance.rb:459:in action' D /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.5.0/lib/kitchen/instance.rb:431:in
perform_action'
D /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.5.0/lib/kitchen/instance.rb:359:in create_action' D /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.5.0/lib/kitchen/instance.rb:348:in
block in transition_to'
D /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.5.0/lib/kitchen/instance.rb:347:in each' D /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.5.0/lib/kitchen/instance.rb:347:in
transition_to'
D /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.5.0/lib/kitchen/instance.rb:127:in create' D /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.5.0/lib/kitchen/command.rb:176:in
public_send'
D /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.5.0/lib/kitchen/command.rb:176:in `block (2 levels) in run_action'
we'll want to see the spec details too earlier in the output.
Here's the output before the error. Redacted of course.
-----> Starting Kitchen (v1.5.0)
D Berksfile found at /home/skim/Developer/chef-repo/cookbooks/websphere/Berksfile, loading Berkshelf
D Berkshelf 4.2.1 library loaded
-----> Creating
ok. Yeah unfortunately its hard for me to say what might be the issue here. It could be that some aspect of your datastore is incompatible with the configuration the driver is setting. The driver creates this spec with the vsphere API:
RbVmomi::VIM::VirtualDeviceConfigSpec(
:operation => :add,
:fileOperation => :create,
:device => RbVmomi::VIM.VirtualDisk(
:key => vm.disks.count,
:backing => RbVmomi::VIM.VirtualDiskFlatVer2BackingInfo(
:fileName => "[#{datastore}]",
:diskMode => 'persistent',
:thinProvisioned => true
),
:capacityInKB => size_gb * 1024 * 1024,
:controllerKey => 1000,
:unitNumber => vm.disks.count
)
)
I found out what was the cause. THere's no problem with your driver. The template I was using has set its Disk on SCSI 0::1 Disk 1 instead of Disk 0. Therefore the new disk becomes Disk 0 instead becoming the 1st disk in the boot order causing the VM to fail to boot.
Thank you for your help.
Hi,
I am trying to use Test-Kitchen to provisione Redhat 7 VM on vSphere 5.5. I can provision a VM but when I try to add disk by adding the following two lines to .kitchen.yml, I get the error. I can see the VM is created in vCenter but with no additional disk. The template already has an 8GB disk already.
===== Error ====