vagrant-azure icon indicating copy to clipboard operation
vagrant-azure copied to clipboard

Chef wont run on windows vms if port 22 not open on endpoint

Open iaingblack opened this issue 9 years ago • 2 comments

I was trying to provision a windows machine using vagrant-azure and then run chef_zero afterwards. But, it would not work until I opened port 22 as an endpoint on azure VM. This is despite it being a windows host. Not sure if ruby library that causes issue, but perhaps worth documenting?

Sample amendment to vagrantfile shown on https://github.com/MSOpenTech/vagrant-azure;

azure.tcp_endpoints = '3389:33389,22' #Map guest RDP to 33389 externally and open SSH port, though we shouldn't need that

Error below;

==> default: Running provisioner: chef_zero... ==> default: VM OS: Windows ==> default: Provisioning for Windows ==> default: Looking for WinRM ==> default: Found public port 5986 at depth 0 - 18: self signed certificate at depth 0 - 18: self signed certificate ==> default: Vagrant does not support detecting whether Chef is installed ==> default: for the guest OS running in the machine. Vagrant will assume it is ==> default: installed and attempt to continue. INFO machine: Calling action: read_ssh_info on provider Azure (myazuremachin-asdas@myazure-service-baxjf) INFO runner: Preparing hooks for middleware sequence... INFO runner: 1 hooks defined. INFO runner: Running action: #Vagrant::Action::Builder:0x431f7a8 INFO warden: Calling IN action: #Vagrant::Action::Builtin::ConfigValidate:0x460a8e0 INFO warden: Calling IN action: #VagrantPlugins::WinAzure::Action::ConnectAzure:0x460a8c8 INFO warden: Calling IN action: #VagrantPlugins::WinAzure::Action::ReadSSHInfo:0x4644978 INFO interface: info: Looking for local port 22 INFO interface: info: ==> default: Looking for local port 22 ==> default: Looking for local port 22 ERROR warden: Error occurred: undefined method `[]' for nil:NilClass

A successful run looks like this;

==> default: Looking for local port 22 ==> default: Found port mapping 22 --> 22 ==> default: Looking for local port 22 ==> default: Found port mapping 22 --> 22 ==> default: Looking for local port 22 ==> default: Found port mapping 22 --> 22 Generating chef JSON and uploading... ==> default: Looking for WinRM ==> default: Found public port 5986 at depth 0 - 18: self signed certificate at depth 0 - 18: self signed certificate ==> default: Looking for WinRM ==> default: Found public port 5986 at depth 0 - 18: self signed certificate at depth 0 - 18: self signed certificate ==> default: Running chef-zero... ==> default: [2015-04-05T09:29:27+00:00] INFO: Starting chef-zero on host localhost, port 8889 etc....

iaingblack avatar Apr 05 '15 09:04 iaingblack

I also had this happen, using the chef-zero provisioner with a Windows Azure VM.

NickMRamirez avatar Jun 17 '15 21:06 NickMRamirez

I see what's going on. It's reading the ssh info rather than looking for winrm. I'll try to replicate.

devigned avatar Aug 17 '15 08:08 devigned