You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a notice to documentation that delete_os_disk_on_termination and delete_data_disks_on_termination are applied only when VM is deleted via Terraform and it will not work in case it was deleted manually
#4343
Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
If you are interested in working on this issue or have submitted a pull request, please leave a comment
Description
I had following problem: I was creating VMs in Azure for temporary usage and then some of them were deleted manually via UI in Azure portal.
In Terraform file VM had following flags set to true:
delete_os_disk_on_termination = true
delete_data_disks_on_termination = true
Azure API works in a way, that you have to delete resources related to VM manually. Terraform handles it if you create VM with those flags and terminate with Terraform.
Initially I thought it would work like AWS and setting would work same like DeleteOnTermination setting and delete volumes no matter if I do this via Terraform or manually.
By default, Amazon EBS root device volumes are automatically deleted when the instance terminates. However, by default, any additional EBS volumes that you attach at launch, or any EBS volumes that you attach to an existing instance persist even after the instance terminates. This behavior is controlled by the volume's DeleteOnTermination attribute, which you can modify. For more information, see Preserving Amazon EBS Volumes on Instance Termination.
that would look like this: "This setting works when instance is deleted via Terraform only and don't forget to delete disks manually if you deleted VM manually. It can increase spendings".
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
locked and limited conversation to collaborators
Mar 29, 2020
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Community Note
Description
I had following problem: I was creating VMs in Azure for temporary usage and then some of them were deleted manually via UI in Azure portal.
In Terraform file VM had following flags set to true:
delete_os_disk_on_termination = true
delete_data_disks_on_termination = true
Azure API works in a way, that you have to delete resources related to VM manually. Terraform handles it if you create VM with those flags and terminate with Terraform.
Initially I thought it would work like AWS and setting would work same like DeleteOnTermination setting and delete volumes no matter if I do this via Terraform or manually.
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/terminating-instances.html
I suggest to add a notice in documentation here:
https://www.terraform.io/docs/providers/azurerm/r/virtual_machine.html#delete_os_disk_on_termination
and here:
https://www.terraform.io/docs/providers/azurerm/r/virtual_machine.html#delete_data_disks_on_termination
that would look like this: "This setting works when instance is deleted via Terraform only and don't forget to delete disks manually if you deleted VM manually. It can increase spendings".
New or Affected Resource(s)
Potential Terraform Configuration
References
The text was updated successfully, but these errors were encountered: