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

Add Proximity Placement Group Resources + Support #4020

Merged
merged 21 commits into from
Sep 5, 2019
Merged

Add Proximity Placement Group Resources + Support #4020

merged 21 commits into from
Sep 5, 2019

Conversation

tobydoescode
Copy link

@tobydoescode tobydoescode commented Aug 6, 2019

This pull request adds support for Proximity Placement Groups (PPG).

It adds the following:

  • azurerm_proximity_placement_group (resource)
  • azurerm_proximity_placement_group (data source)

Additionally it adds the proximity placement group proxy to the following supported resources:

  • azurerm_availability_set
  • azurerm_virtual_machine
  • azurerm_virtual_machine_scale_set

(fixes #4127)

@tobydoescode tobydoescode changed the title F ppg Add Proximity Placement Group Resources + Support Aug 6, 2019
Copy link
Collaborator

@WodansSon WodansSon left a comment

Choose a reason for hiding this comment

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

@evoio Thank you for this PR, LGTM! 🚀

@WodansSon
Copy link
Collaborator

@evoio If you can fix up the Travis failures and resolve the conflicts I think we will be good to go.

Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

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

Hi @evoio,

Thank you for the PR. In addition to the comments i've left inline i have some questions about the casing of the ID returned. Is it that the resource group name its self is returned in lower case or the resourceName part of the path resourcename ?

And is it that the id we get from the PPG api incorrect, or the value returned from the VM/VMSS api incorrect?

Also, has a bug report been files/opened anywhere? if not could we open on on the azure for go sdk and link all fixes for it with an additional comment:
this can be removed when http://link.to.issue has been fixed

azurerm/resource_arm_availability_set.go Show resolved Hide resolved
azurerm/resource_arm_availability_set.go Outdated Show resolved Hide resolved
azurerm/resource_arm_availability_set.go Outdated Show resolved Hide resolved
azurerm/resource_arm_proximity_placement_group_test.go Outdated Show resolved Hide resolved
azurerm/resource_arm_availability_set.go Show resolved Hide resolved
azurerm/resource_arm_virtual_machine.go Show resolved Hide resolved
azurerm/resource_arm_virtual_machine.go Outdated Show resolved Hide resolved
@tobydoescode
Copy link
Author

Hi @katbyte,

wrt the ID it is the VM/VMSS API that is incorrect. This however is not limited to the newer PPG property. I re-used a lot of the code for adding availability sets to add PPG and I noticed that it was setting the availability set ID to lower case. I initially removed this because I thought it was odd but as it happens the availability set ID has the very same issue. We couldn't get them to fix availability sets now because it will break a lot of people's state files.

I'll review all of the suggestions tomorrow and fix the conflicts too - a lot of which I think came out of go fmt. When I ran go fmt I got a lot of changes to other files that I did not commit because I didn't want to bloat my pull request with files I had no interest in changing.

@ghost ghost removed the waiting-response label Aug 11, 2019
@tobydoescode
Copy link
Author

Contrary to my previous comment I have made most of the requested changes already and fixed the conflict. There are a couple queries which I've commented back on and I need to add the requested test.

@ghost ghost added size/XXL and removed size/XL labels Aug 11, 2019
@ghost ghost added size/XL and removed size/XXL labels Aug 11, 2019
@ghost ghost added size/XXL and removed size/XL labels Aug 12, 2019
@tobydoescode
Copy link
Author

@katbyte I've now addressed all of the points you brought up - though I have follow up comments on two of them.

@WodansSon
Copy link
Collaborator

@evoio hey can you fix the conflicts on the PR and I'll take another look. Thanks! 😄

@tobydoescode
Copy link
Author

Hi @jeffreyCline I was going to leave the conflict until someone said the rest was okay - based on @katbyte 's review. Its going to keep getting conflicts because of go fmt changing indentation.

@tobydoescode
Copy link
Author

@jeffreyCline conflict resolved, saw that structure of client.go has changed again and it wasn't formatting.

@srakesh28
Copy link

Could we also consider support for PPG with zonal resource ?

azurerm_availability_zones

Thank you
Rakesh Shah

@tobydoescode
Copy link
Author

tobydoescode commented Aug 16, 2019

Hi @srakesh28, this PR is specifically targeting PPG which are another level of control over VM placement. They are related but separate functionality - you cannot specify an AZ when creating a PPG. I haven't tried, but you may be able to specify both an AZ and PPG when creating a VM to get all your VM in close proximity in the specified AZ. If Azure allows this it should be possible on acceptance of this branch - just use the "zones" and "proximity_placement_group_id" fields together. Though it's a bit of an edge case why you want this anyway.

I haven't personally used AZs in Azure yet but from reading up on them I'm not certain what an "azurerm_availability_zones" resource/data would do. AZ are not something you can create so they are not suited to a resource. You would want the equivalent data object in AWS because there are varying numbers of AZ per region but with Azure as far as I can see A) there are either 3 or not supported in a region and B) the API doesn't allow you to query them as far as I can see.

@tobydoescode
Copy link
Author

Is anyone able to review this? As far as I'm aware there haven't been any updates required for some time.

@curd0
Copy link

curd0 commented Sep 4, 2019

Is there any estimate when this is going to be merged?

katbyte added a commit that referenced this pull request Sep 5, 2019
Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

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

I hope you dont' mind @evoio but i've pushes some changes to get this merged. Thanks again for the PR!

}

d.SetId(*resp.ID)
flattenAndSetTags(d, resp.Tags)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could we add tags.SchemaForDataSource to the resource so this has an effect?

Test ended in panic.

------- Stdout: -------
=== RUN   TestAccDataSourceProximityPlacementGroup_basic
=== PAUSE TestAccDataSourceProximityPlacementGroup_basic
=== CONT  TestAccDataSourceProximityPlacementGroup_basic

------- Stderr: -------
panic: Invalid address to set: []string{"tags"}

@katbyte katbyte merged commit b79bdc6 into hashicorp:master Sep 5, 2019
@tobydoescode
Copy link
Author

@katbyte absolutely no issues here. Extremely well timed, our customer has finally decided to move forward using PPG.

@ghost
Copy link

ghost commented Sep 18, 2019

This has been released in version 1.34.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 = "~> 1.34.0"
}
# ... other configuration ...

@ghost
Copy link

ghost commented Oct 5, 2019

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!

@ghost ghost locked and limited conversation to collaborators Oct 5, 2019
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.

add azurerm_proximity_placement_group resource
5 participants