Ploop snapshot cannot be deleted with "Single delta, nothing to merge" error message
Original Publishing Date:
2022-04-13
Symptoms
Ploop snapshot cannot be deleted with the following error message:
~# prlctl snapshot-delete 333 -i 57ff7d22-ddce-4fd6-a8db-976094de6e55
Delete the snapshot...
Failed to delete snapshot: Operation failed. Failed to delete snapshot: Single delta, nothing to merge [38]
Failed to delete snapshot {57ff7d22-ddce-4fd6-a8db-976094de6e55}
Cause
The snapshot deletion process has been interrupted and DiskDescriptor.xml was not modified to reflect the changes.
Resolution
-
Confirm that only one delta is used:
~# grep 333 /sys/block/ploop*/pdelta/*/image
/sys/block/ploop26196/pdelta/0/image:/vz/private/333/root.hdd/root.hds
-
Check that the snapshot file is not held by any process:
~# ll /vz/private/333/root.hdd/
total 32879644
drwx------ 4 root root 4096 Feb 11 2013 cache-private
drwxr-xr-x 2 root root 4096 Feb 11 2013 cache-root
-rw-r--r-- 1 root root 1134 Mar 1 20:00 DiskDescriptor.xml
-rw------- 1 root root 0 Feb 11 2013 DiskDescriptor.xml.lck
-rw------- 1 root root 21077426176 Mar 5 02:49 root.hds
-rw------- 1 root root 12487491584 Mar 4 19:21 root.hds.{230c98c4-bdbb-4c0d-ad29-5269cce7366b}
drwx------ 2 root root 4096 Apr 29 2013 root.hds.mnt
drwxr-xr-x 21 root root 4096 Apr 29 2013 templates
~# lsof 2>/dev/null | grep 230c98c4-bdbb-4c0d-ad29-5269cce7366b
~#
(In the example above you can also notice that modification date for root.hds file is more recent then for root.hds.{230c98c4-bdbb-4c0d-ad29-5269cce7366b})
- Stop the affected container.
- Create a backup copy of the directory
/vz/private/CTID/root.hdd.
-
Modify <Storage> and <Snapshots> sections in /vz/private/CTID/root.hdd/DiskDescriptor.xml to exclude the snapshot. <Storage> and <Snapshots> sections in DiskDescriptor.xml of the container withiout any snapshots looks this way:
<StorageData>
<Storage>
<Start>0</Start>
<End>20971520</End>
<Blocksize>2048</Blocksize>
<Image>
<GUID>{5fbaabe3-6958-40ff-92a7-860e329aab41}</GUID>
<Type>Compressed</Type>
<File>root.hds</File>
</Image>
</Storage>
</StorageData>
<Snapshots>
<TopGUID>{5fbaabe3-6958-40ff-92a7-860e329aab41}</TopGUID>
<Shot>
<GUID>{5fbaabe3-6958-40ff-92a7-860e329aab41}</GUID>
<ParentGUID>{00000000-0000-0000-0000-000000000000}</ParentGUID>
</Shot>
</Snapshots>
- Delete the
/vz/private/CTID/Snapshots.xml file.
- Start the container.
- Delete the unnecessary snapshot image (
/vz/private/333/root.hdd/root.hds.{230c98c4-bdbb-4c0d-ad29-5269cce7366b}).
Internal content