-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
SSH password connection repeatedly fails to connect in vSphere #4112
Comments
The IP address is correct. I tried building master again and am getting the same error for
|
@ryanl-ee that is the main build not happy ... welcome :) Do you know how to run the vsphere acceptance tests? |
Not at first :) I figured out some of it by reading through the provider code & trial and error. I can contribute to the documentation when I have this all buttoned down. For now, for anyone else wanting to try this at home...
Per #4111 I have to go in and connect the NICs of the created test VMs. They all fail with Acceptance test logs: https://gist.github.com/ryanl-ee/cb58e2026478bd5cd1b0 |
It occurred to me that going in and reconnecting the NIC could be affecting the results... I ran it again without any intervention and got the same results. I think I know what the issue is, though. I tried cloning my specified VM manually. When my clone boots, it tries to get DHCP for 60+ seconds. When that fails, it fully boots, starts VMware tools, reconfigures itself, and then successfully gets the customization applied to it, but when they're cloned via the acceptance test it doesn't wait long enough. Is there a way to specify the timeout in the acceptance test? I can't seem to find an environment variable that allows me to set that. Alternatively I could modify the source VM to not wait for DHCP to boot, but that would be more of an issue with Boxcutter :) |
@tkak any ideas? |
I modified my source VM to only wait 10 seconds. I tried directly provisioning with Terraform again and got this from the INFO log, which looks interesting & maybe reveals something that TRACE doesn't...
Should I also tried again with the acceptance test. It passed the first 2 tests, but failed the last test with the same error above. |
@ryanl-ee we need someone with a bit more experience with chef to help us |
OK! On a hunch I tried again with the "remote-exec" provisioner instead of the "chef" provisioner and got the same error, i.e.:
...
|
@chrislovecnm I don't think this is chef-specific, since the Host is empty it would apply to remote-exec provisioner as well. The host is specified during Looks like it's trying to pull out the IP address from the first network interface, but something is causing it to fail. |
@ryanl-ee agreed. This is something going on in the remote communicator. I think in here: https://github.com/hashicorp/terraform/blob/master/communicator/ssh/communicator.go I am making an educated guess that the host should be printing out. Can you post debug to a gist? Thanks |
@phinze the code in the remote communicator is not printing out the ip or hostname. We're does this come from? |
@chrislovecnm that has to be set by the resource by calling |
@chrislovecnm Here you go, fresh gist: https://gist.github.com/ryanl-ee/f5211ab876589274d024 @phinze I wasn't sure how to identify the expected output of that line, sorry! Out of curiosity what should I look for? |
@ryanl-ee heh looks like we have to count since there's no prefix Should be the third debug line after "Created virtual machine"
^^ Yep so the machine for whatever reason is coming back with no NIC details. So there are no The next question is, why would there be no network interfaces? |
OK, so my understanding of the order of operations:
I thought maybe TF was grabbing the VM status before customization was completed, but it does have an IP by that time (https://gist.github.com/ryanl-ee/f5211ab876589274d024#file-tf-log-L4130) so that should be the final configuration. Here is the gitlab.vmx I pulled down, which does reflect the ethernet0 configuration I see in vSphere:
|
Okay so why would we see an IP address in the debug line that @ryanl-ee linked, but not get one back on |
I'm not sure why |
@pietern any advice on diagnosing why Guest.Net is not returning correct data? |
I just filed vmware/govmomi#405 to loop in the api owners. We kinda need |
Another related issue: #4302 - not a duplicate, but in the same code block. |
We can do a wait for ip on Guest.net actually ... |
You can use the property collector to wait for the |
Is there any way I can help test this? I would love for this to be in master. Thanks again for the attention so far! |
Hi folks, just wondering if there was anything for this in the works. I'm trying to do all sorts of deployments and am unable to use any provisioner aside from 'local-exec', recreating (in very basic ways) what the provisioner does in a simple shell script. |
Hi @ryanl-ee - the core team is at a bit of a loss at the moment since we are without a vSphere environment for testing. We're working on that, but progress is slow! It's possible that #5558 might have improved things somewhat in Terraform v0.6.14 - can you give that version another shot to see if |
@ryani-ee can you assist with testing? The code changes are pretty simple actually. |
@phinze could be wrong ;) |
@ryanl-ee sorry I typo'ed your username. Would you be able to test for us? |
@chrislovecnm Sure, I'd be happy to. What do I need to do? |
@ryanl-ee I need to submit a PR and then we need to work together. Let me see if I can get the code done this weekend |
@phinze any word on a test bed? If you want to reach out to me, I may be able to assist. |
@ryanl-ee I see that a PR is already in, but I moved the Have you tried @tkak's PR? #4283 p.s. if you need help getting your dev environment up, please ping me |
@xantheran this is a good way to test the branch I have as well :) |
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. |
This may or may not be related to my other issue (#4111) which involves the NIC not being connected after provisioning. After I manually connect the NIC, vSphere applies the customization template, reboots, and Terraform begins to attempt connection. The log shows that its IP is correctly reported to Terraform, and I am able to manually SSH into the newly provisioned VM using its IP and the username/password combo specified in my .tf config (vagrant//vagrant).
make test
fails even in the Vagrant box)Let me know if there is anything I can do to help test.
The text was updated successfully, but these errors were encountered: