Skip to content

Commit a924a11

Browse files
Veeam: revert unnecessary state change if restore backup and attach to another VM (#8614)
1 parent af2e277 commit a924a11

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

server/src/main/java/org/apache/cloudstack/backup/BackupManagerImpl.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -770,20 +770,16 @@ public boolean restoreBackupVolumeAndAttachToVM(final String backedUpVolumeUuid,
770770
String[] hostPossibleValues = {host.getPrivateIpAddress(), host.getName()};
771771
String[] datastoresPossibleValues = {datastore.getUuid(), datastore.getName()};
772772

773-
updateVmState(vm, VirtualMachine.Event.RestoringRequested, VirtualMachine.State.Restoring);
774773
Pair<Boolean, String> result = restoreBackedUpVolume(backedUpVolumeUuid, backup, backupProvider, hostPossibleValues, datastoresPossibleValues);
775774

776775
if (BooleanUtils.isFalse(result.first())) {
777-
updateVmState(vm, VirtualMachine.Event.RestoringFailed, VirtualMachine.State.Stopped);
778776
throw new CloudRuntimeException(String.format("Error restoring volume [%s] of VM [%s] to host [%s] using backup provider [%s] due to: [%s].",
779777
backedUpVolumeUuid, vm.getUuid(), host.getUuid(), backupProvider.getName(), result.second()));
780778
}
781779
if (!attachVolumeToVM(vm.getDataCenterId(), result.second(), vmFromBackup.getBackupVolumeList(),
782780
backedUpVolumeUuid, vm, datastore.getUuid(), backup)) {
783-
updateVmState(vm, VirtualMachine.Event.RestoringFailed, VirtualMachine.State.Stopped);
784781
throw new CloudRuntimeException(String.format("Error attaching volume [%s] to VM [%s]." + backedUpVolumeUuid, vm.getUuid()));
785782
}
786-
updateVmState(vm, VirtualMachine.Event.RestoringSuccess, VirtualMachine.State.Stopped);
787783
return true;
788784
}
789785

0 commit comments

Comments
 (0)