Skip to content
This repository has been archived by the owner on Jan 30, 2021. It is now read-only.

Hanging on WinRM #241

Open
riweston opened this issue Jan 28, 2020 · 3 comments
Open

Hanging on WinRM #241

riweston opened this issue Jan 28, 2020 · 3 comments

Comments

@riweston
Copy link

I seem to be stuck waiting for WinRM. I'm pretty confident that this isn't a networking issue my end or in Azure as I've been building Packer images in the same subscription.

Can anyone help with this?

OS is OS X 10.15.2
Vagrant 2.2.5

Vagrant.configure('2') do |config|
  config.vm.box = 'azure'

  config.vm.provider :azure do |azure, override|

    # each of the below values will default to use the env vars named as below if not specified explicitly
    azure.tenant_id = ENV['TENANT_ID']
    azure.client_id = ENV['CLIENT_ID']
    azure.client_secret = ENV['CLIENT_SECRET']
    azure.subscription_id = ENV['SUBSCRIPTION_ID']
    azure.vm_name = 'vagrant-rw'
    azure.vm_image_urn = 'MicrosoftWindowsServer:WindowsServer:2016-Datacenter:latest'
    azure.instance_ready_timeout = 600
    azure.admin_username = "OctoAdmin"
    azure.admin_password = 'TopSecretPassw0rd'
    #override.winrm.transport = :ssl
    #override.winrm.port = 5986
    override.winrm.ssl_peer_verification = false # must be false if using a self signed cert
  end

end
@nickkeyzer
Copy link

I've run into this same issue as well trying to deploy a Windows 2016 image on Azure. I enabled debug to see what was happening. It appears to check indefinitely for WinRM port to become "ready". This doesn't appear to be a networking issue since I was able to open a telnet connection to the configured WinRM port (TCP 5986) as well as RDP (TCP 3389) from my workstation via the FQDN and Public IP of the VM.

MacOS 10.14.6
Vagrant 2.2.6
vagrant-azure 2.0.0

Here's the interesting bits of the Vagrantfile that I'm using:

Vagrant.configure('2') do |config|
    config.vm.box = 'azure'
    config.vm.provider :azure do |azure, override|
      override.vm.synced_folder ".", "/vagrant", disabled: true
      ...
      azure.vm_image_urn = 'MicrosoftWindowsServer:WindowsServer:2016-Datacenter:latest'
      override.winrm.transport = :ssl
      override.winrm.port = 5986
      override.winrm.ssl_peer_verification = false # must be false if using a self signed cert
    end
end

Here's the log entry that's repeated seeming indefinitely until the Vagrant run is stopped:

 INFO winrm: Checking whether WinRM is ready...
DEBUG provider: Searching for cap: winrm_info
DEBUG provider: Checking in: azure
DEBUG provider: Found cap: winrm_info in azure
DEBUG provider: Searching for cap: winrm_info
DEBUG provider: Checking in: azure
DEBUG provider: Found cap: winrm_info in azure
 INFO provider: Execute capability: winrm_info [#<Vagrant::Machine: default (VagrantPlugins::Azure::Provider)>] (azure)
 INFO machine: Calling action: read_winrm_info on provider Azure (eus-nick-vagrant:lucid-kiwi:eastus)
 INFO interface: Machine: action ["read_winrm_info", "start", {:target=>:default}]
 INFO runner: Preparing hooks for middleware sequence...
 INFO runner: 1 hooks defined.
 INFO runner: Running action: machine_action_read_winrm_info #<Vagrant::Action::Builder:0x0000000107706ae0>
 INFO warden: Calling IN action: #<Vagrant::Action::Builtin::BeforeTriggerAction:0x00000001076ff510>
 INFO warden: Calling IN action: #<Vagrant::Action::Builtin::ConfigValidate:0x00000001076ff4e8>
 INFO warden: Calling IN action: #<Vagrant::Action::Builtin::AfterTriggerAction:0x00000001076ff4c0>
 INFO warden: Calling IN action: #<Vagrant::Action::Builtin::BeforeTriggerAction:0x00000001076ff448>
 INFO warden: Calling IN action: #<VagrantPlugins::Azure::Action::ConnectAzure:0x00000001076ff420>
 INFO warden: Calling IN action: #<Vagrant::Action::Builtin::AfterTriggerAction:0x00000001076cc048>
 INFO warden: Calling IN action: #<Vagrant::Action::Builtin::BeforeTriggerAction:0x00000001076c7f70>
 INFO warden: Calling IN action: #<VagrantPlugins::Azure::Action::ReadWinrmInfo:0x00000001076c7f48>
 INFO warden: Calling IN action: #<Vagrant::Action::Builtin::AfterTriggerAction:0x000000010764d590>
 INFO warden: Calling OUT action: #<Vagrant::Action::Builtin::AfterTriggerAction:0x000000010764d590>
 INFO warden: Calling OUT action: #<VagrantPlugins::Azure::Action::ReadWinrmInfo:0x00000001076c7f48>
 INFO warden: Calling OUT action: #<Vagrant::Action::Builtin::BeforeTriggerAction:0x00000001076c7f70>
 INFO warden: Calling OUT action: #<Vagrant::Action::Builtin::AfterTriggerAction:0x00000001076cc048>
 INFO warden: Calling OUT action: #<VagrantPlugins::Azure::Action::ConnectAzure:0x00000001076ff420>
 INFO warden: Calling OUT action: #<Vagrant::Action::Builtin::BeforeTriggerAction:0x00000001076ff448>
 INFO warden: Calling OUT action: #<Vagrant::Action::Builtin::AfterTriggerAction:0x00000001076ff4c0>
 INFO warden: Calling OUT action: #<Vagrant::Action::Builtin::ConfigValidate:0x00000001076ff4e8>
 INFO warden: Calling OUT action: #<Vagrant::Action::Builtin::BeforeTriggerAction:0x00000001076ff510>
 INFO interface: Machine: action ["read_winrm_info", "end", {:target=>:default}]
 INFO winrm: WinRM not up: #<VagrantPlugins::CommunicatorWinRM::Errors::WinRMNotReady: The box is not able to report an address for WinRM to connect to yet.
WinRM cannot access this Vagrant environment. Please wait for the
Vagrant environment to be running and try again.>

All Resources are properly provisioned in Azure including the NSG with the firewall ports. I'm not very proficient with Ruby but digging through the code has lead me to lib/vagrant-azure/action/read_winrm_info.rb which appears to be the class that's getting called indefinitely while waiting for WinRM to become available.

@Bmunier54
Copy link

Same thing here. Anyone for help us ?

@Bmunier54
Copy link

Can you add this at your Vagrantfile : config.vm.guest = :windows ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants