Introduce new backup provider (KBOSS)#12758
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #12758 +/- ##
============================================
+ Coverage 18.01% 18.18% +0.17%
- Complexity 16607 16966 +359
============================================
Files 6029 6091 +62
Lines 542160 547494 +5334
Branches 66451 66972 +521
============================================
+ Hits 97682 99578 +1896
- Misses 433461 436781 +3320
- Partials 11017 11135 +118
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@JoaoJandre just heads up - my colleagues have been working on an incremental backup feature for NAS B&R (using nbd/qemu bitmap tracking & checkpoints). We're also working on a new Veeam-KVM integration for CloudStack whose PR may may be out soon. My colleagues can further help review and advise on this. /cc @weizhouapache @abh1sar @shwstppr @sureshanaparti @DaanHoogland @harikrishna-patnala Just my 2cents on the design & your comments - NAS is more than just NFS, but any (mountable) shared storage such as CephFS, cifs/samba etc. Enterprise users usually don't want to mix using secondary storage with backup repositories, which is why NAS B&R introduced a backup-provider agnostic concept of backup repositories which can be explored by other backup providers. |
At the time of writing that part, I believe it was only NFS that was supported. I'll update the relevant part.
The secondary storage selector feature (introduced in 2023 by #7659) allows you to specialize secondary storages. This PR extended the feature so that you may also create selectors for backups. |
|
Hi Joao, This looks promising. Incremental backups, quick restore and file restore features have been missing from CloudStack KVM. I am having trouble understanding some of the design choices though:
|
Hello, @abh1sar
I don't see why we should force the coupling of backup offerings with backup repositories, what is the benefit?
The secondary storage also has both features. Although the capacity is not reported to the users currently.
The secondary storage selectors feature (introduced in 2023 through #7659) allows you to specialize secondary storages. Quoting from the PR description: Furthermore, my colleagues are working on a feature to allow using alternative secondary storage solutions, such as CephFS, iSCSI and S3, while preserving compatibility with features destined to NFS storages. This feature may be extended in the future to allow essentially any type of secondary storage. Thus, the flexibility for secondary storages will soon grow.
Using any other type of backup-level compression will be worse then using qemu-img compression. This is because when restoring the backup, we must have access to the whole backing chain. If we use other types of compression, we will have to decompress the whole chain before restoring. Using qemu-img, the backing files are still valid and do not need to be decompressed, we actually never have to decompress ever. This is the great benefit of using qemu-img. In any case, here is a brief comparison of using qemu-img with the zstd library and 8 threads and using the
Compression using qemu-img was a lot faster, with a bit smaller compression ratio. Furthermore, we have to consider that the qemu-img compressed image can be used as-is, while the other images must be decompressed, further adding to the processing time of backing up/restoring a backup.
The compression feature is optional, if you are using storage-level compression, you probably will not use backup-level compression. However, many environments do not have storage-level compression, thus having the possibility of backup-level compression is still very interesting.
The compression does not add any interaction with the SSVM.
I did not want to add dozens of parameters to the import backup offering API which are only really going to be used for one provider. This way, the original design of the API is preserved. Furthermore, you may note that the APIs are intentionally not called
There are two main issues with using bitmaps:
At the end of the day, this PR adds a new backup provider option for users. They will be free to choose the provider that best fits their needs. This is one of the reasons why it was done as a new backup provider; KNIB and other backup providers do not have to cancel each-other out. |
|
Hi @JoaoJandre
It has a big benefit for use cases where someone wants multiple tiers of backup storage with different cost and recovery characteristics. For example, long-term archival backups might go to cheap cold storage like tape, while backups that require faster recovery (better RTO) may use more expensive SSD-backed storage. You can have multiple backup offerings for different use cases and VMs can be attached to the required offerings.
Capacity is just for Admins for Backup Repository also, so that is not the issue.
It does have its benefits, but do keep in mind that the decompression cost will be paid by Reads. Also if someone is using a restored VM, they might see the physical size increase disproportionately to the actual data written due to decompression. It's still a useful feature and it's good that it is optional.
If there is possibility these parameters can be added for other providers they should be added to the existing API.
|
|
Hello, @abh1sar
You can have exactly that using this implementation. Essentially backup repositories and secondary storages are the same, with different names. Using selectors, you can have offerings that are tied to specific secondary storages, or you can have offerings that go into multiple storages, it was made to be flexible.
Again, you can have dedicated secondary storages using selectors.
While I was not the one that introduced the backup framework, looking at its design, it was clearly intended to have as little configuration as possible on the ACS side while leaving these details to the backup provider. If we add these parameters to the import backup offering API, I'm sure a lot of users will be confused when they do nothing for Veeam and Dell Networker. I did not intend to warp the original design of configuring the offerings on the provider side and only importing it to ACS. This is why I created the concept of native offerings. As with KNIB (and NAS) the provider is ACS, and thus the configurations can still be made on the "backup provider", and the import API will follow the same logic it always had.
A provider is native if the backup implementation is made by ACS. Thus, the current native providers would be NAS and KNIB. Veeam and Networker are external providers.
They are used to configure the details that would be configured in the backup provider if it was an external provider, such as Veeam for example.
I have yet to add it to the GUI, if you have any suggestions for the GUI design, you are free to give your opinion. The GUI for the native backup offerings will be added in the future.
Again, you absolutely can do this with KNIB. But you may also choose not to do it, its flexible. |
|
@JoaoJandre Would it be possible to change the name Native to something clearer? For example, "Secondary Storage Backup" might be more descriptive and easier for end users to understand. The term "Native" is not commonly used in CloudStack. |
|
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
I don't see any issue with "Native", and I'm not claiming that KNIB is the only "Native" provider. As I explained before:
This PR does not remove or substitute anything, the provider I am proposing is a new option for users to use. |
|
Also. The Validation was added in the last commits. All the features that were meant to be included in this PR are already here. |
We do not use the term "Native" in CloudStack. Plugin names are typically based on the name of the external device or backup repository they integrate with. Please follow the same convention. |
|
Hello, @weizhouapache, all
Yes, we currently do not have any APIs using the term
Yes, that is correct. In the case of the new backup plugin, it is fully implemented by ACS, including backup creation, chain management, compression, validation and other related processes. Therefore, its name is fully coherent with its functionality. In other words, KNIB (KVM Native Incremental Backup) stands for:
Sorry, but is this a established convention? I am not aware of any guideline stating that the term Again, if there is any semantic inconsistency with the plugin name KNIB (KVM Native Incremental Backup), we can address it. However, the plugin supports incremental backups, for KVM, natively in ACS; thus, the name accurately reflects what it delivers. It does not promote any concept or capability that is not actually provided. @JoaoJandre, btw, thanks for all the effort you put into designing and implementing this backup plugin. It will certainly be a stable and efficient solution, with strong adoption across cloud providers and users. |
I don’t want to continue debating this topic, so I’ll just summarize my view:
|
|
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
|
@vishesh92 I finished adding tests. |
|
@blueorangutan package |
|
@JoaoJandre a [SL] Jenkins job has been kicked to build packages. It will be bundled with no SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 17573 |
|
@blueorangutan package |
|
@JoaoJandre a [SL] Jenkins job has been kicked to build packages. It will be bundled with no SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 17574 |
There was a problem hiding this comment.
Pull request overview
Adds a new internal incremental backup provider for KVM (“KBOSS”), including support for isolated backups, backup-chain management, compression, and validation (incl. screenshot download), plus UI and API enhancements to expose these capabilities.
Changes:
- Introduces KBOSS backup plugin/module and internal-backup service plumbing (providers registry, DAOs/views, job types/controllers).
- Extends backup APIs/models to support compression/validation states, quick restore, isolated backups, screenshot download, and finishing backup chains.
- Updates KVM agent/storage flows and UI to handle new backup lifecycle, status display, and new API parameters.
Reviewed changes
Copilot reviewed 233 out of 235 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| utils/src/main/java/com/cloud/utils/exception/BackupProviderException.java | Adds provider-specific runtime exception |
| utils/src/main/java/com/cloud/utils/exception/BackupException.java | Adds backup exception carrying VM consistency flag |
| utils/src/main/java/com/cloud/utils/DateUtil.java | Adds system-timezone timestamp helper |
| ui/src/views/storage/CreateVMFromBackup.vue | UI option to request quick restore when creating VM from backup |
| ui/src/views/compute/backup/FormSchedule.vue | Adds isolated option to backup scheduling UI |
| ui/src/views/compute/backup/BackupSchedule.vue | Displays isolated column in schedules list |
| ui/src/views/compute/StartBackup.vue | Adds isolated flag (KBOSS) and enables quiesce for KBOSS |
| ui/src/views/compute/InstanceTab.vue | Shows backup compression/validation status columns |
| ui/src/views/AutogenView.vue | Filters hosts for restoreBackup to enabled/up |
| ui/src/config/section/storage.js | Adds backup status columns + quickrestore/hostid args for restore |
| ui/src/components/widgets/Status.vue | Maps compression/validation states to badge statuses |
| ui/src/components/view/ListView.vue | Renders compression/validation status via Status widget |
| ui/public/locales/pt_BR.json | Adds i18n labels for compression/validation/quickrestore |
| ui/public/locales/en.json | Adds i18n labels for compression/validation/quickrestore |
| tools/marvin/marvin/lib/base.py | Adds marvin helpers for createBackupOffering + screenshot download |
| tools/apidoc/gen_toc.py | Adds API doc TOC mapping for downloadValidationScreenshot |
| server/src/test/java/org/apache/cloudstack/storage/heuristics/HeuristicRuleHelperTest.java | Adds unit test coverage for BACKUP heuristic type |
| server/src/test/java/com/cloud/vpc/dao/MockNetworkDaoImpl.java | Adds stub for new NetworkDao method |
| server/src/test/java/com/cloud/vpc/MockResourceLimitManagerImpl.java | Updates mock signatures for resource limit service changes |
| server/src/test/java/com/cloud/template/TemplateManagerImplTest.java | Adds BackupOfferingDao mock bean |
| server/src/test/java/com/cloud/network/as/AutoScaleManagerImplTest.java | Updates startVirtualMachine invocation signature |
| server/src/main/resources/META-INF/cloudstack/core/spring-server-core-managers-context.xml | Wires internal backup + compression/validation controllers |
| server/src/main/java/org/apache/cloudstack/vm/UnmanagedVMsManagerImpl.java | Updates resource-limit calls with new params |
| server/src/main/java/org/apache/cloudstack/storage/heuristics/presetvariables/PresetVariables.java | Adds backup preset variable holder |
| server/src/main/java/org/apache/cloudstack/storage/heuristics/presetvariables/Backup.java | Adds Backup preset variable model |
| server/src/main/java/org/apache/cloudstack/storage/heuristics/HeuristicRuleHelper.java | Adds BACKUP heuristics support and preset variable injection |
| server/src/main/java/org/apache/cloudstack/command/ReconcileCommandServiceImpl.java | Updates destroyVolume call signature |
| server/src/main/java/com/cloud/vm/UserVmManager.java | Adds validation VM config key + quickRestore param to start methods |
| server/src/main/java/com/cloud/storage/StorageManagerImpl.java | Updates decrement call + config keys list |
| server/src/main/java/com/cloud/network/as/AutoScaleManagerImpl.java | Updates startVirtualMachine call signature |
| server/src/main/java/com/cloud/hypervisor/KVMGuru.java | Adjusts restore/import flows with backup provider context |
| server/src/main/java/com/cloud/hypervisor/HypervisorGuruBase.java | Updates backup import/attach signatures |
| server/src/main/java/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java | Allows console assignment during backup-related VM states |
| server/src/main/java/com/cloud/api/ApiResponseHelper.java | Adds isolated field to BackupScheduleResponse |
| plugins/storage/volume/default/src/main/java/org/apache/cloudstack/storage/datastore/driver/CloudStackPrimaryDataStoreDriverImpl.java | Passes chain info into delete/revert commands for cleanup |
| plugins/storage/sharedfs/storagevm/src/main/java/org/apache/cloudstack/storage/sharedfs/lifecycle/StorageVmSharedFSLifeCycle.java | Updates destroyVolume signature |
| plugins/storage/image/default/src/main/java/org/apache/cloudstack/storage/datastore/driver/CloudStackImageStoreDriverImpl.java | Hardens extract URL object-name logic |
| plugins/pom.xml | Adds backup/kboss module |
| plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/guru/VMwareGuru.java | Updates backup import/attach signatures |
| plugins/hypervisors/simulator/src/main/java/com/cloud/simulator/SimulatorGuru.java | Updates backup import/attach signatures |
| plugins/hypervisors/kvm/src/test/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtRevertSnapshotCommandWrapperTest.java | Updates tests for new revert signature |
| plugins/hypervisors/kvm/src/test/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtGetVolumesOnStorageCommandWrapperTest.java | Updates tests for new getStoragePool signature |
| plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java | Updates qemu-img convert invocation/signature usage |
| plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/KVMStorageProcessor.java | Adds backup delta delete + chain cleanup behaviors |
| plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/KVMStoragePoolManager.java | Adds addDetails option + synchronizes pool methods |
| plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtTakeBackupHashCommandWrapper.java | Adds agent-side backup hashing command |
| plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtStartCommandWrapper.java | Mounts secondary storages for start flows and cleans them up on failure |
| plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtRevertSnapshotCommandWrapper.java | Supports deleting leftover backup delta during revert |
| plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtGetVolumesOnStorageCommandWrapper.java | Updates getStoragePool signature usage |
| plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtGetStorageStatsCommandWrapper.java | Updates getStoragePool signature usage |
| plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtFinalizeBackupCompressionCommandWrapper.java | Finalizes/completes compressed delta files and reports size |
| plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtConsolidateVolumesCommandWrapper.java | Consolidates volumes and releases mounted secondary storages |
| plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtCleanupKbossValidationCommandWrapper.java | Cleans secondary storage refs after validation VM shutdown |
| plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtVMDef.java | Tracks backing store chain list per disk |
| plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtStorageVolumeXMLParser.java | Adds helper to read backing file name from volume XML |
| plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtDomainXMLParser.java | Parses backing store chain from domain XML |
| plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/BlockCommitListener.java | Adjusts block commit event handling/logging |
| plugins/hypervisors/kvm/pom.xml | Adds new dependencies used by backup/validation features |
| plugins/hypervisors/hyperv/src/main/java/com/cloud/hypervisor/hyperv/resource/HypervDirectConnectResource.java | Updates StartCommand secondary storage field to list |
| plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/HypervResourceController.cs | Updates StartCommand handling for secondary storages list |
| plugins/backup/veeam/src/main/java/org/apache/cloudstack/backup/VeeamBackupProvider.java | Updates provider interface signatures (quick restore, isolated) |
| plugins/backup/networker/src/main/java/org/apache/cloudstack/backup/NetworkerBackupProvider.java | Updates provider interface signatures (quick restore, isolated) |
| plugins/backup/nas/src/test/java/org/apache/cloudstack/backup/NASBackupProviderTest.java | Updates test for new takeBackup signature |
| plugins/backup/nas/src/main/java/org/apache/cloudstack/backup/NASBackupProvider.java | Updates provider interface signatures (quick restore, isolated) |
| plugins/backup/kboss/src/main/resources/META-INF/cloudstack/kboss/spring-backup-kboss-context.xml | Registers KBOSS backup provider bean |
| plugins/backup/kboss/src/main/resources/META-INF/cloudstack/kboss/module.properties | Declares KBOSS plugin module metadata |
| plugins/backup/kboss/pom.xml | Adds new KBOSS plugin Maven module |
| plugins/backup/dummy/src/main/java/org/apache/cloudstack/backup/DummyBackupProvider.java | Updates provider interface signatures (quick restore, isolated) |
| framework/jobs/src/main/java/org/apache/cloudstack/framework/jobs/impl/VmWorkJobVO.java | Adds constructor for VM work job creation |
| engine/storage/volume/src/main/java/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java | Cleans up backup metadata on volume delete; updates resource count call |
| engine/storage/src/main/java/org/apache/cloudstack/storage/vmsnapshot/VMSnapshotHelper.java | Adds helper to fetch associated snapshots for KVM disk-only VM snapshots |
| engine/storage/src/main/java/org/apache/cloudstack/storage/helper/VMSnapshotHelperImpl.java | Implements new helper and adjusts volume TO building |
| engine/storage/snapshot/src/test/java/org/apache/cloudstack/storage/vmsnapshot/VMSnapshotStrategyKVMTest.java | Adds SnapshotDataStoreDao mock bean |
| engine/storage/snapshot/src/main/java/org/apache/cloudstack/storage/vmsnapshot/StorageVMSnapshotStrategy.java | Prevents using strategy when incremental snapshots exist |
| engine/storage/snapshot/src/main/java/org/apache/cloudstack/storage/snapshot/SnapshotServiceImpl.java | Cleans backup metadata after snapshot revert paths |
| engine/storage/datamotion/src/main/java/org/apache/cloudstack/storage/motion/StorageSystemDataMotionStrategy.java | Updates internal backup metadata on volume ID changes |
| engine/schema/src/main/resources/META-INF/db/views/cloud.internal_backup_view.sql | Adds internal backup DB view for KBOSS |
| engine/schema/src/main/resources/META-INF/cloudstack/core/spring-engine-schema-core-daos-context.xml | Registers internal backup-related DAOs |
| engine/schema/src/main/java/org/apache/cloudstack/storage/datastore/db/SnapshotDataStoreDao.java | Adds expunge-by-snapshot API |
| engine/schema/src/main/java/org/apache/cloudstack/backup/dao/InternalBackupStoragePoolDaoImpl.java | Adds DAO for internal backup pool refs |
| engine/schema/src/main/java/org/apache/cloudstack/backup/dao/InternalBackupStoragePoolDao.java | Adds DAO interface for internal backup pool refs |
| engine/schema/src/main/java/org/apache/cloudstack/backup/dao/InternalBackupServiceJobDao.java | Adds DAO interface for internal backup service jobs |
| engine/schema/src/main/java/org/apache/cloudstack/backup/dao/InternalBackupJoinDao.java | Adds join DAO for internal backup view |
| engine/schema/src/main/java/org/apache/cloudstack/backup/dao/InternalBackupDataStoreDaoImpl.java | Adds DAO for internal backup store refs |
| engine/schema/src/main/java/org/apache/cloudstack/backup/dao/InternalBackupDataStoreDao.java | Adds DAO interface for internal backup store refs |
| engine/schema/src/main/java/org/apache/cloudstack/backup/dao/BackupOfferingDaoImpl.java | Includes offering details map in API response |
| engine/schema/src/main/java/org/apache/cloudstack/backup/dao/BackupDetailsDaoImpl.java | Adds helper to remove all details except one |
| engine/schema/src/main/java/org/apache/cloudstack/backup/dao/BackupDetailsDao.java | Adds backup detail key constants + removeDetailsExcept |
| engine/schema/src/main/java/org/apache/cloudstack/backup/dao/BackupDaoImpl.java | Adds query helpers (latest by status) |
| engine/schema/src/main/java/org/apache/cloudstack/backup/dao/BackupDao.java | Adds DAO method to find latest backup by status+VM |
| engine/schema/src/main/java/org/apache/cloudstack/backup/InternalBackupServiceJobType.java | Adds service job type enum |
| engine/schema/src/main/java/org/apache/cloudstack/backup/InternalBackupDataStoreVO.java | Adds VO for internal_backup_store_ref |
| engine/schema/src/main/java/org/apache/cloudstack/backup/BackupVO.java | Adds compression/validation status fields and sizes |
| engine/schema/src/main/java/org/apache/cloudstack/backup/BackupScheduleVO.java | Adds isolated to backup schedule entity |
| engine/schema/src/main/java/org/apache/cloudstack/backup/BackupOfferingVO.java | Adds constructor for internally-created offerings |
| engine/schema/src/main/java/com/cloud/storage/SnapshotVO.java | Adds setter for removed timestamp |
| engine/schema/src/main/java/com/cloud/network/dao/NetworkDaoImpl.java | Adds query helper to find network by zone/account/guest type |
| engine/schema/src/main/java/com/cloud/network/dao/NetworkDao.java | Adds DAO method signature for network lookup |
| engine/schema/src/main/java/com/cloud/host/dao/HostDaoImpl.java | Adds routing host list helpers |
| engine/schema/src/main/java/com/cloud/host/dao/HostDao.java | Adds routing host list method signatures |
| engine/orchestration/src/main/resources/META-INF/cloudstack/core/spring-engine-orchestration-core-context.xml | Registers InternalBackupService for orchestration extensions |
| engine/orchestration/src/main/java/com/cloud/vm/VirtualMachineManagerImpl.java | Adjusts VM start flow and resource-limit signatures |
| engine/components-api/src/main/java/com/cloud/vm/VmWorkTakeBackup.java | Adds VM work payload for taking backups |
| engine/components-api/src/main/java/com/cloud/vm/VmWorkRestoreVolumeBackupAndAttach.java | Adds VM work payload for volume restore+attach |
| engine/components-api/src/main/java/com/cloud/vm/VmWorkRestoreBackup.java | Adds VM work payload for restoring backups |
| engine/components-api/src/main/java/com/cloud/vm/VmWorkDeleteBackup.java | Adds VM work payload for deleting backups |
| engine/components-api/src/main/java/com/cloud/storage/StorageManager.java | Adds agent max data migration wait-time config |
| engine/api/src/main/java/org/apache/cloudstack/engine/orchestration/service/VolumeOrchestrationService.java | Extends createVolumeOnPrimaryStorage signature |
| core/src/main/resources/META-INF/cloudstack/core/spring-core-registry-core-context.xml | Adds internal backup providers registry bean |
| core/src/main/resources/META-INF/cloudstack/backup/spring-core-lifecycle-backup-context-inheritable.xml | Adds lifecycle registry for InternalBackupProvider |
| core/src/main/java/org/apache/cloudstack/storage/to/VolumeObjectTO.java | Makes VolumeObjectTO Serializable |
| core/src/main/java/org/apache/cloudstack/storage/to/DeltaMergeTreeTO.java | Renames/extends merge-tree TO for deltas |
| core/src/main/java/org/apache/cloudstack/storage/command/RevertSnapshotCommand.java | Adds deleteChain flag to revert snapshot |
| core/src/main/java/org/apache/cloudstack/storage/command/DeleteCommand.java | Adds deleteChain flag to delete command |
| core/src/main/java/org/apache/cloudstack/storage/command/BackupDeleteAnswer.java | Adds answer type that exposes backupId on delete |
| core/src/main/java/org/apache/cloudstack/backup/ValidateKbossVmAnswer.java | Adds validation answer payload (boot/screenshot/script) |
| core/src/main/java/org/apache/cloudstack/backup/TakeKbossBackupCommand.java | Adds agent command to take KBOSS backup |
| core/src/main/java/org/apache/cloudstack/backup/TakeKbossBackupAnswer.java | Adds answer payload for KBOSS backup results |
| core/src/main/java/org/apache/cloudstack/backup/TakeBackupHashCommand.java | Adds agent command to hash backup delta chain |
| core/src/main/java/org/apache/cloudstack/backup/RestoreKbossBackupCommand.java | Adds agent command to restore KBOSS backup |
| core/src/main/java/org/apache/cloudstack/backup/RestoreKbossBackupAnswer.java | Adds answer payload including mounted secondary UUIDs |
| core/src/main/java/org/apache/cloudstack/backup/PrepareValidationCommand.java | Adds agent command to prepare validation environment |
| core/src/main/java/org/apache/cloudstack/backup/FinalizeBackupCompressionCommand.java | Adds agent command to finalize compression |
| core/src/main/java/org/apache/cloudstack/backup/ConsolidateVolumesCommand.java | Adds agent command to consolidate volumes |
| core/src/main/java/org/apache/cloudstack/backup/ConsolidateVolumesAnswer.java | Adds answer payload listing successful consolidations |
| core/src/main/java/org/apache/cloudstack/backup/CompressBackupCommand.java | Adds agent command to compress backup deltas |
| core/src/main/java/org/apache/cloudstack/backup/CleanupKbossValidationCommand.java | Adds agent command to cleanup validation mounts |
| core/src/main/java/org/apache/cloudstack/backup/CleanupKbossBackupErrorCommand.java | Adds agent command to cleanup backup-error state |
| core/src/main/java/org/apache/cloudstack/backup/CleanupKbossBackupErrorAnswer.java | Adds answer payload for backup-error cleanup |
| core/src/main/java/com/cloud/storage/resource/StorageSubsystemCommandHandlerBase.java | Routes BACKUP delete to storage processor |
| core/src/main/java/com/cloud/storage/resource/StorageProcessor.java | Adds default deleteBackup handler |
| core/src/main/java/com/cloud/agent/api/storage/MergeDiskOnlyVmSnapshotCommand.java | Updates merge command to use DeltaMergeTreeTO |
| core/src/main/java/com/cloud/agent/api/storage/CreateDiskOnlyVmSnapshotCommand.java | Updates disk-only snapshot command payload |
| core/src/main/java/com/cloud/agent/api/storage/CreateDiskOnlyVmSnapshotAnswer.java | Updates disk-only snapshot answer payload |
| core/src/main/java/com/cloud/agent/api/StartCommand.java | Changes secondary storage field to list |
| core/src/main/java/com/cloud/agent/api/MigrateBetweenSecondaryStoragesCommandAnswer.java | Adds answer type for secondary migration results |
| core/src/main/java/com/cloud/agent/api/MigrateBetweenSecondaryStoragesCommand.java | Adds base command for secondary migrations |
| core/src/main/java/com/cloud/agent/api/MigrateBackupsBetweenSecondaryStoragesCommand.java | Adds command for migrating backup chains across secondary |
| client/pom.xml | Adds KBOSS plugin artifact to client bundle |
| api/src/main/java/org/apache/cloudstack/secstorage/heuristics/HeuristicType.java | Adds BACKUP heuristic type |
| api/src/main/java/org/apache/cloudstack/query/QueryService.java | Adds listBackupServiceJobs query endpoint + readonly VM details |
| api/src/main/java/org/apache/cloudstack/backup/InternalBackupService.java | Adds internal backup service API contract |
| api/src/main/java/org/apache/cloudstack/backup/BackupSchedule.java | Adds isolated flag to schedule interface |
| api/src/main/java/org/apache/cloudstack/backup/BackupProvider.java | Extends provider interface for isolated/quick restore |
| api/src/main/java/org/apache/cloudstack/backup/Backup.java | Adds compression/validation enums and new getters |
| api/src/main/java/org/apache/cloudstack/api/response/BackupServiceJobResponse.java | Adds response model for backup service jobs |
| api/src/main/java/org/apache/cloudstack/api/response/BackupScheduleResponse.java | Adds isolated field in schedule response |
| api/src/main/java/org/apache/cloudstack/api/response/BackupResponse.java | Adds compression/validation/uncompressed size fields |
| api/src/main/java/org/apache/cloudstack/api/response/BackupOfferingResponse.java | Adds details map to offering response |
| api/src/main/java/org/apache/cloudstack/api/command/user/volume/DestroyVolumeCmd.java | Updates destroyVolume call signature |
| api/src/main/java/org/apache/cloudstack/api/command/user/volume/DeleteVolumeCmd.java | Updates destroyVolume call signature |
| api/src/main/java/org/apache/cloudstack/api/command/user/vm/DestroyVMCmd.java | Adds ctors and updates destroyVm signature |
| api/src/main/java/org/apache/cloudstack/api/command/user/vm/CreateVMFromBackupCmd.java | Adds quickrestore parameter |
| api/src/main/java/org/apache/cloudstack/api/command/user/vm/BaseDeployVMCmd.java | Widens visibility for reuse in admin cmd |
| api/src/main/java/org/apache/cloudstack/api/command/user/network/CreateNetworkCmd.java | Adds ctor overload for tests/usage |
| api/src/main/java/org/apache/cloudstack/api/command/user/backup/RestoreVolumeFromBackupAndAttachToVMCmd.java | Adds quickrestore + hostid parameters |
| api/src/main/java/org/apache/cloudstack/api/command/user/backup/RestoreBackupCmd.java | Adds quickrestore + hostid parameters |
| api/src/main/java/org/apache/cloudstack/api/command/user/backup/FinishBackupChainCmd.java | Adds API to finish a VM’s backup chain |
| api/src/main/java/org/apache/cloudstack/api/command/user/backup/DownloadValidationScreenshotCmd.java | Adds API to download validation screenshot |
| api/src/main/java/org/apache/cloudstack/api/command/user/backup/CreateBackupScheduleCmd.java | Adds isolated parameter |
| api/src/main/java/org/apache/cloudstack/api/command/user/backup/CreateBackupCmd.java | Adds isolated parameter |
| api/src/main/java/org/apache/cloudstack/api/command/admin/volume/DestroyVolumeCmdByAdmin.java | Updates destroyVolume call signature |
| api/src/main/java/org/apache/cloudstack/api/command/admin/vm/CreateVMFromBackupCmdByAdmin.java | Adds ctor convenience for admin flow |
| api/src/main/java/org/apache/cloudstack/alert/AlertService.java | Adds alert types for validation failures |
| api/src/main/java/com/cloud/vm/VmDetailConstants.java | Adds KBOSS validation-related VM detail keys |
| api/src/main/java/com/cloud/vm/VirtualMachine.java | Adds VM states/events for backup/restore error flows |
| api/src/main/java/com/cloud/vm/UserVmService.java | Extends destroyVm signature with checkExpunge |
| api/src/main/java/com/cloud/user/ResourceLimitService.java | Extends resource counting APIs with display-false behavior |
| api/src/main/java/com/cloud/storage/VolumeApiService.java | Extends attach/destroy APIs for restore/limits behavior |
| api/src/main/java/com/cloud/storage/Volume.java | Adds volume states/events for consolidation/restore errors |
| api/src/main/java/com/cloud/storage/Storage.java | Adds PNG image format |
| api/src/main/java/com/cloud/hypervisor/HypervisorGuru.java | Extends backup import/attach signatures |
| api/src/main/java/com/cloud/event/EventTypes.java | Adds event type for screenshot download |
| api/src/main/java/com/cloud/agent/api/to/DataObjectType.java | Adds BACKUP data object type |
| agent/src/main/java/com/cloud/agent/properties/AgentProperties.java | Adds host-level backup validation/compression concurrency properties |
| agent/conf/agent.properties | Documents new agent properties |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Thanks @JoaoJandre |
|
@blueorangutan package |
|
@JoaoJandre a [SL] Jenkins job has been kicked to build packages. It will be bundled with no SystemVM templates. I'll keep you posted as I make progress. |

Description
This PR adds a new incremental backup provider for KVM. This provider does not need any external plugins or integrations. The design document which goes into details of the implementation can be found on https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=406622120.
The validation process which is detailed in the design document will be added to this PR soon.The validation process is already in this PR.The file extraction process will be added in a later PR.
This PR adds a few new APIs:
Since we are proposing a solution where ACS is the provider, we will not have an external ID to inform on the
importBackupOffering. Thus, a new API calledcreateBackupOfferingwill be created, which will define a new backup offering from scratch. It will have the following parameters:The
listBackupServiceJobshas the following parametersidbackupidhostidexecutingparameter is implicitzoneidtypeStartCompression,FinalizeCompressionandBackupValidationexecutingscheduledBy default, lists all jobs that have not been removed.
The API
downloadValidationScreenshotwas added to allow downloading the images generated during the screenshot step. The API has the following parameter:backupIdThe API
finishBackupChainwas added to allow users to force a backup chain on a VM to end. This API may be called on VMs that are on theBackupErrorstate and it will do a best-effort attempt at normalizing the VM and returning it to its original state, as well as finishing the backup chain on the VM. The API has the following parameter:vmIdThe PR also adds parameters to the following APIs:
isolatedparameter was added to thecreateBackupandcreateBackupScheduleAPIsquickRestoreparameter was added to therestoreBackup,restoreVolumeFromBackupAndAttachToVMandcreateVMFromBackupAPIshostIdparameter was added to therestoreBackupandrestoreVolumeFromBackupAndAttachToVMAPIs, which can only be used by root admins and only when quick restore is true.New settings were also added:
backup.chain.sizekboss.timeoutbackup.compression.task.enabledtruebackup.compression.max.concurrent.operations.per.host5backup.compression.max.concurrent.operationsbackup.compression.max.job.retries2backup.compression.retry.interval60backup.compression.timeout28800backup.compression.minimum.free.storage1backup.compression.coroutines1backup.compression.rate.limit0backup.validation.task.enabledtruebackup.validation.interval24backup.validation.max.concurrent.operations10backup.validation.max.concurrent.operations.per.host1backup.validation.boot.default.timeout240backup.validation.script.default.timeout60backup.validation.screenshot.default.wait60backup.validation.end.chain.on.failtrueenforce.resource.limit.on.backup.validation.vmfalseTwo new host-level configurations, configured in
agent.properties, were added:backup.validation.max.concurrent.operations.per.hostandbackup.compression.max.concurrent.operations.per.host. When configured, they override the values set in the global configurations with the same names.Six new VM configurations were added:
backupValidationCommandbackupValidationCommandArgumentsbackupValidationCommandExpectedResult0backupValidationCommandTimeoutbackupValidationScreenshotWaitbackupValidationBootTimeoutBy default, the VM configurations
backupValidationCommandTimeout,backupValidationScreenshotWait, andbackupValidationBootTimeoutare read-only for regular users. This behavior can be changed through the global configurationuser.vm.readonly.details.Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
Tests related to disk-only VM snapshots
Basic tests with backup
Using
backup.chain.size=3Interactions with other functionalities
I created a new VM with a root disk and a data disk for the tests below.
Configuration Tests
Compression Tests
Tests performed with an offer that provides compressed backups support
Validation tests
echoechowith argumentababaecho, argumentababa, and expected outputabsduiYWJhYmEKecho, argumentababa, and expected outputYWJhYmEKecho, argumentababa, and expected outputYWJhYmEKTests with
restoreVolumeFromBackupAndAttachToVMTests with
restoreBackup