Skip to content

Conversation

@Curverneur
Copy link

Description

Add support for enabling the delete protection for instances (virtual machines) and volumes (disks).

Reason

This feature allows users to enable the delete protection for certain resources to prevent accidental deletion.

References

Changes

Added deleteprotection option to cloudstack_instance and cloudstack_disk resource and updated the corresponding documentation pages.

  • modified cloudstack/resource_cloudstack_instance.go
  • modified cloudstack/resource_cloudstack_disk.go
  • modified website/docs/r/instance.html.markdown
  • modified website/docs/r/disk.html.markdown

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds delete protection support for CloudStack instances (virtual machines) and volumes (disks) by introducing a new deleteprotection boolean field to both the cloudstack_instance and cloudstack_disk resources. The feature integrates with CloudStack's API updateVirtualMachine and updateVolume endpoints to enable protection against accidental deletion.

Key Changes:

  • Added deleteprotection optional boolean field to instance and disk resource schemas
  • Implemented delete protection setting via CloudStack update APIs after resource creation
  • Updated documentation for both resources with usage notes about limitations when resources are managed by other services

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
cloudstack/resource_cloudstack_instance.go Added deleteprotection schema field and implementation to set/update protection via UpdateVirtualMachine API
cloudstack/resource_cloudstack_disk.go Added deleteprotection schema field and implementation to set/update protection via UpdateVolume API
website/docs/r/instance.html.markdown Documented deleteprotection parameter with usage notes and reformatted userdata_id/userdata_details entries
website/docs/r/disk.html.markdown Documented deleteprotection parameter with usage notes

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Curverneur and others added 4 commits December 16, 2025 14:20
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@Curverneur
Copy link
Author

looks like some checks failed due to connection issues. could you check and trigger them again, please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant