Pearl1594 commented on a change in pull request #5017:
URL: https://github.com/apache/cloudstack/pull/5017#discussion_r638761289



##########
File path: engine/schema/src/main/java/com/cloud/vm/dao/VMInstanceDaoImpl.java
##########
@@ -613,7 +613,7 @@ boolean ifStateUnchanged(State oldState, State newState, 
Long oldHostId, Long ne
         if (backupOfferingId != null) {
             sc.setParameters("backup_offering_id", backupOfferingId);
         }
-        return listBy(sc);
+        return listIncludingRemovedBy(sc);

Review comment:
       @rhtyd deletion of the offering will fail if the they aren't assigned to 
a VM, but are associated to a backup.

##########
File path: 
server/src/main/java/org/apache/cloudstack/backup/BackupManagerImpl.java
##########
@@ -1030,10 +1031,12 @@ protected void runInContext() {
                                 // Sync out-of-band backups
                                 backupProvider.syncBackups(vm, metric);
                                 // Emit a usage event, update usage metric for 
the VM by the usage server
-                                
UsageEventUtils.publishUsageEvent(EventTypes.EVENT_VM_BACKUP_USAGE_METRIC, 
vm.getAccountId(),
-                                        vm.getDataCenterId(), vm.getId(), 
"Backup-" + vm.getHostName() + "-" + vm.getUuid(),
-                                        vm.getBackupOfferingId(), null, 
metric.getBackupSize(), metric.getDataSize(),
-                                        Backup.class.getSimpleName(), 
vm.getUuid());
+                                if (metric.getBackupSize() > 0) {
+                                    
UsageEventUtils.publishUsageEvent(EventTypes.EVENT_VM_BACKUP_USAGE_METRIC, 
vm.getAccountId(),

Review comment:
       @rhtyd  if the backups are deleted/purged - wouldn't the backup size 
returned by the veeam client reflect the same i.e., be 0. Pardon my ignorance 
on the behavior of veeam client, I have been testing this against the dummy 
provider. 




-- 
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to