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

Update azurerm_linux|windows_virtual_machine - support platform_fault_domain for VMSS Flex support #10803

Merged
merged 9 commits into from
Mar 11, 2021

Conversation

ArcturusZhang
Copy link
Contributor

No description provided.

Copy link
Member

@jackofallops jackofallops left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @ArcturusZhang - Thanks for this PR.

I have concerns around the behaviour of this property. The validation suggests that -1 is not a valid value, but this is the default and the docs suggest the user can specify it (which they will not currently be able to). Can you please check which is correct and I'll continue review?

Thanks

@ArcturusZhang
Copy link
Contributor Author

Hi @ArcturusZhang - Thanks for this PR.

I have concerns around the behaviour of this property. The validation suggests that -1 is not a valid value, but this is the default and the docs suggest the user can specify it (which they will not currently be able to). Can you please check which is correct and I'll continue review?

Thanks

Oh, sorry I missed that! I will change the validation to AtLeast(-1) to allow the user to explicit set -1 to it.

The logic in this attribute is like this:
We could set a platform_fault_domain_count in the associated azurerm_orchestrated_virtual_machine_scale_set resource to define the count of the platform fault domains. For instance, it is assigned by 2. Then all the VMs added to that azurerm_orchestrated_virtual_machine_scale_set could assign a platform_fault_domain like an index, from 0 to 1 in my example. In the REST API, you could leave this property to null to let the API choose a platform_fault_domain for you.

To support the null behaviour, I make the default of this attribute to -1 because 0 has specific meaning other than absence.

Also when we are not setting the platform_fault_domain (or setting it to -1 in terraform), the API will not return the automatically-chosen value in the GET response (the platform fault domain will still be null when you send null). We have another API the instanceView to check the actual platform_fault_domain value.

@ArcturusZhang
Copy link
Contributor Author

Hi @jackofallops I just updated the validation function, please take a look, thanks

Copy link
Contributor

@tombuildsstuff tombuildsstuff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few comments inline but this otherwise LGTM 👍

website/docs/r/linux_virtual_machine.html.markdown Outdated Show resolved Hide resolved
website/docs/r/windows_virtual_machine.html.markdown Outdated Show resolved Hide resolved
@tombuildsstuff
Copy link
Contributor

Merging the suggestions so we can get this into this release

@tombuildsstuff tombuildsstuff dismissed jackofallops’s stale review March 11, 2021 11:53

dismissing since changes have been pushed

@tombuildsstuff
Copy link
Contributor

Tests look good 👍

@tombuildsstuff tombuildsstuff added this to the v2.51.0 milestone Mar 11, 2021
@tombuildsstuff tombuildsstuff merged commit 96dc548 into hashicorp:master Mar 11, 2021
tombuildsstuff added a commit that referenced this pull request Mar 11, 2021
@ArcturusZhang ArcturusZhang deleted the vmss-flex-fd branch March 12, 2021 03:16
@ghost
Copy link

ghost commented Mar 12, 2021

This has been released in version 2.51.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example:

provider "azurerm" {
    version = "~> 2.51.0"
}
# ... other configuration ...

@ghost
Copy link

ghost commented Apr 11, 2021

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 👉 [email protected]. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Apr 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants