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

Support for Data Disk Attachments on VM's with VM Extensions installed #1950

Merged
merged 1 commit into from
Sep 20, 2018

Conversation

tombuildsstuff
Copy link
Contributor

This PR fixes an issue where the Virtual Machine Extension object cannot be posted back to the Virtual Machine API - which causes an issue when using the `azurerm_virtual_machine_data_disk_attachment resource on a Virtual Machine with a VM Extension configured.

Before this fix:

$ acctests azurerm TestAccAzureRMVirtualMachineDataDiskAttachment_virtualMachineExtension
=== RUN   TestAccAzureRMVirtualMachineDataDiskAttachment_virtualMachineExtension
--- FAIL: TestAccAzureRMVirtualMachineDataDiskAttachment_virtualMachineExtension (584.25s)
	testing.go:513: Step 1 error: Error applying: 1 error(s) occurred:

		* azurerm_virtual_machine_data_disk_attachment.test: 1 error(s) occurred:

		* azurerm_virtual_machine_data_disk_attachment.test: Error updating Virtual Machine "acctestvm1479430537935323945" (Resource Group "acctestrg1479430537935323945") with Disk "acctest1479430537935323945": compute.VirtualMachinesClient#CreateOrUpdate: Failure sending request: StatusCode=0 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="InvalidRequestContent" Message="The request content was invalid and could not be deserialized: 'Could not find member 'resources' on object of type 'ResourceDefinition'. Path 'resources', line 1, position 1655.'."
FAIL
FAIL	github.com/terraform-providers/terraform-provider-azurerm/azurerm	584.613s

After this fix:

$ acctests azurerm TestAccAzureRMVirtualMachineDataDiskAttachment_virtualMachineExtension
=== RUN   TestAccAzureRMVirtualMachineDataDiskAttachment_virtualMachineExtension
--- PASS: TestAccAzureRMVirtualMachineDataDiskAttachment_virtualMachineExtension (653.67s)
PASS
ok  	github.com/terraform-providers/terraform-provider-azurerm/azurerm	654.047s

Fixes #1600

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.

LGTM 🚀

@tombuildsstuff
Copy link
Contributor Author

Virtual Machine * tests pass:

screenshot 2018-09-20 at 10 49 05

@tombuildsstuff tombuildsstuff merged commit 4f152f7 into master Sep 20, 2018
@tombuildsstuff tombuildsstuff deleted the disk-attachment branch September 20, 2018 00:51
tombuildsstuff added a commit that referenced this pull request Sep 20, 2018
@jamespatetz
Copy link

Can you add a version tag to this? Thanks

@ghost
Copy link

ghost commented Mar 6, 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 👉 [email protected]. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 6, 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.

azurerm_virtual_machine_data_disk_attachment attach fails for more than 1 disks.
3 participants