-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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_image
: add option to set the hyper_v_generation for the image
#4453
Conversation
I can't run the
it would be amazing if if you can help why? |
877dabc
to
33cb166
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @abhinavdahiya, these changes look good but we should also try and set this property in the read function if we can. Also, as for the errors you're seeing, it looks like our tests haven't been updated all the way. You can change 16.04-LTS -> 18.04-LTS
and Standard_F2 -> Standard_D1_v2
. That should allow the initial test to pass. But it also looks like TestAccAzureRMImage_standaloneImageZoneRedundant
never passed so let's not worry about getting that to pass. The final thing to do for now would be to also write a test that creates a V2
hyper_v_generation just to make sure it works.
33cb166
to
4134d92
Compare
@mbfrahry update the commit to A) update the read function to also set the hyper_v_generation B) Add a testcase The testsuite before the change is as follows: make testacc TESTARGS='-run=TestAccAzureRMImage_standaloneImage'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test $(go list ./... |grep -v 'vendor'|grep -v 'examples') -v -run=TestAccAzureRMImage_standaloneImage -timeout 180m -ldflags="-X=github.com/terraform-providers/terraform-provider-azurerm/version.ProviderVersion=acc"
? github.com/terraform-providers/terraform-provider-azurerm [no test files]
=== RUN TestAccAzureRMImage_standaloneImage
=== PAUSE TestAccAzureRMImage_standaloneImage
=== RUN TestAccAzureRMImage_standaloneImageZoneRedundant
=== PAUSE TestAccAzureRMImage_standaloneImageZoneRedundant
=== CONT TestAccAzureRMImage_standaloneImage
=== CONT TestAccAzureRMImage_standaloneImageZoneRedundant
--- FAIL: TestAccAzureRMImage_standaloneImageZoneRedundant (486.68s)
testing.go:569: Step 0 error: errors during apply:
Error: Code="PlatformImageNotFound" Message="The platform image 'Canonical:UbuntuServer:16.04-LTS:latest' is not available. Verify that all fields in the storage profile are correct."
on /tmp/tf-test364164823/main.tf line 61:
(source code not available)
--- FAIL: TestAccAzureRMImage_standaloneImage (1019.63s)
testing.go:569: Step 1 error: errors during apply:
Error: compute.ImagesClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: Code="InvalidParameter" Message="Required parameter 'hyperVGeneration' is missing (null)." Target="hyperVGeneration"
on /tmp/tf-test119634721/main.tf line 99:
(source code not available)
Error: Code="TargetDiskBlobAlreadyExists" Message="Blob https://accsa191001150912481015.blob.core.windows.net/vhds/myosdisk1.vhd already exists. Please provide a different blob URI as target for disk 'myosdisk1'."
on /tmp/tf-test119634721/main.tf line 61:
(source code not available)
FAIL
FAIL github.com/terraform-providers/terraform-provider-azurerm/azurerm 1019.656s The test suite after the change is as follows: make testacc TESTARGS='-run=^TestAccAzureRMImage_standaloneImage'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test $(go list ./... |grep -v 'vendor'|grep -v 'examples') -v -run=^TestAccAzureRMImage_standaloneImage -timeout 180m -ldflags="-X=github.com/terraform-providers/terraform-provider-azurerm/version.ProviderVersion=acc"
? github.com/terraform-providers/terraform-provider-azurerm [no test files]
=== RUN TestAccAzureRMImage_standaloneImage
=== PAUSE TestAccAzureRMImage_standaloneImage
=== RUN TestAccAzureRMImage_standaloneImage_hyperVGeneration_V2
=== PAUSE TestAccAzureRMImage_standaloneImage_hyperVGeneration_V2
=== RUN TestAccAzureRMImage_standaloneImageZoneRedundant
=== PAUSE TestAccAzureRMImage_standaloneImageZoneRedundant
=== CONT TestAccAzureRMImage_standaloneImage
=== CONT TestAccAzureRMImage_standaloneImageZoneRedundant
=== CONT TestAccAzureRMImage_standaloneImage_hyperVGeneration_V2
--- FAIL: TestAccAzureRMImage_standaloneImageZoneRedundant (362.47s)
testing.go:569: Step 0 error: errors during apply:
Error: Code="PlatformImageNotFound" Message="The platform image 'Canonical:UbuntuServer:18.04-LTS:latest' is not available. Verify that all fields in the storage profile are correct."
on /tmp/tf-test403504907/main.tf line 61:
(source code not available)
--- PASS: TestAccAzureRMImage_standaloneImage (380.55s)
--- PASS: TestAccAzureRMImage_standaloneImage_hyperVGeneration_V2 (564.15s)
FAIL
FAIL github.com/terraform-providers/terraform-provider-azurerm/azurerm 564.181s PTAL |
The new clients require this information see [properties.hyperVGeneration][1] and it supports 2 values `V1` and `V2` [2] the default is `V1` in azure cli `--hyper-v-generation` [3], so it should be safe to keep that as default. The testsuite before the change is as follows: make testacc TESTARGS='-run=TestAccAzureRMImage_standaloneImage' ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test $(go list ./... |grep -v 'vendor'|grep -v 'examples') -v -run=TestAccAzureRMImage_standaloneImage -timeout 180m -ldflags="-X=github.com/terraform-providers/terraform-provider-azurerm/version.ProviderVersion=acc" ? github.com/terraform-providers/terraform-provider-azurerm [no test files] === RUN TestAccAzureRMImage_standaloneImage === PAUSE TestAccAzureRMImage_standaloneImage === RUN TestAccAzureRMImage_standaloneImageZoneRedundant === PAUSE TestAccAzureRMImage_standaloneImageZoneRedundant === CONT TestAccAzureRMImage_standaloneImage === CONT TestAccAzureRMImage_standaloneImageZoneRedundant --- FAIL: TestAccAzureRMImage_standaloneImageZoneRedundant (486.68s) testing.go:569: Step 0 error: errors during apply: Error: Code="PlatformImageNotFound" Message="The platform image 'Canonical:UbuntuServer:16.04-LTS:latest' is not available. Verify that all fields in the storage profile are correct." on /tmp/tf-test364164823/main.tf line 61: (source code not available) --- FAIL: TestAccAzureRMImage_standaloneImage (1019.63s) testing.go:569: Step 1 error: errors during apply: Error: compute.ImagesClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: Code="InvalidParameter" Message="Required parameter 'hyperVGeneration' is missing (null)." Target="hyperVGeneration" on /tmp/tf-test119634721/main.tf line 99: (source code not available) Error: Code="TargetDiskBlobAlreadyExists" Message="Blob https://accsa191001150912481015.blob.core.windows.net/vhds/myosdisk1.vhd already exists. Please provide a different blob URI as target for disk 'myosdisk1'." on /tmp/tf-test119634721/main.tf line 61: (source code not available) FAIL FAIL github.com/terraform-providers/terraform-provider-azurerm/azurerm 1019.656s ``` The test suite after the change is as follows: ```console make testacc TESTARGS='-run=^TestAccAzureRMImage_standaloneImage' ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test $(go list ./... |grep -v 'vendor'|grep -v 'examples') -v -run=^TestAccAzureRMImage_standaloneImage -timeout 180m -ldflags="-X=github.com/terraform-providers/terraform-provider-azurerm/version.ProviderVersion=acc" ? github.com/terraform-providers/terraform-provider-azurerm [no test files] === RUN TestAccAzureRMImage_standaloneImage === PAUSE TestAccAzureRMImage_standaloneImage === RUN TestAccAzureRMImage_standaloneImage_hyperVGeneration_V2 === PAUSE TestAccAzureRMImage_standaloneImage_hyperVGeneration_V2 === RUN TestAccAzureRMImage_standaloneImageZoneRedundant === PAUSE TestAccAzureRMImage_standaloneImageZoneRedundant === CONT TestAccAzureRMImage_standaloneImage === CONT TestAccAzureRMImage_standaloneImageZoneRedundant === CONT TestAccAzureRMImage_standaloneImage_hyperVGeneration_V2 --- FAIL: TestAccAzureRMImage_standaloneImageZoneRedundant (362.47s) testing.go:569: Step 0 error: errors during apply: Error: Code="PlatformImageNotFound" Message="The platform image 'Canonical:UbuntuServer:18.04-LTS:latest' is not available. Verify that all fields in the storage profile are correct." on /tmp/tf-test403504907/main.tf line 61: (source code not available) --- PASS: TestAccAzureRMImage_standaloneImage (380.55s) --- PASS: TestAccAzureRMImage_standaloneImage_hyperVGeneration_V2 (564.15s) FAIL FAIL github.com/terraform-providers/terraform-provider-azurerm/azurerm 564.181s ``` [1]: https://docs.microsoft.com/en-us/rest/api/compute/images/createorupdate#image [2]: https://docs.microsoft.com/en-us/rest/api/compute/images/createorupdate#hypervgenerationtypes [3]: https://docs.microsoft.com/en-us/cli/azure/image?view=azure-cli-latest#optional-parameters
4134d92
to
cd686ef
Compare
@tombuildsstuff any update on when this fix can merge. |
…ndle private_dns zone Using the upstream azurerm provider is not possible for now because of following reasons: 1) There is not srv record resource for private dns zone 2) The version of provider that has the private dns zone resources `1.34.0` has a lot of bugs like * hashicorp/terraform-provider-azurerm#4452 * hashicorp/terraform-provider-azurerm#4453 * hashicorp/terraform-provider-azurerm#4501 Some of these bugs are fixed, and some are in flight. Another reason moving to `1.36.0` which might have all the fixes we need is the provider has moved to using `standalone terraform plugin SDK v1.1.1` [1]. Because we vendor both terraform and providers, this causes errors like `panic: gob: registering duplicate types for "github.com/zclconf/go-cty/cty.primitiveType": cty.primitiveType != cty.primitiveType` Therefore, we would have to move towards a single vendor for terraform and plugins for correct inter-operation, which is tricker due to conflicts elsewhere A simple 4 resource plugin that re-uses the already vendored azurerm provider as library and carries over the required resources seems like an easy fix for now. [1]: hashicorp/terraform-provider-azurerm#4474
…ndle private_dns zone Using the upstream azurerm provider is not possible for now because of following reasons: 1) There is not srv record resource for private dns zone 2) The version of provider that has the private dns zone resources `1.34.0` has a lot of bugs like * hashicorp/terraform-provider-azurerm#4452 * hashicorp/terraform-provider-azurerm#4453 * hashicorp/terraform-provider-azurerm#4501 Some of these bugs are fixed, and some are in flight. Another reason moving to `1.36.0` which might have all the fixes we need is the provider has moved to using `standalone terraform plugin SDK v1.1.1` [1]. Because we vendor both terraform and providers, this causes errors like `panic: gob: registering duplicate types for "github.com/zclconf/go-cty/cty.primitiveType": cty.primitiveType != cty.primitiveType` Therefore, we would have to move towards a single vendor for terraform and plugins for correct inter-operation, which is tricker due to conflicts elsewhere A simple 4 resource plugin that re-uses the already vendored azurerm provider as library and carries over the required resources seems like an easy fix for now. [1]: hashicorp/terraform-provider-azurerm#4474
…ndle private_dns zone Using the upstream azurerm provider is not possible for now because of following reasons: 1) There is not srv record resource for private dns zone 2) The version of provider that has the private dns zone resources `1.34.0` has a lot of bugs like * hashicorp/terraform-provider-azurerm#4452 * hashicorp/terraform-provider-azurerm#4453 * hashicorp/terraform-provider-azurerm#4501 Some of these bugs are fixed, and some are in flight. Another reason moving to `1.36.0` which might have all the fixes we need is the provider has moved to using `standalone terraform plugin SDK v1.1.1` [1]. Because we vendor both terraform and providers, this causes errors like `panic: gob: registering duplicate types for "github.com/zclconf/go-cty/cty.primitiveType": cty.primitiveType != cty.primitiveType` Therefore, we would have to move towards a single vendor for terraform and plugins for correct inter-operation, which is tricker due to conflicts elsewhere A simple 4 resource plugin that re-uses the already vendored azurerm provider as library and carries over the required resources seems like an easy fix for now. [1]: hashicorp/terraform-provider-azurerm#4474
…ndle private_dns zone Using the upstream azurerm provider is not possible for now because of following reasons: 1) There is not srv record resource for private dns zone 2) The version of provider that has the private dns zone resources `1.34.0` has a lot of bugs like * hashicorp/terraform-provider-azurerm#4452 * hashicorp/terraform-provider-azurerm#4453 * hashicorp/terraform-provider-azurerm#4501 Some of these bugs are fixed, and some are in flight. Another reason moving to `1.36.0` which might have all the fixes we need is the provider has moved to using `standalone terraform plugin SDK v1.1.1` [1]. Because we vendor both terraform and providers, this causes errors like `panic: gob: registering duplicate types for "github.com/zclconf/go-cty/cty.primitiveType": cty.primitiveType != cty.primitiveType` Therefore, we would have to move towards a single vendor for terraform and plugins for correct inter-operation, which is tricker due to conflicts elsewhere A simple 4 resource plugin that re-uses the already vendored azurerm provider as library and carries over the required resources seems like an easy fix for now. [1]: hashicorp/terraform-provider-azurerm#4474
…ndle private_dns zone Using the upstream azurerm provider is not possible for now because of following reasons: 1) There is not srv record resource for private dns zone 2) The version of provider that has the private dns zone resources `1.34.0` has a lot of bugs like * hashicorp/terraform-provider-azurerm#4452 * hashicorp/terraform-provider-azurerm#4453 * hashicorp/terraform-provider-azurerm#4501 Some of these bugs are fixed, and some are in flight. Another reason moving to `1.36.0` which might have all the fixes we need is the provider has moved to using `standalone terraform plugin SDK v1.1.1` [1]. Because we vendor both terraform and providers, this causes errors like `panic: gob: registering duplicate types for "github.com/zclconf/go-cty/cty.primitiveType": cty.primitiveType != cty.primitiveType` Therefore, we would have to move towards a single vendor for terraform and plugins for correct inter-operation, which is tricker due to conflicts elsewhere A simple 4 resource plugin that re-uses the already vendored azurerm provider as library and carries over the required resources seems like an easy fix for now. [1]: hashicorp/terraform-provider-azurerm#4474
…ndle private_dns zone Using the upstream azurerm provider is not possible for now because of following reasons: 1) There is not srv record resource for private dns zone 2) The version of provider that has the private dns zone resources `1.34.0` has a lot of bugs like * hashicorp/terraform-provider-azurerm#4452 * hashicorp/terraform-provider-azurerm#4453 * hashicorp/terraform-provider-azurerm#4501 Some of these bugs are fixed, and some are in flight. Another reason moving to `1.36.0` which might have all the fixes we need is the provider has moved to using `standalone terraform plugin SDK v1.1.1` [1]. Because we vendor both terraform and providers, this causes errors like `panic: gob: registering duplicate types for "github.com/zclconf/go-cty/cty.primitiveType": cty.primitiveType != cty.primitiveType` Therefore, we would have to move towards a single vendor for terraform and plugins for correct inter-operation, which is tricker due to conflicts elsewhere A simple 4 resource plugin that re-uses the already vendored azurerm provider as library and carries over the required resources seems like an easy fix for now. [1]: hashicorp/terraform-provider-azurerm#4474
…ndle private_dns zone Using the upstream azurerm provider is not possible for now because of following reasons: 1) There is not srv record resource for private dns zone 2) The version of provider that has the private dns zone resources `1.34.0` has a lot of bugs like * hashicorp/terraform-provider-azurerm#4452 * hashicorp/terraform-provider-azurerm#4453 * hashicorp/terraform-provider-azurerm#4501 Some of these bugs are fixed, and some are in flight. Another reason moving to `1.36.0` which might have all the fixes we need is the provider has moved to using `standalone terraform plugin SDK v1.1.1` [1]. Because we vendor both terraform and providers, this causes errors like `panic: gob: registering duplicate types for "github.com/zclconf/go-cty/cty.primitiveType": cty.primitiveType != cty.primitiveType` Therefore, we would have to move towards a single vendor for terraform and plugins for correct inter-operation, which is tricker due to conflicts elsewhere A simple 4 resource plugin that re-uses the already vendored azurerm provider as library and carries over the required resources seems like an easy fix for now. [1]: hashicorp/terraform-provider-azurerm#4474 (cherry picked from commit af00810)
Any I can do to get this moving forward, or is there anything that's blocking this @mbfrahry @tombuildsstuff ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey @abhinavdahiya
Thanks for pushing those changes - apologies for the delayed review here!
Taking a look through this LGTM 👍
Thanks!
dismissing since changes have been pushed
This has been released in version 1.40.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.40.0"
}
# ... other configuration ... |
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! |
The new clients require this information see properties.hyperVGeneration and it supports 2 values
V1
andV2
2the default is
V1
in azure cli--hyper-v-generation
3, so it should be safe to keep that as default.Fixes: #4361