Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WinRM proxy issues with VMWare Workstation. #6775

Closed
theemptyone opened this issue Sep 27, 2018 · 4 comments
Closed

WinRM proxy issues with VMWare Workstation. #6775

theemptyone opened this issue Sep 27, 2018 · 4 comments

Comments

@theemptyone
Copy link

My Environment is:

  • CentOS 7 Host System
  • VMWare Workstation
  • Windows 2016 VM.
  • Packer 1.3.1

VMWare Workstation setups a virtual nic on your system with a reserved ip space, in my case 172.16.50.1. Then when it creates a VM it uses dhcp within VMWare that sits on the subnet it created on the virtual switch with that as the default gateway.

The problem is that the WinRM connector (I assume) uses curl to check if WinRM is available. Curl does not respect ip ranges in no_proxy; which means that you cannot put that entire subnet into no_proxy by default. Since there is no way to 'set' the ip for the VM through packer (due to how VMWare works i believe), there is no way to logically pre-empt that with a variable wrapper.

An Option is needed to allow curl (again, i assume) to ignore proxy for everything before it runs it's validator, or to add the ip that packer connects to, to it's no_proxy env variable in it's local session.

I've been able to work around this for my test cases (Vmware generally reuses the ip for a rebuild, and i've narrowed the dhcp pool to 8 ips and added each of them to no_proxy), but this does not scale.

@azr
Copy link
Contributor

azr commented Oct 4, 2018

Hey @theemptyone, I see that curl doesn't respect IP ranges yet.

But I don't see any call to curl on packers' side, nor on the winrm library we use.

Can you tell me exactly how you use packer in this case so I can try to reproduce/fix your problem ?

@theemptyone
Copy link
Author

theemptyone commented Nov 15, 2018

Sorry, i had to circle around back to this. I don't believe curl will ever respect IP Ranges as it's developed now.

here is my base file

{
  "builders": [
    {
      "name": "{{ user `name` }}-vmware",
      "vm_name": "{{ user `name` }}-vmware",
      "type": "vmware-iso",
      "vmx_data": {
        "memsize": "{{ user `memory` }}",
        "numvcpus": "{{ user `cpus` }}",
        "scsi0.virtualDev": "lsisas1068",
        "vcpu.hotadd": "true",
        "mem.hotadd": "true"
      },
      "guest_os_type": "{{user `vm_os_type`}}",
      "headless": false,
      "version": "13",
      "iso_checksum": "{{user `iso_checksum`}}",
      "iso_checksum_type": "{{user `iso_checksum_type`}}",
      "iso_url": "{{user `mirror`}}/{{user `mirror_directory`}}/{{user `iso_name`}}",
      "output_directory": "../builds/packer-{{user `name`}}-vmware",
      "vmdk_name": "{{ user `name` }}",
      "communicator": "winrm",
      "winrm_username": "vagrant",
      "winrm_password": "vagrant",
      "winrm_timeout": "12h",
      "shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
      "shutdown_timeout": "15m",
      "floppy_files": [
        "{{user `common_script_folder`}}",
        "{{user `specific_script_folder`}}"
      ]
    }
  ]
}

The issue is that it never comes back as saying winrm is available if the IP Address isn't specifically called out in NoProxy. Since VMWare Workstation uses a DHCP pool, i have to limit the pool to 10 addresses or so, and put one explicitly into noproxy, in order to get this to work.

Everything i've seen from the linux side, uses curl libraries to reach out to the host to poll for winrm. Since it doesn't respect noproxy, it goes off to the proxy, which will fail as the vm is local.

@ghost
Copy link

ghost commented Apr 19, 2021

This issue has been automatically migrated to hashicorp/packer-plugin-vmware#8 because it looks like an issue with that plugin. If you believe this is not an issue with the plugin, please reply to hashicorp/packer-plugin-vmware#8.

@ghost ghost closed this as completed Apr 19, 2021
@ghost
Copy link

ghost commented May 20, 2021

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked as resolved and limited conversation to collaborators May 20, 2021
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants