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

[Image] zone resilient property addition #3100

Merged
merged 7 commits into from
Mar 29, 2019

Conversation

Lucretius
Copy link
Contributor

@Lucretius Lucretius commented Mar 21, 2019

Resolves #1581

Updated documentation. Note about where zone resiliency can be used comes from the Azure documentation

Added a property to an existing test function which specifies the storage type so that it could be reused for the zone_redundant test. Added a possible skip to the test, as not all zones support ZRS and did not want false positives interfering with the test.

@ghost ghost added size/M and removed size/XS labels Mar 22, 2019
@Lucretius
Copy link
Contributor Author

This is not yet ready to merge. I am having issues running the integration tests seeing the following:

azurerm_virtual_machine.testsource: Code="ImageNotFound" Message="The platform image 'Canonical:UbuntuServer:16.04-LTS:latest' is not available. Verify that all fields in the storage profile are correct."

Seems to be something local to my branch, I am working on it.

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.

hey @Lucretius

Thanks for this PR :)

Taking a look through besides a couple of minor changes this otherwise LGTM, if we can get those fixed up then this should be good to merge 👍

Thanks!


// Region list pulled from https://docs.microsoft.com/en-us/azure/storage/common/storage-redundancy-zrs
func supportsZRS(location string) bool {
zrsRegions := []string{"westus2", "francecentral", "southeastasia", "westeurope", "northeurope", "japaneast", "uksouth", "eastus", "eastus2", "centralus"}
Copy link
Contributor

Choose a reason for hiding this comment

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

this only covers Azure Public (there's different Azure Regions which are supported e.g. Government, China, Germany) - as such I think we'd be best to remove this for the moment? (we're running the tests in some of these regions)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, my concern had been that I did not know in which locations these tests were going to be run, and did not want to have an acceptance test failure simply due to the fact that ZRS storage is not supported in some locations.

@@ -40,6 +40,11 @@ func dataSourceArmImage() *schema.Resource {

"location": locationForDataSourceSchema(),

"zone_resilient": {
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch thanks!

@@ -35,6 +35,13 @@ func resourceArmImage() *schema.Resource {

"resource_group_name": resourceGroupNameSchema(),

"zone_resilient": {
Copy link
Contributor

Choose a reason for hiding this comment

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

could we also Set this in the state here using the object returned from the API? https://github.com/terraform-providers/terraform-provider-azurerm/pull/3100/files#diff-95b4abb1c5040a8fd4f3c3674821b7b6R292

@@ -58,11 +58,14 @@ The following arguments are supported:
the image. Changing this forces a new resource to be created.
* `location` - (Required) Specified the supported Azure location where the resource exists.
Changing this forces a new resource to be created.
* `zone_resilient` - (Optional) Is zone resiliency enabled? Defaults to `false`. Changing this forces a new resource to be created.
Copy link
Contributor

Choose a reason for hiding this comment

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

we're trying to keep these sorted Required -> Optional and then Alphabetically within the fields; could we move this to below Tags (and above the Note?)

azurerm/resource_arm_image_test.go Outdated Show resolved Hide resolved
Co-Authored-By: Lucretius <rlippens39@gmail.com>
@Lucretius
Copy link
Contributor Author

Ah nice catch @katbyte - I think I got mixed up looking at another resource which had the zone_redundant property

@ghost ghost removed the waiting-response label Mar 28, 2019
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.

hey @Lucretius

Thanks for pushing those changes - sorry for the delayed re-review here! Taking a look through this now LGTM 👍

Thanks!

@tombuildsstuff tombuildsstuff dismissed katbyte’s stale review March 28, 2019 22:08

dismissing since changes have been pushed

@katbyte katbyte merged commit 39df1f1 into hashicorp:master Mar 29, 2019
katbyte added a commit that referenced this pull request Mar 29, 2019
@Lucretius Lucretius deleted the zone-resilient branch March 29, 2019 05:49
@ghost
Copy link

ghost commented Apr 3, 2019

This has been released in version 1.24.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.24.0"
}
# ... other configuration ...

@ghost
Copy link

ghost commented Apr 28, 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 Apr 28, 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 zone resiliency option for managed images
3 participants