XenServer Error: “The Snapshot Chain is too long”
Categories: XenServer, Alike v3, Alike v4
Introduction
Because XenServer has a limit to how many snapshots an individual VM (or its VDIs) can have, you may see an error message similar to the ones listed below when you reach the limit (around 30).
- “The snapshot chain is too long.”
- “SR_BACKEND_FAILURE_109”
- “Xen reported this VM has too many snapshots”
When this happens, Xen is unable to take new (additional) snapshots of the effected VM until some snapshots are removed. To resolve this situation, the first place to look is in XenCenter, under the VM’s snapshot tab. If there are any unneeded snapshots, remove them.
Solutions
Often, however, there are far too few snapshots displayed in XenCenter to account for the full chain limit (~30). In this case, the ‘extra’ snapshots in the chain are being taken up by Xen itself, under the hood. Typically, XenServer will attempt to automatically collapse (auto-coalesce) these snapshots, consolidating them down behind the scenes.
Then, by simply waiting a while, Xen will take care of this problem for you. Unfortunately, this auto-coalescing process can take some time, and its up to Xen to decide when to attempt it. On very busy systems, it can take quite a while.
To get around the arbitrary scheduling of the automatic process, you may manually run a ‘leaf coalesce.’ The drawback to this manual process is that it will temporarily suspend/pause the target VM in order to complete its work. This command can be run from the console of a host in the pool with the VM in question.
Example command line usage:
xe host-call-plugin host-uuid=[host uuid] plugin=coalesce-leaf fn=leaf-coalesce args:vm_uuid=[vm uuid]
Finally, in some cases the above script will not solve the problem. This is usually an indication of a more complicated snapshot chain heirarchy (involving other VMs or templates), or an error of some sort in the backend VDI/VHD storage. In these cases, the only viable resolution to this error is to perform a full (XVA) export/import of the effected VM, via XenCenter.
Alternatively, you could use Alike to restore a previous version of the VM if that is available to you. By doing this, you essentially create a fresh new VM (complete with a new UUID), which also creates a fresh snapshot chain.
Final Notes
Please Note: Alike’s Q-Hybrid technology does not use XenServer snapshots, and therefore is not affected by this problem.
If you are still receiving the XenServer snapshot error codes after troubleshooting, please open a support ticket. See the KB article, “How to Use Quadric Support,” for instructions on how to open a ticket.