Repository navigation
Commit c18ebe2
committed
kvm: fix delete of failed Instance Snapshot on stopped VM with RBD storage
StorageVMSnapshotStrategy.canHandle() required either State.Allocated or
a persisted vm_snapshot_details/STORAGE_SNAPSHOT row before it would
claim a VM snapshot. A snapshot that fails before any underlying disk
snapshot is taken (e.g. VM freeze fails because the QEMU guest agent is
not connected) transitions to State.Error without ever persisting such
a row, so canHandle() returned CANT_HANDLE and deletion fell back to
DefaultVMSnapshotStrategy. That strategy sends a DeleteVMSnapshotCommand
to the KVM agent, which requires a live libvirt domain - failing with
'Domain not found' once the VM is stopped, and blocking both snapshot
deletion and VM destruction.
Let StorageVMSnapshotStrategy also claim ownership of snapshots in
State.Error even when no disk-snapshot details were persisted: there is
nothing on the hypervisor to clean up in that case, and
deleteVMSnapshot()/deleteDiskSnapshot() are already safe no-ops when the
details list is empty - no libvirt domain is required.
Fixes #139721 parent a7697fe commit c18ebe2
2 files changed
Lines changed: 43 additions & 1 deletion
File tree
- engine/storage/snapshot/src
- main/java/org/apache/cloudstack/storage/vmsnapshot
- test/java/org/apache/cloudstack/storage/vmsnapshot
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
338 | 338 | | |
339 | 339 | | |
340 | 340 | | |
341 | | - | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
342 | 344 | | |
343 | 345 | | |
344 | 346 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| |||
297 | 298 | | |
298 | 299 | | |
299 | 300 | | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
300 | 340 | | |
301 | 341 | | |
302 | 342 | | |
| |||
0 commit comments