-
Notifications
You must be signed in to change notification settings - Fork 82
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
"wait_for_ips" not being respected #186
Comments
I think what I may be after here is a way to tell the provider to not evaluate the machine as up/down for a specified period of time. I think what may be happening is there’s an up/down evaluation taking place before the polling interval and timeout take effect (as in make an initial check and if it’s not up yet go into the internal/timeout). But that’s just speculation on my part. |
I had the chance to look closer and see more of what's happening. The machine I'm deploying is being spun out of a "golden" Windows template, one that's been properly SysPrep'd, etc. When it's powered up for the first time it has to go through SysPrep-related activities for about a minute (in the background), then it reboots and when it comes back up it's ready for use and is unique from any other machines created from the image. It's the automatic post-SysPrep reboot that's causing problems. The provider seems to be interpreting that as everything being ready...the problem is that no IP address has been assigned yet (it takes another few seconds)...which means it's not there to be referenced by later portions of my TF plan. My interpretation of the "wait_for_ips" options was that they'd be the controlling factor in whether or not the provider would proceed...but that does not appear to be happening. Any suggestions? |
The terraform provider reports the ip address allocated to the vm. More than likely you probably want to leverage another mechanism like Packer does. Packer will poll WinRM or SSH port until it can make a successful connection. So during the creation of the golden image ensure that WinRM/SSH is not running or firewall is blocking it and as the last step of the sysprep enable it. Hopefully I can figure out how to add a cloud-init/user-data equivalent (e.g. create iso and hook it up), then issues like this will go away. See #36 |
I have merged in the ability to add custom ISOs. Which I think enabled the ability to solve the problem. Lets continue the conversation on #36 |
Hi there,
Thank you for opening an issue. Please note that we try to keep the Terraform issue tracker reserved for bug reports and feature requests. For general usage questions, please see: https://www.terraform.io/community.html.
Terraform Version
Terraform v1.3.7
Hyper-V Provider Version
1.0.4
Affected Resource(s)
Please list the resources as a list, for example:
Terraform Configuration Files
Debug Output
Debug output here
Panic Output
Expected Behavior
My expectation is the provider will wait for the net adaptor to be assigned an IP address before concluding.
Actual Behavior
Rather than wait up until the "wait_for_ips" timeout the provider seems to view the successful start of the VM (into "running" state) as the trigger to conclude. As such my output variable isn't being populated.
Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
terraform apply
Important Factoids
Nothing I can think of. This is all very vanilla.
References
The text was updated successfully, but these errors were encountered: