Summary
When a VM snapshot is exported while the same VM is concurrently deleted, the source image record may be removed from the database before the export task finishes, leaving orphaned image files on disk and consuming storage until manual cleanup.
Steps to Reproduce
- Boot guest vm001. (example)
- Fire API
/images (snapshot) and /guests/vm001 (DELETE) within <100 ms>.
- Wait for export completion.
- Run SQL
SELECT * FROM images WHERE name='<snapshot_name>'.
Expected Result
- Image export finishes, DB row retained until
delete_source=True workflow removes both DB row and disk file atomically.
- No orphaned files under
/var/lib/zvmsdk/images.
Actual Result
- DB row is absent (deleted by concurrent flow).
- Disk file
<uuid>.img remains, eventually filling storage.
Launchpad Ref - https://bugs.launchpad.net/python-zvm-sdk/+bug/1769793