Issues getting Test-Kitchen to work with Hyper-v on windows 10

#1

Hello,

I am trying to use test kitchen to test my cookbooks. I am using hyper-v and I continue to receive this error. I have searched the internet to death and I have been unable to find a solution to this. What can I do to resolve this?

------Exception-------
Class: Kitchen::ActionFailed
Message: 1 actions failed.
Failed to complete #create action: [undefined method `' for nil:NilClass] on default-windows-2012R2

Please see .kitchen/logs/kitchen.log for more details
Also try running kitchen diagnose --all for configuration

Kitchen.yml:
driver:
name: hyperv
parent_vhd_folder: C:\Hyper-V
parent_vhd_name: WindowsServer2012R2.vhdx
vm_switch: ExternalSwitch
memory_startup_bytes: 2GB

provisioner:
name: chef_zero

verifier:
name: inspec

transport:
name: winrm
elevated: true
username: Administrator
password: Kitchen1

platforms:

  • name: windows-2012R2
    driver:
    customize:
    memory: 2048

suites:

  • name: default
    run_list:
    • recipe[cpy_patching::default]
      verifier:
      inspec_tests:
      • test/smoke/default
        attributes:

Below is the full output retrieved with "kitchen create -l debug":

------Exception-------
Class: Kitchen::ActionFailed
Message: 1 actions failed.
Failed to complete #create action: [undefined method `' for nil:NilClass] on default-windows-2012R2

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: 1 actions failed.

Failed to complete #create action: [undefined method `[]' for nil:NilClass] on default-windows-2012R2

D ----------------------
D ------Backtrace-------
D C:/opscode/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/command.rb:183:in report_errors' D C:/opscode/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/command.rb:174:inrun_action'
D C:/opscode/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/command/action.rb:36:in block in call' D C:/opscode/chefdk/embedded/lib/ruby/2.5.0/benchmark.rb:293:inmeasure'
D C:/opscode/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/command/action.rb:34:in call' D C:/opscode/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/cli.rb:52:inperform'
D C:/opscode/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/cli.rb:193:in block (2 levels) in <class:CLI>' D C:/opscode/chefdk/embedded/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor/command.rb:27:inrun'
D C:/opscode/chefdk/embedded/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in invoke_command' D C:/opscode/chefdk/embedded/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor.rb:387:indispatch'
D C:/opscode/chefdk/embedded/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor/base.rb:466:in start' D C:/opscode/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/bin/kitchen:13:inblock in <top (required)>'
D C:/opscode/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/errors.rb:171:in with_friendly_errors' D C:/opscode/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/bin/kitchen:13:in<top (required)>'
D C:/opscode/chefdk/bin/kitchen:311:in load' D C:/opscode/chefdk/bin/kitchen:311:in'
D ----End Backtrace-----
D -Composite Exception--
D Class: Kitchen::ActionFailed
D Message: Failed to complete #create action: [undefined method []' for nil:NilClass] on default-windows-2012R2 D ---------------------- D ------Backtrace------- D C:/Users/user/AppData/Local/chefdk/gem/ruby/2.5.0/gems/kitchen-hyperv-0.5.2/lib/kitchen/driver/hyperv.rb:156:increate_virtual_machine'
D C:/Users/user/AppData/Local/chefdk/gem/ruby/2.5.0/gems/kitchen-hyperv-0.5.2/lib/kitchen/driver/hyperv.rb:70:in create' D C:/opscode/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/instance.rb:484:inpublic_send'
D C:/opscode/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/instance.rb:484:in block in perform_action' D C:/opscode/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/instance.rb:551:insynchronize_or_call'
D C:/opscode/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/instance.rb:513:in block in action' D C:/opscode/chefdk/embedded/lib/ruby/2.5.0/benchmark.rb:293:inmeasure'
D C:/opscode/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/instance.rb:512:in action' D C:/opscode/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/instance.rb:484:inperform_action'
D C:/opscode/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/instance.rb:394:in create_action' D C:/opscode/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/instance.rb:382:inblock (2 levels) in transition_to'
D C:/opscode/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/lifecycle_hooks.rb:45:in run_with_hooks' D C:/opscode/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/instance.rb:381:inblock in transition_to'
D C:/opscode/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/instance.rb:380:in each' D C:/opscode/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/instance.rb:380:intransition_to'
D C:/opscode/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/instance.rb:129:in create' D C:/opscode/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/command.rb:197:inpublic_send'
D C:/opscode/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/command.rb:197:in run_action_in_thread' D C:/opscode/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/command.rb:169:inblock (2 levels) in run_action'
D C:/opscode/chefdk/embedded/lib/ruby/gems/2.5.0/gems/logging-2.2.2/lib/logging/diagnostic_context.rb:474:in block in create_with_logging_context' D ----End Backtrace----- D ---Nested Exception--- D Class: Kitchen::ActionFailed D Message: Failed to complete #create action: [undefined method' for nil:NilClass]
D ----------------------
D ------Backtrace-------
D C:/Users/user/AppData/Local/chefdk/gem/ruby/2.5.0/gems/kitchen-hyperv-0.5.2/lib/kitchen/driver/hyperv.rb:156:in create_virtual_machine' D C:/Users/user/AppData/Local/chefdk/gem/ruby/2.5.0/gems/kitchen-hyperv-0.5.2/lib/kitchen/driver/hyperv.rb:70:increate'
D C:/opscode/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/instance.rb:484:in public_send' D C:/opscode/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/instance.rb:484:inblock in perform_action'
D C:/opscode/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/instance.rb:551:in synchronize_or_call' D C:/opscode/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/instance.rb:513:inblock in action'
D C:/opscode/chefdk/embedded/lib/ruby/2.5.0/benchmark.rb:293:in measure' D C:/opscode/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/instance.rb:512:inaction'
D C:/opscode/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/instance.rb:484:in perform_action' D C:/opscode/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/instance.rb:394:increate_action'
D C:/opscode/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/instance.rb:382:in block (2 levels) in transition_to' D C:/opscode/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/lifecycle_hooks.rb:45:inrun_with_hooks'
D C:/opscode/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/instance.rb:381:in block in transition_to' D C:/opscode/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/instance.rb:380:ineach'
D C:/opscode/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/instance.rb:380:in transition_to' D C:/opscode/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/instance.rb:129:increate'
D C:/opscode/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/command.rb:197:in public_send' D C:/opscode/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/command.rb:197:inrun_action_in_thread'
D C:/opscode/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/command.rb:169:in block (2 levels) in run_action' D C:/opscode/chefdk/embedded/lib/ruby/gems/2.5.0/gems/logging-2.2.2/lib/logging/diagnostic_context.rb:474:inblock in create_with_logging_context'
D ----End Backtrace-----

0 Likes