MitchDrage opened a new pull request, #14305: URL: https://github.com/apache/cloudstack/pull/14305
### Description Fixes #14295, one commit per issue: 1. **Failed scheduled backup shown as MANUAL.** When cleanup fails, the NAS provider keeps the backup row in Error state, but the schedule id was only written on success. The provider now returns that row and `BackupManagerImpl` records the schedule id, name and description on it. 2. **Guest agent timeout not configurable.** New zone-scoped setting `nas.backup.quiesce.agent.timeout` (default 30 seconds, 0 keeps libvirt's default of 5), passed to `nasbackup.sh` as `--quiesce-timeout` and on to `virsh --timeout` for freeze and thaw. The per-VM override from the issue is left out. 3. **cleanup() removing the destination under a running job.** `cleanup()` now runs `virsh domjobabort` and waits up to 60 seconds for the job to end. If it is still running, the files and mount are left in place and the backup goes to Error state. Also fixed the `Failed` branch of the job polling loop, which called `cleanup` without exiting. 4. **Failed freeze never thawed.** The script now always thaws after a freeze attempt and logs the freeze error. A failed thaw only fails the backup if the freeze succeeded, so VMs without a guest agent still get an unquiesced backup. ### Types of changes - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] New feature (non-breaking change which adds functionality) - [x] Bug fix (non-breaking change which fixes an issue) - [ ] Enhancement (improves an existing feature and functionality) - [ ] Cleanup (Code refactoring and cleanup, that may add test cases) - [ ] Build/CI - [x] Test (unit or integration test code) ### Feature/Enhancement Scale or Bug Severity #### Bug Severity - [ ] BLOCKER - [ ] Critical - [x] Major - [ ] Minor - [ ] Trivial I've listed this as major as I'm having backups continuously fail. I've applied the timeout to nasbackup.sh by hand as a workaround and I'm waiting on the next scheduled run to confirm it. I'll add a comment tomorrow as to the result, or add some changes to fix it. ### How Has This Been Tested? - **Unit tests**: new cases in `BackupManagerTest`, `NASBackupProviderTest` and a new `LibvirtTakeBackupCommandWrapperTest`. These and the NAS plugin suite pass. - **Script**: ran `nasbackup.sh` against stub `virsh`/`mount` commands for each failure path, including an abort that never completes. - **Real host** (4.22.1.1, libvirt 11.10.0, QEMU 10.1.0, NFS repository): a quiesced backup with `--timeout 30` on freeze and thaw completed. Separately, aborting a running push backup ended the job about 1.4 seconds after `domjobabort` returned, after which the destination could be removed and unmounted. #### How did you try to break this feature and the system with this change? - **Simulated:** Guest agent not running, with quiesce on: freeze and thaw both fail, and the backup still completes unquiesced. - **Simulated:** Thaw failing after a successful freeze: the job is aborted before the destination is removed and unmounted. - **Simulated:** An abort that never completes: the files and mount are left alone and the backup goes to Error state. - **Simulated:** libvirt reporting the job as Failed: the script now exits. The original kept polling. - **Real host:** Aborting a backup mid-copy: the VM was unaffected and QEMU released the files within about 1.4 seconds. -- 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]
