Delete unattached Oracle Cloud block volumes
This tutorial uses a CloudFlow template to find available OCI block volumes, exclude attached volumes, and request approval before deletion. Oracle Cloud nodes are available to customers enrolled in Early Access.
Goal and objectives
-
Goal: Run a daily flow that finds unattached block volumes in a compartment and requests approval before deleting the candidate batch.
-
Objectives: In this tutorial, you'll learn how to:
-
Configure
ListVolumesandListVolumeAttachments. -
Review the preconfigured candidate filter.
-
Configure an approval that expires within 24 hours.
-
Validate read-only nodes without testing the deletion.
-
An unattached volume can still contain required data. Before approving deletion, verify ownership, backup and retention requirements, disaster recovery plans, and infrastructure-as-code state. Deleting a volume is permanent.
Before you begin
-
Make sure your DoiT account has the CloudFlow Editor or CloudFlow Manager permission. See CloudFlow permissions.
-
Make sure the tenancy exists as an OCI Asset and has the CloudFlow IAM policy.
-
Identify the compartment and subscribed region that contain the volumes.
Create the flow from the template
-
Sign in to the DoiT console, select Automation and operations, and then select CloudFlow.
-
Select Templates, then select Delete unattached Oracle Cloud block volumes.
-
Open the Daily schedule trigger, select a future start date, and choose the time zone and daily run time.
Keep the flow as a draft while you validate its read-only nodes.
Configure and test the inventory nodes
-
Open the
ListVolumesnode. -
On the Parameters tab, select the compartment and region.
-
On the Connection tab, select the Oracle Cloud connection.
-
Test the node. Confirm that the results contain the expected block volumes, then select Save as test data.
-
Open the
ListVolumeAttachmentsnode and select the same compartment, region, and connection. -
Test the node. Confirm that the results contain the expected volume attachments, then select Save as test data.
Review the candidate filter
The Filter deletion candidates node keeps volumes whose lifecycleState is AVAILABLE and whose id is not present as a volumeId in the attachment results.
Test the filter and review every candidate. The visible filter uses the selected compartment. Before deletion, CloudFlow repeats the attachment check across all compartments that the connection can access in the selected region.
Configure approval and deletion
-
Open the
DeleteVolumenode and select the same compartment, region, and connection. -
Keep Require approval for this action enabled.
-
Enter the email or Slack recipient responsible for the resources.
-
Review the approval message and confirm that Reject approval after certain time is set to no more than 24 hours.
-
Don't test the
DeleteVolumenode unless you intend to delete every volume resolved from the upstream candidate list. Node tests perform the real operation without displaying the configured approval.
Immediately before an approved deletion, CloudFlow retrieves the volume again, requires it to remain AVAILABLE, checks for active attachments, and sends the deletion with the current ETag.
Publish and monitor the flow
Select Publish. The flow runs on its daily schedule and sends an approval request containing the deletion candidates. Approving the request authorizes deletion of all volumes listed in that request; CloudFlow revalidates each volume before deletion.
Use Run history to inspect the inventory, filter, approval, and deletion results. Reject any request whose ownership or retention requirements are unclear.