Copilot commented on code in PR #14094:
URL: https://github.com/apache/cloudstack/pull/14094#discussion_r3977047825


##########
server/src/main/java/org/apache/cloudstack/backup/BackupManagerImpl.java:
##########
@@ -1764,10 +1764,6 @@ public boolean restoreBackupVolumeAndAttachToVM(final 
String backedUpVolumeUuid,
             throw new CloudRuntimeException("Failed to find Instance Backup 
Offering");
         }
 
-        if (!StringUtils.equals(KBOSS_BACKUP_PROVIDER, offering.getProvider()) 
&& !VirtualMachine.PowerState.PowerOff.equals(vm.getPowerState())) {
-            throw new CloudRuntimeException(String.format("VM [%s] needs to be 
powered off to restore the volume [%s].", vm.getUuid(), backedUpVolumeUuid));
-        }
-
         BackupProvider backupProvider = 
getBackupProvider(offering.getProvider());
         VolumeVO backedUpVolume = 
volumeDao.findByUuidIncludingRemoved(backedUpVolumeUuid);
         Pair<HostVO, StoragePoolVO> restoreInfo;

Review Comment:
   This change removes the power-off validation entirely, which also removes 
the powered-off requirement for the KBOSS provider. That conflicts with the PR 
description ('Only KBOSS needs the powered-off check'). If KBOSS should still 
require PowerOff, reintroduce the guard but invert the condition to only 
enforce it when offering.getProvider() == KBOSS_BACKUP_PROVIDER; otherwise, if 
the intention is to remove the check for all providers, the PR 
title/description should be updated to match.



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

To unsubscribe, e-mail: [email protected]

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

Reply via email to