VMmanager Knowledge Base
en En
es Es

Backup error: external snapshot file for disk vda already exists

Problem

After canceling a backup process in the platform, a virtual machine (VM) snapshot file remains and was not automatically removed. The presence of this file blocks the backup system from creating new snapshots. The following error occurs:

Creating snapshot fail
unsupported configuration: external snapshot file for disk vda already exists and is not a block device: /vm/5450_testtest.5450_testtest_snapshot

Comment:

  • /vm/5450_testtest.5450_testtest_snapshot  — snapshot file name.

The snapshot consumes disk space and may block VM migration to another cluster node.

Cause

The automatic snapshot removal did not happen because the backup process was interrupted. As a result, the snapshot remains in the file system or as an LVM volume. Depending on when the backup was interrupted, the snapshot may be either active (in use by the VM) or unused.

Diagnosis

To check the snapshot state:

  1. Connect to the cluster node via SSH. For more information about connecting via SSH, see Workstation setup.
  2. List all VMs and find the internal name of the target VM:
    virsh list --all
    Example output
    460   5450_testtest            running

    Comment:

    • 5450_testtest — internal VM name.
  3. Determine the target disk name and check whether the snapshot is in use:
    virsh domblklist '5450_testtest'
    Example output
    Target    Source
    ------------------------------
    vda       /vm/5450_testtest.5450_testtest_snapshot

    Comment:

    • vda — disk name.

    If the Source column shows a file with the _snapshot suffix, the snapshot is active (in use by the VM):

    Active snapshot example
    vda    /vm/5450_testtest.5450_testtest_snapshot

    If Source points to the base file without the _snapshot suffix, the snapshot is not active (not in use by the VM):

    Inactive snapshot example
    vda    /vm/5450_testtest

Solution

The goal is to safely remove the snapshot without rebooting the VM or losing changes.

The solution depends on the diagnostic result:

  • if the snapshot is active — remove the snapshot file after merging it with the disk (steps 2 — 3 below);
  • If the snapshot is not used by the VM — only delete the snapshot file (step 3 below).
Important
If you delete an active snapshot without merging, the VM will lose all changes made after the snapshot was created. Before proceeding, create a backup of the VM's current data. For details, see Creating backups manually.

To resolve the issue:

  1. Connect to the cluster node via SSH. For more information about connecting via SSH, see Workstation setup.
  2. For active snapshots only (has the _snapshot suffix):
    1. Merge the snapshot with the active disk:
      virsh blockcommit '5450_testtest' vda --active --verbose --pivot
      Comment:
      • 5450_testtest — target VM name;
      • vda — disk name (obtained in step 3 of the Diagnosis section).
    2. Verify the merge result:
      virsh domblklist '5450_testtest'

      Expected output — the Source column shows the base file without the _snapshot suffix.

      Example output
      Target     Source
      ------------------------------------------------
      vda        /vm/5450_testtest
  3. For both cases (active and unused snapshot). Delete the snapshot file:
    • for a regular file:
      rm -f /vm/5450_testtest.5450_testtest_snapshot

      Comment:

      • 5450_testtest.5450_testtest_snapshot — snapshot file name. 
    • For an LVM volume (if the domblklist output shows a path like /dev/lvm0/<VM_name>_snapshot):
      lvremove -f /dev/lvm0/vm137477_snapshot

       Comment:

      • vm137477_snapshot — snapshot volume name.