Skip to content

[Bug] Snapshot and Delete Operations on Same Instance Cause Orphaned Image Files #909

@dvjsharma

Description

@dvjsharma

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

  1. Boot guest vm001. (example)
  2. Fire API /images (snapshot) and /guests/vm001 (DELETE) within <100 ms>.
  3. Wait for export completion.
  4. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions