Kunalbehbud opened a new pull request, #13020:
URL: https://github.com/apache/cloudstack/pull/13020
### Description
KVM disk-only instance snapshots do not capture the active UEFI NVRAM state,
which makes revert unsafe for UEFI guests.
This PR fixes the KVM disk-only instance snapshot flow to:
- plumb optional NVRAM sidecar metadata through the management and KVM agent
commands
- copy the active UEFI NVRAM file during snapshot creation and restore it
during revert
- clean up the NVRAM sidecar during delete and merge flows
- gate create, revert, and sidecar cleanup on host UEFI/NVRAM capabilities
and clear stale capability details on reconnect
- suspend UEFI guests before copying NVRAM, freezing filesystems first when
`quiescevm=true`
- preserve successful snapshot metadata if post-snapshot thaw/resume fails,
surfacing the issue via warning/alert instead of discarding the snapshot
- reject reverting UEFI disk-only snapshots that do not contain NVRAM state
Older UEFI disk-only snapshots created without an NVRAM sidecar are
intentionally rejected on revert.
This PR only covers `disk-only` instance snapshots for KVM UEFI VMs.
`snapshotMemory=true` / internal snapshots remain out of scope.
### 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
- [ ] Test (unit or integration test code)
### Feature/Enhancement Scale or Bug Severity
#### Feature/Enhancement Scale
- [ ] Major
- [ ] Minor
#### Bug Severity
- [ ] BLOCKER
- [ ] Critical
- [x] Major
- [ ] Minor
- [ ] Trivial
### Screenshots (if appropriate):
N/A
### How Has This Been Tested?
- `mvn -pl
engine/orchestration,engine/storage/snapshot,plugins/hypervisors/kvm -am
-Dtest=AgentManagerImplTest,KvmFileBasedStorageVmSnapshotStrategyTest,LibvirtDiskOnlyVMSnapshotCommandWrapperTest
-Dsurefire.failIfNoSpecifiedTests=false test`
- Live-tested on a 4.22.1 KVM environment with a UEFI VM:
- created a disk-only instance snapshot
- reverted the snapshot and booted the VM successfully
- deleted a parent snapshot and verified the merge path removed the old
NVRAM sidecar
- corrupted the active NVRAM after the merge, reverted again, verified the
active NVRAM checksum matched the snapshot sidecar before boot, and booted
successfully
#### How did you try to break this feature and the system with this change?
- tried reverting a UEFI disk-only snapshot without an NVRAM sidecar and
verified the revert is rejected
- covered stale host capability details on reconnect
- covered the case where freeze verification fails after a successful freeze
and verified cleanup still thaws the guest
- covered post-snapshot thaw/resume failures and verified the snapshot
metadata is preserved while the warning/alert path is exercised
--
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]