Uh oh!
There was an error while loading. Please reload this page.
Don't allow assign VM to backup offering for VM with encrypted volumes - #13229
Conversation
sureshanaparti
commented
May 25, 2026
@blueorangutan package |
blueorangutan
commented
May 25, 2026
@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@## 4.22 #13229 +/- ##
============================================
- Coverage 17.67% 17.67% -0.01% + Complexity 15792 15790 -2
============================================
Files 5922 5922 Lines 533165 533170 +5 Branches 65208 65210 +2 ============================================
- Hits 94242 94223 -19 - Misses 428276 428301 +25 + Partials 10647 10646 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
blueorangutan
commented
May 25, 2026
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 18012 |
DaanHoogland
commented
May 26, 2026
@blueorangutan test |
blueorangutan
commented
May 26, 2026
@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
blueorangutan
commented
May 26, 2026
[SF] Trillian Build Failed (tid-16177) |
kiranchavala
commented
Jun 2, 2026
@blueorangutan test |
blueorangutan
commented
Jun 2, 2026
@kiranchavala a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
blueorangutan
commented
Jun 2, 2026
[SF] Trillian test result (tid-16238)
|
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| List<VolumeVO> volumes = volumeDao.findByInstance(vmId); | ||
| for (VolumeVO volume : volumes) { | ||
| if (volume != null && volume.getPassphraseId() != null) { | ||
| throw new CloudRuntimeException("VM has encrypted volumes, backup offering assignment is not allowed"); | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Move this to NasBackupProvider.java in backupProvider.assignVMToBackupOffering.
We want to disable backup for encrypted volume for just nas backup provider.
| when(volume.getPassphraseId()).thenReturn(42L); | ||
| try (MockedStatic<UsageEventUtils> ignored2 = Mockito.mockStatic(UsageEventUtils.class)) { | ||
| backupManager.assignVMToBackupOffering(vmId, offeringId); |
There was a problem hiding this comment.
Nit: assignVMToBackupOffering is expected to throw here, so the verify(vmInstanceDao, times(1)).findById(vmId) call right after it is unreachable, dead code.
Description
This PR does't allow assign VM to backup offering for VM with encrypted volumes.
Fixes#13197
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
When tried to create backup without a backup offering assigned, it fails with "VM has not backup offering configured, cannot create backup"
How did you try to break this feature and the system with this change?