Skip to content

feat: add storage deletion workflow with conditional execution#1492

Draft
achatur wants to merge 8 commits intomainfrom
add_deletes_for_storage
Draft

feat: add storage deletion workflow with conditional execution#1492
achatur wants to merge 8 commits intomainfrom
add_deletes_for_storage

Conversation

@achatur
Copy link
Contributor

@achatur achatur commented Dec 9, 2025

Add storage cleanup steps to keystone oslo event sensor with proper conditional execution based on event type. Centralize deletion logic in openstack-oslo-event workflow template output parameters.

  • Add ansible-delete-server step triggered by server_storage_delete
  • Pass node_uuid as device_id to server deletion playbook
  • Added oslo sensor for nova for delete
  • Added handler and registered it

@achatur achatur force-pushed the add_deletes_for_storage branch 2 times, most recently from 114b1eb to 99b71d8 Compare January 15, 2026 20:52
@achatur achatur force-pushed the add_deletes_for_storage branch from 7630230 to 26c6206 Compare January 23, 2026 16:57
@cardoe cardoe force-pushed the add_deletes_for_storage branch from 5a37de0 to 9625024 Compare January 23, 2026 22:56
@achatur achatur force-pushed the add_deletes_for_storage branch from 9625024 to 80d9de6 Compare January 29, 2026 13:59
triggers the ansible playbook without requiring a Python handler.

The sensor extracts the following parameters from the event:
- device_id: from payload.node (the Ironic node UUID)
Copy link
Contributor

Choose a reason for hiding this comment

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

This is the nova instance UUID and not the Ironic node which might matter here?

@achatur achatur force-pushed the add_deletes_for_storage branch from 80d9de6 to 5ed8396 Compare February 4, 2026 20:44
exchangeName: nova
exchangeType: topic
exchangeDeclare:
durable: false
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
durable: false
durable: true

@achatur achatur force-pushed the add_deletes_for_storage branch from 5ed8396 to c70e6d2 Compare February 5, 2026 16:35
Add storage cleanup steps to keystone oslo event sensor with proper
conditional execution based on event type. Centralize deletion logic
in openstack-oslo-event workflow template output parameters.

- Add ansible-delete-server step triggered by server_storage_delete
- Pass node_uuid as device_id to server deletion playbook
- Added oslo sensor for nova for delete
- Added handler and registered it
Replace Python handler with direct sensor filtering for Nova instance
delete events. This simplifies the workflow by using Argo Events data
filters to check if storage cleanup is needed.

Changes:
- Add data filter to check metadata.storage == 'wanted' in sensor
- Extract device_id and project_id directly from event payload
- Remove Python handler step and UUID conversion
- Trigger storage_on_server_delete.yml ansible playbook directly
- Deprecate handle_instance_delete() Python function
- Set check_mode to false for actual execution

Benefits:
- Simpler workflow with fewer steps
- Faster execution without Python handler overhead
- Easier to understand and maintain
- Follows event-driven architecture patterns
@achatur achatur force-pushed the add_deletes_for_storage branch from c70e6d2 to e198817 Compare February 5, 2026 16:35
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.

2 participants