apache / cloudstack

Apache CloudStack is an opensource Infrastructure as a Service (IaaS) cloud computing platform
https://cloudstack.apache.org/
Apache License 2.0
1.98k stars 1.09k forks source link

Vm Snapshot left in allocated state are not cleaned up #8424

Open kiranchavala opened 8 months ago

kiranchavala commented 8 months ago

ISSUE TYPE

Bug

COMPONENT NAME

Component: Bug

CLOUDSTACK VERSION

Cloudstack version 4.18, 4.19 rc1

SUMMARY

Vm Snapshot left in the allocated state are not cleaned up

Steps to reproduce the behaviour

  1. launch a vm with root disk

  2. Take a vm-snapshot

  3. Stop the management server when vm snapshot is in progress

  4. Navigate to the database, and check the snapshots table, the snapshot

3. row id: 3 uuid: 1b83e2ef-10f6-48ee-a5d6-bed473083f8a name: i-2-40-VM_VS_20240102064443 display_name: cv description: cv vm_id: 40 account_id: 2 domain_id: 1 service_offering_id: 1 vm_snapshot_type: DiskAndMemory state: Allocated parent: NULL current: NULL update_count: 0 updated: NULL created: 2024-01-02 06:44:43 removed: NULL


5. Start the Management server

6. Navigate to the U 

Storage > VM Snapshots > 

There is no option to delete the vm snapshots which are struck in allocated state

![Screenshot 2024-01-02 at 12 24 24 PM](https://github.com/apache/cloudstack/assets/1401014/6a461a51-f1fb-42eb-8749-b2dbf5d60e42)

![Screenshot 2024-01-02 at 12 22 26 PM](https://github.com/apache/cloudstack/assets/1401014/7da50aef-ead4-4ddf-83a8-1b7d09d7f435)

Actual Behaviour

There is no option to delete the VM Snapshots which are in Allocated state 

Expected Behaviour

Cloudstack should be  able to delete the VM Snapshots in Allocated  state or Cloudstack should mark the VMSnapshots in destoryed state and mark them removed so that it's not displayed in the UI 
kiranchavala commented 8 months ago

If you try to take another vmsnapshot, the following exception occurs

Screenshot 2024-01-02 at 12 31 28 PM