Merge branch '4.19' of https://github.com/apache/cloudstack into 4.20

This commit is contained in:
Pearl Dsilva 2025-03-17 13:26:26 -04:00
commit e091aad792
2 changed files with 6 additions and 3 deletions

View File

@ -200,6 +200,9 @@ public class VeeamBackupProvider extends AdapterBase implements BackupProvider,
public boolean removeVMFromBackupOffering(final VirtualMachine vm) {
final VeeamClient client = getClient(vm.getDataCenterId());
final VmwareDatacenter vmwareDC = findVmwareDatacenterForVM(vm);
if (vm.getBackupExternalId() == null) {
throw new CloudRuntimeException("The VM does not have a backup job assigned.");
}
try {
if (!client.removeVMFromVeeamJob(vm.getBackupExternalId(), vm.getInstanceName(), vmwareDC.getVcenterHost())) {
logger.warn("Failed to remove VM from Veeam Job id: " + vm.getBackupExternalId());

View File

@ -380,10 +380,10 @@ public class BackupManagerImpl extends ManagerBase implements BackupManager {
boolean result = false;
try {
vm.setBackupOfferingId(null);
vm.setBackupExternalId(null);
vm.setBackupVolumes(null);
result = backupProvider.removeVMFromBackupOffering(vm);
vm.setBackupOfferingId(null);
vm.setBackupVolumes(null);
vm.setBackupExternalId(null);
if (result && backupProvider.willDeleteBackupsOnOfferingRemoval()) {
final List<Backup> backups = backupDao.listByVmId(null, vm.getId());
for (final Backup backup : backups) {