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

azurerm_windows_virtual_machine_scale_set assumes name value is being used for Windows machine names on cluster nodes #6759

Closed
mjneuharth opened this issue May 4, 2020 · 4 comments

Comments

@mjneuharth
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform (and AzureRM Provider) Version

  • Terraform v0.12.24
  • provider.azurerm v2.7.0

Affected Resource(s)

  • azurerm_windows_virtual_machine_scale_set

Terraform Configuration Files

resource "azurerm_windows_virtual_machine_scale_set" "vmss" {
  name                 = "longVirtualMachineScaleSetName"
  computer_name_prefix = "vmss"
...
}

Expected Behavior

No errors, the name in the portal is a valid name for the resource in the portal (there is no 15 character limit) and the computer_name_prefix is used in composing the node names within the cluster.

Actual Behavior

Error: "name" can be at most 15 characters, got 30

  on .terraform/modules/vmss/main.tf line 6, in resource "azurerm_windows_virtual_machine_scale_set" "vmss":
   6: resource "azurerm_windows_virtual_machine_scale_set" "vmss" {

It appears the validation function is unaware of whether the name is being used as the computer_name_prefix and is applying the same rules regardless. In the case that the computer_name_prefix is provided, the rules should not be checking whether name is valid for windows hostname, but instead just validating that it is a valid azure resource name.

Steps to Reproduce

  1. terraform plan

Important Factoids

References

  • #0000
@adamday2
Copy link
Contributor

adamday2 commented May 4, 2020

This appears to be directly related to the validation function discussed here as well:
#6494

@njuCZ
Copy link
Contributor

njuCZ commented May 7, 2020

@mjneuharth thanks for pointing this problem, it has been fix by #6639, which is released by version 2.8.0. Could you please upgrade your azurerm version ?

@tombuildsstuff
Copy link
Member

hi @mjneuharth

As @njuCZ has mentioned this has been fixed in v2.8.0 - you can upgrade to this by updating the version in the Provider block (as shown below) and then running terraform init -upgrade:

provider "azurerm" {
  version = "= 2.8.0"
}

Since this should be fixed by updating the version of the Azure Provider being used I'm going to close this issue for the moment - but please let us know if that doesn't work for you and we'll take another look.

Thanks!

@ghost
Copy link

ghost commented Jun 6, 2020

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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@hashicorp hashicorp locked and limited conversation to collaborators Jun 6, 2020
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

6 participants