ddelnano / packer-plugin-xenserver

A builder plugin for Packer.IO to support building XenServer images.
Mozilla Public License 2.0
72 stars 37 forks source link

Add support for IP address changes #62

Open Erik142 opened 1 year ago

Erik142 commented 1 year ago

This PR improves upon the existing "Wait for IP step", by continuously checking for changes to the IP address for the VM, even after the IP address has been retrieved.

The implementation is using a simple goroutine which encapsulates the existing method used to wait for the IP address. When an IP address has been found, the goroutine will put the IP address directly in the state, which will be queried when the IP address should be retrieved.

A minor customization has been made to the "SSH port forward step", to retrieve the IP address from the state instead of using a string variable.

Closes #61

sergej-brazdeikis commented 1 year ago

JFYI This Merge Request didn't work for me - same issue

TCP connection to SSH ip/port failed: dial tcp 192.168.178.104:22: connect: connection refused
TCP connection to SSH ip/port failed: dial tcp 192.168.178.104:22: i/o timeout
TCP connection to SSH ip/port failed: dial tcp 192.168.178.104:22: connect: host is down
TCP connection to SSH ip/port failed: dial tcp 192.168.178.104:22: connect: host is down
TCP connection to SSH ip/port failed: dial tcp 192.168.178.104:22: connect: host is down
TCP connection to SSH ip/port failed: dial tcp 192.168.178.104:22: i/o timeout
Erik142 commented 1 year ago

Thank you for this feedback @sjevs! The PR has worked flawlessly for me. Could you describe in more detail how to reproduce the fault you described? A minimal set of steps to reproduce the issue would be preferable, that way I can start to work on a fix directly. Or if possible, please post the complete Packer HCL file that you are using when this error occurs.

Thanks!

hoerup commented 1 year ago

while your'e at it ip_getter is not a documented option could you add it to docs/builders/iso/xenserver-iso.html.markdown ?

Erik142 commented 1 year ago

@hoerup I could definitely take a look at that. However, I believe that should be a separate issue/pull request, no? If you think it's OK to include it in this PR, I can take care of that!

ddelnano commented 7 months ago

@Erik142 sorry for the delay. The overall idea sounds good to me. I have a few questions about hardening a bit to make sure if there is still a race with DHCP converging, that it can be tuned appropriately.