Skip to content

After upgrade to 4.22.0.0 snapshot.delta.max not respected #12524

Closed

Description

@nxsbi

problem

I upgraded to 4.22.0.0 on Nov 11. I have many volumes that are set to 3 snapshots max stored by my users.

I noticed that all snapshots since Nov 11 (all existing and new ones) seem to create a massive chain of snapshots.
I had 60+ days snapshot files on the disk for every volume with daily snapshots, while the snapshot.delta.max is only set to 7. And snapshot policy is 3 snapshots only.

It seems the full snapshot before Nov 11 in my case was the last full snapshot. After that there is no more full snapshots, only incremental snapshots.

What I see in database:

in snapshots table:

Image

And in snapshot_store_ref (have hidden rows in between - but they all show as "Hidden"

Image

Please help! I cannot even clear my storage which is now hit 95% used capacity and about to blow up!! Its tens of extra terabytes of data!! with no way to clear it other than deleting all snapshots which is a huge problem for users...

versions

ACS 4.22.0
XCP-NG 8.2

The steps to reproduce the bug

1.Upgraded from 4.19 .1 to 4.22
2.
3.
...

What to do about it?

Identify what is causing the snapshot.delta.max to not be respected.

Activity

  1. nvazquez commented on Jan 27, 2026

    @nvazquez
    Contributor

    Hi @nxsbi thanks for reporting the issue. An additional question, before the upgrade did you see these 'Hidden' entries on database, or were them removed?

    On 4.21 the KVM incremental snapshot feature has been introduced (#8907) which seems to do a similar approach leaving Hidden entries on database but not removing them from storage, is it possible that its also the default behavior now for Xen/XCP? @sureshanaparti @JoaoJandre @DaanHoogland

  2. nxsbi commented on Jan 27, 2026

    @nxsbi
    Author

    Hi @nvazquez
    Before upgrade the data reflected only two values - Destroyed or BackedUp (or Ready)

    I did not do any extra steps around this.

    Related to this - I had originally reported a related issue - #9501
    This one is same issue, except that now there are no Full snapshots every 7 days at all. I used to be able to determine which is a Full snapshot based on Parent ID = 0 (in snapshot_store_ref) and now I no longer see that.
    I also reviewed the actual snapshot sizes and there is no large files except the one from before upgrade.

    Not sure if any other xcp-ng + cloudstack users can comment

  3. added this to the 4.22.1 milestone on Jan 28, 2026
  4. JoaoJandre commented on Feb 4, 2026

    @JoaoJandre
    Contributor

    Hi @nxsbi thanks for reporting the issue. An additional question, before the upgrade did you see these 'Hidden' entries on database, or were them removed?

    On 4.21 the KVM incremental snapshot feature has been introduced (#8907) which seems to do a similar approach leaving Hidden entries on database but not removing them from storage, is it possible that its also the default behavior now for Xen/XCP? @sureshanaparti @JoaoJandre @DaanHoogland

    @nvazquez As far as I remember the logic for snapshot creation and removal is the same for KVM and Xen. I'll try to reproduce the issue on 4.22 using XCP-ng.

  5. JoaoJandre commented on Feb 4, 2026

    @JoaoJandre
    Contributor

    Hello, @nxsbi

    I was able to reproduce the problem. This happens when the number of snapshots configured to be kept for the policies is lower than the snapshot.delta.max configuration, what happens is that the chain is never ended and thus the older snapshots are never removed in order to keep the newer ones valid. I will create a PR to fix this in 4.22.1.0.

    The workaround that I would suggest is setting the maximum number of snapshots for the user snapshot policies to be the same as the value of snapshot.delta.max. This will ensure that a full snapshot chain is created and finished each cycle and the older snapshot chains will be deleted. Could you test and check if this workaround works for you?

    @nvazquez This affects only XCP-ng, the snapshot creation logic is different for KVM.

  6. moved this from Todo to In Progress in Apache CloudStack 4.22.1on Feb 5, 2026
  7. nvazquez commented on Feb 5, 2026

    @nvazquez
    Contributor

    Thanks @JoaoJandre for your investigation and the fix PR - will review it

  8. nxsbi commented on Feb 27, 2026

    @nxsbi
    Author

    Hello, @nxsbi

    I was able to reproduce the problem. This happens when the number of snapshots configured to be kept for the policies is lower than the snapshot.delta.max configuration, what happens is that the chain is never ended and thus the older snapshots are never removed in order to keep the newer ones valid. I will create a PR to fix this in 4.22.1.0.

    The workaround that I would suggest is setting the maximum number of snapshots for the user snapshot policies to be the same as the value of snapshot.delta.max. This will ensure that a full snapshot chain is created and finished each cycle and the older snapshot chains will be deleted. Could you test and check if this workaround works for you?

    @nvazquez This affects only XCP-ng, the snapshot creation logic is different for KVM.

    I can confirm that the workaround works..
    Here is what I did:

    • Updated the snapshot.delta.max to a low number (from current 5 to 3)
    • Checked snapshot policies - I did not have any snapshot policy less than 3 snapshots
    • Waited for 3 more days after the change. I started to see old snapshots getting deleted.

    Suggestion for fix ---

    • Instead of using hard number of snapshot.delta.max, your logic should check (for each volume id) lower of snapshot policy vs snapshot.delta.max. The lower one should be treated as when a full snapshot is created, not just the snapshot.delta.max.
  9. linked a pull request that will close this issueFix snapshot chaining on Xen #12597on Mar 2, 2026
  10. added theissue type on Mar 3, 2026
  11. moved this from Todo to ready for Review in Apache CloudStack BugFest - Issueson Mar 11, 2026
  12. moved this from ready for Review to In Review in Apache CloudStack BugFest - Issueson Mar 11, 2026
  13. moved this from In Review to ready for Testing in Apache CloudStack BugFest - Issueson Mar 13, 2026
  14. sureshanaparti commented on Apr 10, 2026

    @sureshanaparti
    Contributor

    Fixed in #12597

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions