-
Notifications
You must be signed in to change notification settings - Fork 843
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 query parameter to DeleteRole to delete disk based on boolean #238
Conversation
…sk from storage while deleting the VM. Added the parameter
…e deleted or retained - as per review comment on this pull request - Azure#237
Hi @kbxkb, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!
TTYL, MSBOT; |
LGTM. Although this is breaking the API signature, I think we can take it as we've done it many times in the past for |
Though Terraform is just one user of azure-sdk-for-go, DeleteRole() is not called from Terraform (yet, before my fixes). There may be other users out there who may get impacted by the API signature modification. Having said that, I do agree with @ahmetalpbalkan that this is a necessary change. Thanks! |
@paulmey can you please take a look at your convenience, thanks! |
LGTM |
Add query parameter to DeleteRole to delete disk based on boolean
Sorry for the delay and thanks for contributing! |
What version is this fix in? |
DeleteRole REST API (used to destroy a VM) needs a query parameter to also delete the VHD disk from storage while deleting the VM. This parameter is "comp=media". Documentation is here: https://msdn.microsoft.com/en-us/library/azure/jj157184.aspx
Without this parameter, the DeleteRole() method would only delete the VM but not the disk, thereby leaking storage dollars. Added the parameter, but made it effective only if the boolean argument is true. Thanks.
Context: I am trying to fix hashicorp/terraform#3568. In other words, I am adding the capability to manage multiple VM-s under the same Cloud Service to Terraform. Once this capability is there, we will have to also be able to destroy one VM at a time. As of now, terraform takes the shortcut of deleting the entire cloud service when deleting a VM. That works today as all terraform supports is one VM per cloud service. Hence DeleteRole() method is not called, DeleteDeployment() is called directly. But as part of the fix, I must start calling DeleteRole() to remove individual VM-s. Thus, DeleteRole() must work correctly. Hence this code change. Thanks