1

Running chefdk on Windows 10 with hyperv.

I can use kitchen create to create Windows VMs and it works fine but I just tried a Linux VM and I'm getting this errror:

PS> kitchen create
-----> Starting Kitchen (v1.10.0)
-----> Creating <default-centos-72>...
       Creating differencing disk for default-centos-72.
       Created differencing disk for default-centos-72.
       Checking for existing virtual machine.
       Creating virtual machine for default-centos-72.
       Created virtual machine for default-centos-72.

QBiA...AA== -outputformat Text ----
STDOUT:
STDERR: #< CLIXML
---- End output of c:\windows\sysnative\windowspowershell\v1.0\powershell.exe -noprofile -executionpolicy bypass -encodedcommand LgAg...AA== -outputformat Text ----

ProcessId: 18780
app_name: c:\windows\sysnative\windowspowershell\v1.0\powershell.exe
command_line: c:\windows\sysnative\windowspowershell\v1.0\powershell.exe -noprofile -executionpolicy bypass -encodedcommand LgAgAEM...BjADC0ASgBzAG8AbgAKAA== -outputformat Text
timeout: 600] on default-centos-72
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration

Now it does create a VM which I can manually ssh into via PuTTY or from cmd via openssh for Windows so I don't know why its hanging- looks like it can't access it.

This is my .kitchen.yml:

---
driver:
  name: hyperv
  parent_vhd_folder: c:\HyperV\VHDs\
  parent_vhd_name: CentOS-7.vhdx
  vm_switch: NAT
  memory_startup_bytes: 2GB

provisioner:
  name: chef_zero

transport:
  password: MyPassw1!@#

platforms:
  - name: centos-7.2

suites:
  - name: default
    run_list:
      - recipe[myrecipe::default]
    attributes:

Edit- More info: The server is configured for DHCP When I look in .kitchen folder the logs are empty .kitche\default-centos-72.yml only lists an id (don't know if thats supposed to have the admin name and IP in it like with rdp files? I also tried pointing to a static IP in .kitchen.yml

red888
  • 27,709
  • 55
  • 204
  • 392

2 Answers2

2

@red888 Does the vm have the latest guest components? Does Hyper-V manager see the ip address associated to the vm nic? You can check that either in hyper-v manager or via Powershell

(get-vm 'your vm name').networkadapters[0].ipaddresses

If it does, please file an issue at https://github.com/test-kitchen/kitchen-hyperv and I'll be happy to dig deeper.

You'll want the latest integration components (I think 4.1 is the latest - https://www.microsoft.com/en-us/download/details.aspx?id=51612)

Steven Murawski
  • 10,959
  • 41
  • 53
  • So CentOS7 comes with Integration Services out of the box, but I don't see the IP show up in the hyperv console or powershell. Is it supposed to or is this one of those feature linux guest don't have? – red888 Aug 05 '16 at 22:06
  • I'll try a gen 2 vm maybe – red888 Aug 05 '16 at 22:07
  • It comes with a base level of the IC, you'll need the separate more current install of the integration components. @red888 – Steven Murawski Aug 05 '16 at 23:36
  • Upgraded VM with latest integration services (4.1) and still same issue. – red888 Aug 07 '16 at 20:13
  • Submitted an issue and included logs (I actually was getting logs) https://github.com/test-kitchen/kitchen-hyperv/issues/35 – red888 Aug 07 '16 at 22:41
0

OK Steven was right, should have look into to this sooner.

This looks like it might be related to this bug.

As he suggested I found Hyper-V wasn't reporting the IP on the guest and I see this: enter image description here

Disabling SELinux and rebooting seems to solve this error, I can see the guest's IP in Hyper-V and kitchen create works.

Is there a way to allow this service access without completely disabling selinux?

red888
  • 27,709
  • 55
  • 204
  • 392