Address review feedback on #12843 (verified with a stubbed self-test):
- domjobinfo 'Failed' branch: exit after cleanup instead of looping until
BACKUP_TIMEOUT (the loop never broke on a failed virsh job).
- backup_stopped_vm qemu-img convert failure: exit after cleanup so a partial
backup is not treated as success; append to the agent log instead of truncating.
- backup_stopped_vm success: unmount before returning, mirroring backup_running_vm/
delete_backup. Without this the 'trap cleanup EXIT' fired on success and ran
'rm -rf $dest', deleting the just-completed backup.
- mount_operation: test mount's own exit in an if-condition so 'set -eo pipefail'
no longer aborts before the check and a piped tee can't mask a mount failure.
- cleanup: only umount when the path is actually a mount, so a non-mount umount
error doesn't wrongly report EXIT_CLEANUP_FAILED via the EXIT trap.
Three independent reliability fixes for the KVM NAS backup script, layered on
top of the existing quiesce + EXIT_CLEANUP_FAILED groundwork:
1. BACKUP_TIMEOUT env var (default 6h) bounds the libvirt domjobinfo wait
loop in backup_running_vm. Today a stuck QEMU backup holds the agent's
command slot until the orchestrator-level timeout fires. The new guard
issues domjobabort and exits non-zero so the agent reclaims the slot
promptly.
2. MIN_FREE_SPACE env var (default 1 GiB) + check_free_space() runs after
mount and before any qemu-img convert in both backup_running_vm and
backup_stopped_vm. Fail-fast on a near-full NAS instead of failing
mid-write halfway through a multi-GiB convert.
3. trap cleanup EXIT replaces the six explicit cleanup() call sites as the
primary cleanup mechanism so orphan NFS mounts no longer accumulate when
the script dies to SIGTERM, SIGINT, or any uncaught set -e failure
between the explicit call sites. cleanup() is now guarded by
CLEANUP_DONE so the trap doesn't re-run an already-completed cleanup
from an explicit call.
cleanup() additionally resumes the VM if it's still paused — backup-begin
holds the guest paused briefly and a failed backup mid-pause currently
leaves the guest stuck in 'paused' state until an operator intervenes.
Targets main; supersedes the 4.20-targeted version of this PR.
* 4.22:
VM Deployment using snapshot in new zone (#13178)
Change exception treatment on incremental snapshot wait (#12665)
Move checkRoleEscalation outside DB transaction in createAccount (#13044)
Fix/flasharray delete rename destroy patch conflict (#13049)
Fix VPC network offerings listing in isolated network creation form (#12645)
systemvm: accept ipv6 established/related return traffic (#13173)
update debian change log
Updating pom.xml version numbers for release 4.22.2.0-SNAPSHOT
Updating pom.xml version numbers for release 4.22.1.0
Update suse15 packaging spec, use qemu-ovmf-x86_64 package instead of edk2-ovmf for agent (#13133)
Change disk-only VM snapshot removal message (#11182)
Update mysql java connector version to 8.4.0 (matching version for MySQL 8.4) (#12640)
adaptive: honor user-provided capacityBytes when provider stats are unavailable (#13059)
Flexibilize public IP selection (#11076)
* 4.20:
Fix/flasharray delete rename destroy patch conflict (#13049)
Fix VPC network offerings listing in isolated network creation form (#12645)
Update mysql java connector version to 8.4.0 (matching version for MySQL 8.4) (#12640)
adaptive: honor user-provided capacityBytes when provider stats are unavailable (#13059)
Flexibilize public IP selection (#11076)
* Update qemu-ovmf-x86_64 package in agent for suse instead of edk2-ovmf for agent
* Maintain separate properties file for suse15 (UEFI properties are different for suse15)
* Maintain separate packaging spec for suse15
* Host HA code improvements
* Fix to not cancel VM HA items when Host HA is enabled & inspection in progress, and some code improvements
- When Host HA inspection in progress, the investigor returns the Host Status as Up which cancels the VM HA items
- Don't cancel the VM HA items, instead reschedule them to try again later
* Changes to consider Recovered/Available Host HA state along with the agent connection status to determine the Host HA inspection in progress or not, and some code improvements
* MySQL 8.4 support / update mysql java connector version to 8.4.0
* Remove separate connector version
* Update cloud spec
* Update authentication plugin to caching_sha2_password (mysql_native_password is deprecated)
* Refactoring Allocator classes
* Break into smaller methods random and firfit allocators.
* Added unit tests for random and firstfit allocators
* Move random allocator from cloud-plugins to cloud-server
* Add BaseAllocator abstract class for duplicate code
* Add missing license
* Add missing license to unit test file
* Remove host allocator random dependency
* Change exception message on smoke tests
* Remove conditional as it was never actually reached in the original flow
* Fix tests
* Fix flipped parameters
* Fix NPE while listing hosts for migration when suitableHosts is null
* Remove unnecessary stubbings
* Fix checkstyle
* Remove unnecessary file
* Rename exception error messages
* Apply suggestions from code review
Co-authored-by: Fabricio Duarte <fabricio.duarte.jr@gmail.com>
* Rename UserVmDetailVO references to VMInstanceDetailVO
* Remove unused imports
* Add new line at EOF
* Remove unnecessary random allocator pom
* Fix GPU allocation mistake
* Fix failing tests
---------
Co-authored-by: Fabricio Duarte <fabricio.duarte@scclouds.com.br>
Co-authored-by: Fabricio Duarte <fabricio.duarte.jr@gmail.com>