Usage: usage generated for destroyed VMs with assigned backup offering#4997
Usage: usage generated for destroyed VMs with assigned backup offering#4997Pearl1594 wants to merge 1 commit into
Conversation
|
@blueorangutan package |
|
@Pearl1594 a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔️ centos7 ✔️ centos8 ✔️ debian. SL-JID 522 |
|
@blueorangutan test |
|
@Pearl1594 a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
cc @olivierlemasle can you help review and test this PR? Thanks |
|
Trillian test result (tid-612)
|
|
Re-kicking tests @blueorangutan test |
|
@shwstppr a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
Sure, I'll be able to look at this (and #4982) tonight (Paris time). Thank you! |
yadvr
left a comment
There was a problem hiding this comment.
LGTM - let's wait for @olivierlemasle 's confirmation and smoketests before merging
olivierlemasle
left a comment
There was a problem hiding this comment.
It should indeed fix the usage bug.
However, this also deletes all backups from deleted VMs, which seems to be breaking change.
Currently, it seems to be possible to restore an expunged VM from a backup (is it really possible @rhtyd? It's not possible with the dummy B&R provider, but it seems to be possible with Veeam, however when I tested it, I got errors). If backups on deleted VMs can indeed be restored, they are still useful and deleting them would be impactful.
|
Trillian test result (tid-613)
|
| if (destroyedVm.getBackupOfferingId() != null) { | ||
| final BackupOfferingVO offering = backupOfferingDao.findById(destroyedVm.getBackupOfferingId()); |
There was a problem hiding this comment.
destroyedVm.getBackupOfferingId() called twice, it could be extracted to a variable.
|
Closing this. Raised #5017 to address the the issue of backup usage records being generated for VMs that are expunged and have no backups present. |
Description
Fixes: #4990
When a VM associated with a backup offering is destroyed/expunged, the backup offering isn't unassigned, hence leading to backup usage generation. This PR fixes/addresses the following:
Types of changes
Feature/Enhancement Scale or Bug Severity
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
Created a VM and assigned a backup offering to it, destroyed the VM and verified no further usage events are generated and events corresponding to "BACKUP.OFFERING.REMOVE" is generated / added in the event table