Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
azurerm_image
: add option to set the hyper_v_generation for the image
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
- Loading branch information