test-kitchen / kitchen-vagrant

A Test Kitchen Driver for Vagrant
Other
348 stars 189 forks source link

kitchen create error(s) - hyper-v win server 2016 guest #418

Open bp-rocket opened 4 years ago

bp-rocket commented 4 years ago

:speaking_head: Foreword

Thank for taking the time to fill this bug report fully. Without it we may not be able to fix the bug, and the issue may be closed without resolution.

:ghost: Brief Description

The follow errors are returned when running "kitchen create"...

-----> Starting Test Kitchen (v2.5.1)
-----> Creating <default-Windows-2016>...
       WARNING: Vagrant has detected the `vagrant-winrm` plugin. Vagrant ships with
       WinRM support builtin and no longer requires the `vagrant-winrm` plugin. To
       prevent unexpected errors please uninstall the `vagrant-winrm` plugin using
       the command shown below:

         vagrant plugin uninstall vagrant-winrm

       To disable this warning, set the environment variable `VAGRANT_IGNORE_WINRM_PLUGIN`
       Bringing machine 'default' up with 'hyperv' provider...
       ==> default: Verifying Hyper-V is enabled...
       ==> default: Verifying Hyper-V is accessible...
       ==> default: Machine not provisioned because `--no-provision` is specified.
$$$$$$ (10,8):UserId:
At line:1 char:1
$$$$$$ + $username = 'vagrant'
$$$$$$ + ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (:) [Write-Error], ArgumentException
    + FullyQualifiedErrorId : System.ArgumentException

>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: 1 actions failed.
>>>>>>     Failed to complete #create action: [WinRM exited (-2147024809) for command: [Write-Host '[WinRM] Established
']] on default-Windows-2016
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration

Version

Vagrant 2.2.9 Chef Workstation version: 20.6.62 Chef Infra Client version: 16.1.16 Chef InSpec version: 4.19.0 Chef CLI version: 3.0.4 Test Kitchen version: 2.5.1 Cookstyle version: 6.7.3

Environment

Host OS: Windows 10 Enterprise .kitchen.yml contents...

---
driver:
  name: vagrant
  boot_timeout: 1200
  gui: false

provisioner:
  name: chef_zero
  product_name: chef
  product_version: 14.12.9

verifier:
  name: inspec

transport:
  name: winrm
  elevated: true
  username: Administrator
  password: Pass@word1

platforms:
  - name: Windows-2016
    driver:
      box: StefanScherer/windows_2016
      provider: hyperv

suites:
  - name: default
    run_list:
      - recipe[learn_chef_iis::default]
    verifier:
      inspec_tests:
        - test/smoke/default
    attributes:

Vagrant file contents...

Vagrant.configure("2") do |config|

  config.vm.box = "StefanScherer/windows_2016"
  config.vm.box_version = "> 2019.01.09"
  config.vm.define "hyperv-learn-chef-iis-win2016" do |h|
  end

  config.vm.provider "hyperv" do |h|
    h.cpus = "2"
    h.memory = "4196"
    h.name = "learn-chef-iis-win2016"
  end
end

Scenario

I'm new to the chef/test kitchen/vagrant tools. I'm trying to setup an development environment for building Chef recipes and cookbooks.

Steps to Reproduce

I'm hoping the contents of the .kitchen.yml and vagrantfile will provide enough information.

Expected Result

No errors

Actual Result

Lots of errors that I don't know how to resolve. default-windows-2016.log kitchen.log

:heavy_plus_sign: Additional context

Add any other context about the problem here. e.g. related issues or existing pull requests.

bp-rocket commented 3 years ago

I'm still having this issue. Can someone assist?

Here are the execution log kitchen.yml files. files.zip

marcparadise commented 3 years ago

@bp-rocket since we don't include the vagrant-winrm plugin in Chef Workstation, I wonder if the one you have installed locally is conflicting with the built-in behaviors of Vagrant for WinRM. Could you try uninstalling that plugin via vagrant plugin uninstall vagrant-winrm and let us know here if that resolves the issue or changes any behavior?