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_snapshotComment:
/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:
- Connect to the cluster node via SSH. For more information about connecting via SSH, see Workstation setup.
- List all VMs and find the internal name of the target VM:
virsh list --allExample output460 5450_testtest runningComment:
5450_testtest— internal VM name.
- Determine the target disk name and check whether the snapshot is in use:
virsh domblklist '5450_testtest'Example outputTarget Source ------------------------------ vda /vm/5450_testtest.5450_testtest_snapshotComment:
vda— disk name.
If the
Sourcecolumn shows a file with the_snapshotsuffix, the snapshot is active (in use by the VM):Active snapshot examplevda /vm/5450_testtest.5450_testtest_snapshotIf
Sourcepoints to the base file without the_snapshotsuffix, the snapshot is not active (not in use by the VM):Inactive snapshot examplevda /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).
To resolve the issue:
- Connect to the cluster node via SSH. For more information about connecting via SSH, see Workstation setup.
- For active snapshots only (has the
_snapshotsuffix):
- Merge the snapshot with the active disk:
Comment:virsh blockcommit '5450_testtest' vda --active --verbose --pivot5450_testtest— target VM name;vda— disk name (obtained in step 3 of the Diagnosis section).
- Verify the merge result:
virsh domblklist '5450_testtest'Expected output — the
Sourcecolumn shows the base file without the_snapshotsuffix.Example outputTarget Source ------------------------------------------------ vda /vm/5450_testtest
- Merge the snapshot with the active disk:
- For both cases (active and unused snapshot). Delete the snapshot file:
- for a regular file:
rm -f /vm/5450_testtest.5450_testtest_snapshotComment:
5450_testtest.5450_testtest_snapshot— snapshot file name.
- For an LVM volume (if the
domblklistoutput shows a path like/dev/lvm0/<VM_name>_snapshot):
lvremove -f /dev/lvm0/vm137477_snapshotComment:
vm137477_snapshot— snapshot volume name.
- for a regular file:
Related topics:
En
Es