-
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
azurerm_virtual_machine broken in 0.6.14 #5793
Comments
Here is the terraform manifest that was used in the above run:
|
Thanks for the bug report @gdhagger. This is a brand new resource so i will try and debug your configuration to see what the issue is |
Hi @gdhagger So I have been able to debug this (using charles proxy) and found the following:
This actually relates to the following:
take out the %d from that and it works. This is my fault with the documentation - I will update that immediately! I will also open a PR to add some validation toe the computer_name for both linux and windows machine types Paul |
Paul, That fixed the example for me, however I'm still receiving the same error report with my "real world" code. Have charles setup - but struggling to get terraform to accept the charles SSL cert. Any tips? Would like to add here if what I'm encountering is still a bug. |
My configuration is below |
Hi @lmeyemezu Please can you post your config (minus secrets) so that I can try one too? Paul |
@gdhagger how does the code in the example differ from your code? |
@stack72 the block giving issues is as follows:
The issue appears to be with the ssh_keys block. It's unclear from the docs what 'path' actually means in this context, and from experience I've found Azure to be picky about the format of the ssh public key. I've tried both ssh pubkey format, and x509 pem public keys (as seen here) to no avail. Still trying to get my proxy working so I can see wtf the server is actually saying :) |
@gdhagger try following this example
Path seems to be the path to store the key on the VM |
@stack72 can you translate that into terraform format? I've tried but am failing. Also, setting 'path' to '/home/admin/.ssh/authorized_keys' isn't helping. |
I don't think you can set it as an authorized key as that is a file in itself - you would need to do that with a custom_data script AFAICT Try with /tmp for now and see if it writes ok I am on a train so will have to try and reproduce this when i have network connectivity on my laptop :( |
OK... I got charles working - here's what I found: admin_username = "admin" results in:
ssh_keys path set to '/tmp/' gives:
setting it to '/tmp/foo' reveals this:
fixing that, with a PEM formatted public key I got:
this appears to have worked - the vm now exists in azure (though i've screwed up the network so I can't test ssh right now.... doh!) but terraform is reporting a failure:
|
@gdhagger OK good news on finding those azure messages. These will form part of the validation With regards to the ssh key address, this is indeed a bug!! So that needs fixed. Will work on that immediately so thanks for finding it Your example will help me add a regression test in place so thanks for that |
Hi @stack72 , |
Not sure if this is right place to ask this. |
Hi @joaocc these messages are actually hidden by the SDK not by terraform. Terraform is returning the error's that the SDK returns P. |
Hi @stack72. |
I am really desperate for that to happen too so we will certainly be lobbying them to do this Paul |
@gdhagger How did you get Charles working? I'm hitting the same problem and need to check the error messages. |
@gdhagger @stack72 How did you get terraform to accept the SSL cert for charles? I've been having issues getting charles to work too. ---edit--- @OiNutter I figured it out. There's a cert issue with golang on OSX in it's current version. I launched a vagrant ubuntu box, proxied it out to the host after added the charles CA cert and now it works. Hope this helps you. |
I am running into the same error as @gdhagger , The ssh key is installed on the VM and I can successfully login to the VM with the key. But after this happens terraform is pretty much bricked with the following error:
Even trying to destroy the cluster now is not working. I tested this a few times and after the key is successfully installed I am not able to use terraform on this state. I have to delete the tfstate file to get things working again. |
@gdhagger I cant seem to get terraform to accept the charles ssl cert how did you get that working? |
I got charles working and see some interesting things. @stack72 I see this that is curious:
The docs say this is optional: https://www.terraform.io/docs/providers/azurerm/r/virtual_machine.html#computer_name This is also interesting:
There is no mention of such requirements in the doc: https://www.terraform.io/docs/providers/azurerm/r/virtual_machine.html#admin_password Can we put some validation on this? Until we can surface these errors in the SDK do you want a pr for documenting this up? |
Re: the charles cert - it's been a while, but I think this is what I did: I'm running ubuntu, so I copy the Charles ca cert from Then run Details here: http://manpages.ubuntu.com/manpages/wily/man8/update-ca-certificates.8.html |
FYI, we are trying to get the next release of Terraform to have the updated SDK so that error messages are not hidden |
Hi all I am going to track the work required for this issue in a larger set of AzureRM work that needs to be done. This is going to be #6526 so please track there Paul |
Just a FYI, I also ran into "400 Bad Request" issues creating new VMs and couldn't debug with Charles on OSX. But Azure portal has Audit Logs view where you can see the failed operations and dig into event details. The specific error message is found in the event's PROPERTIES value. Hope that helps other debug their issues. In my case the problem was I had set
|
Hi Terraform version : v0.12.23 resource "azurerm_windows_virtual_machine" "resource_virtual_machine" { os_disk { } source_image_reference{
Note : Storage_image_reference , os_profile_windows_config, os_profile I have tried using all the above options in the config file but every time i get a new error stating the " Solutions & suggestions appreciated. |
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. |
I'm attempting to use the new azurerm_virtual_machine provider in 0.6.14 however I cannot find any combination of options that will result in the successful launch of a vm. I just get a 400 Bad Request response from Azure whatever I try.
This even appears to be broken using the example from the documentation - per the output below:
Getting this provider fixed would MASSIVELY increase my productivity, so please let me know what extra info I can provide to help debug this.
The text was updated successfully, but these errors were encountered: