Skip to content

Instance snapshot failures when using 'KvmFileBasedStorageVmSnapshotStrategy' #14481

Description

@rajujith

problem

Instance snapshots fail to create and also fail to delete; further, it becomes unable to destroy the Instance altogether.

| setting | value |
|---|---|
| `vmSnapshot.strategies.exclude` | `StorageVMSnapshotStrategy,DefaultVMSnapshotStrategy` |
| `kvm.vmstoragesnapshot.enabled` | `false` |
| `vmsnapshot.max` | `10` (default) |

versions

4.22.1.1

The steps to reproduce the bug

  1. A running KVM instance on NFS primary storage, no volume snapshots, no Instance Snapshots.
  2. Stop the QEMU guest agent inside the guest (or use a guest that has none installed).
  3. As the owning user: createVMSnapshot virtualmachineid=<vm> snapshotmemory=false quiescevm=true
    → fails (expected — quiesce needs the agent).
  4. listVMSnapshot virtualmachineid=<vm> → the attempt is listed with state: Error.
  5. deleteVMSnapshot vmsnapshotid=failed vmsnapshotid (as the user, and again as root admin) → Failed to delete Instance Snapshot.
  6. destroyVirtualMachine id=<vm> expunge=true (root admin) → Failed to destroy vm with specified vmId;
    the instance ends up Stopped, not destroyed.

Retrying step 3 with quiescevm=false succeeds, so the snapshot capability itself is fine — only
the failed attempt's Instance snapshot is orphaned.

What to do about it?

The failure scenario should be either fixed or handled gracefully

Activity

  1. added theissue type on Oct 22, 2026
  2. YanChii commented on Oct 23, 2026

    @YanChii

    Hi.

    Some context that may help when fixing this:

    • The orphaned row only appears when DefaultVMSnapshotStrategy is excluded (vmSnapshot.strategies.exclude = StorageVMSnapshotStrategy,DefaultVMSnapshotStrategy). With the default strategy enabled, it can delete the Error row; that is also the current workaround (remove it from the exclude list, restart the management servers, delete, restore, restart again).
    • Cause: KvmFileBasedStorageVmSnapshotStrategy.canHandle(VMSnapshot) returns CANT_HANDLE for any snapshot that is no longer Allocated unless it has the kvmFileBasedStorageSnapshot detail, and that detail is only persisted after a successful create. So the strategy that created the row refuses its own failed row, and VMSnapshotManagerImpl.findVMSnapshotStrategy throws "Can't find Instance Snapshot strategy". deleteAllVMSnapshots propagates this, which is why destroyVirtualMachine fails.
    • Impact: the row also counts toward vmsnapshot.max, and any user can trigger it (quiescevm=true on a guest without a running agent).

    Jan

  3. added this to the 4.22.3 milestone on Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions