nvazquez opened a new pull request, #14672:
URL: https://github.com/apache/cloudstack/pull/14672

   ### Description
   
   This PR addresses the following issue for the Veeam KVM integration:
   
   `POST /vms/{id}/backups` ignored the `from_checkpoint_id` it was given. The 
KVM backup export kept a single active checkpoint per Instance in the instance 
details and every backup continued from it, deleting the previous one on the 
host when the next backup started. Two backup clients protecting the same 
Instance therefore shared one chain: each backup moved it on and removed the 
checkpoint the other client needed, and that client's next incremental was 
silently served from the wrong checkpoint and missed every block changed in 
between. The response named the substituted checkpoint, but Veeam reads from 
the one it requested. `DELETE /vms/{id}/checkpoints/{ckp}` accepted any id and 
answered 200 whether or not it did anything.
   
   ### Change
   
   Checkpoints now live in a `vm_checkpoint` table, one row per checkpoint 
present on the host, and each one stays until its client deletes it. Veeam 
relies on this when one VM is in several jobs.
   
   - A backup starts from the checkpoint the client names. Any checkpoint 
recorded for the Instance is valid, including one libvirt forgot after a 
stop/start, which the host redefines. An unknown id is refused and the Veeam 
API answers HTTP 400, so the client falls back to a full backup instead of 
continuing from another checkpoint. A request without a checkpoint is a full 
backup, and the backup type records FULL or INCREMENTAL.
   - A finalized backup adds its checkpoint and leaves the one it started from. 
The checkpoint list returns every checkpoint, oldest first, with the newest 
marked active. There is no cap on the number kept.
   - `DELETE` removes exactly the named checkpoint: the libvirt checkpoint of a 
running Instance and the dirty bitmap of the same name in every layer of the 
disk images, including layers below VM snapshot overlays, and on a stopped 
Instance with `qemu-img`, with the passphrase for encrypted volumes. A 
checkpoint libvirt has forgotten (CloudStack domains are transient, so a 
stop/start forgets them all) is redefined from the disks that still carry its 
bitmap, both when an incremental starts from it and when it is deleted. An 
unknown id is 404.
   - The dirty extents of a stopped Instance's download are computed against 
the checkpoint the backup started from, not the Instance's newest one.
   
   <!-- For new features, provide link to FS, dev ML discussion etc. -->
   <!-- In case of bug fix, the expected and actual behaviours, steps to 
reproduce. -->
   
   <!-- When "Fixes: #<id>" is specified, the issue/PR will automatically be 
closed when this PR gets merged -->
   <!-- For addressing multiple issues/PRs, use multiple "Fixes: #<id>" -->
   <!-- Fixes: # -->
   
   <!--- 
******************************************************************************* 
-->
   <!--- NOTE: AUTOMATION USES THE DESCRIPTIONS TO SET LABELS AND PRODUCE 
DOCUMENTATION. -->
   <!--- PLEASE PUT AN 'X' in only **ONE** box -->
   <!--- 
******************************************************************************* 
-->
   
   ### Types of changes
   
   - [ ] Breaking change (fix or feature that would cause existing 
functionality to change)
   - [ ] New feature (non-breaking change which adds functionality)
   - [ ] Bug fix (non-breaking change which fixes an issue)
   - [x] Enhancement (improves an existing feature and functionality)
   - [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
   - [ ] Build/CI
   - [ ] Test (unit or integration test code)
   
   ### Feature/Enhancement Scale or Bug Severity
   
   #### Feature/Enhancement Scale
   
   - [ ] Major
   - [ ] Minor
   
   #### Bug Severity
   
   - [ ] BLOCKER
   - [ ] Critical
   - [ ] Major
   - [ ] Minor
   - [ ] Trivial
   
   ### Screenshots (if appropriate):
   
   ### How Has This Been Tested?
   
   <!-- Please describe in detail how you tested your changes. -->
   <!-- Include details of your testing environment, and the tests you ran to 
-->
   
   #### How did you try to break this feature and the system with this change?
   
   <!-- see how your change affects other areas of the code, etc. -->
   
   <!-- Please read the 
[CONTRIBUTING](https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md) 
document -->
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to