mirror of
				https://github.com/apache/cloudstack.git
				synced 2025-10-26 08:42:29 +01:00 
			
		
		
		
	Merge branch '4.20' of https://github.com/apache/cloudstack
This commit is contained in:
		
						commit
						1732f676db
					
				| @ -191,6 +191,9 @@ public class VeeamBackupProvider extends AdapterBase implements BackupProvider, | |||||||
|     public boolean removeVMFromBackupOffering(final VirtualMachine vm) { |     public boolean removeVMFromBackupOffering(final VirtualMachine vm) { | ||||||
|         final VeeamClient client = getClient(vm.getDataCenterId()); |         final VeeamClient client = getClient(vm.getDataCenterId()); | ||||||
|         final VmwareDatacenter vmwareDC = findVmwareDatacenterForVM(vm); |         final VmwareDatacenter vmwareDC = findVmwareDatacenterForVM(vm); | ||||||
|  |         if (vm.getBackupExternalId() == null) { | ||||||
|  |             throw new CloudRuntimeException("The VM does not have a backup job assigned."); | ||||||
|  |         } | ||||||
|         try { |         try { | ||||||
|             if (!client.removeVMFromVeeamJob(vm.getBackupExternalId(), vm.getInstanceName(), vmwareDC.getVcenterHost())) { |             if (!client.removeVMFromVeeamJob(vm.getBackupExternalId(), vm.getInstanceName(), vmwareDC.getVcenterHost())) { | ||||||
|                 logger.warn("Failed to remove VM from Veeam Job id: " + vm.getBackupExternalId()); |                 logger.warn("Failed to remove VM from Veeam Job id: " + vm.getBackupExternalId()); | ||||||
|  | |||||||
| @ -394,10 +394,10 @@ public class BackupManagerImpl extends ManagerBase implements BackupManager { | |||||||
| 
 | 
 | ||||||
|         boolean result = false; |         boolean result = false; | ||||||
|         try { |         try { | ||||||
|             vm.setBackupOfferingId(null); |  | ||||||
|             vm.setBackupExternalId(null); |  | ||||||
|             vm.setBackupVolumes(null); |  | ||||||
|             result = backupProvider.removeVMFromBackupOffering(vm); |             result = backupProvider.removeVMFromBackupOffering(vm); | ||||||
|  |             vm.setBackupOfferingId(null); | ||||||
|  |             vm.setBackupVolumes(null); | ||||||
|  |             vm.setBackupExternalId(null); | ||||||
|             if (result && backupProvider.willDeleteBackupsOnOfferingRemoval()) { |             if (result && backupProvider.willDeleteBackupsOnOfferingRemoval()) { | ||||||
|                 final List<Backup> backups = backupDao.listByVmId(null, vm.getId()); |                 final List<Backup> backups = backupDao.listByVmId(null, vm.getId()); | ||||||
|                 for (final Backup backup : backups) { |                 for (final Backup backup : backups) { | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user