sureshanaparti commented on code in PR #10381:
URL: https://github.com/apache/cloudstack/pull/10381#discussion_r2075344857
##########
server/src/main/java/com/cloud/vm/UserVmManagerImpl.java:
##########
@@ -6681,12 +6687,27 @@ public VirtualMachine vmStorageMigration(Long vmId,
Map<String, String> volumeTo
poolClusterId = pool.getClusterId();
}
checkDestinationHypervisorType(pool, vm);
+ Pair<Boolean, String> checkResult =
storageManager.checkIfReadyVolumeFitsInStoragePoolWithStorageAccessGroups(pool,
volume);
+ if (!checkResult.first()) {
+ throw new CloudRuntimeException(String.format("Storage
suitability check failed for volume %s with error %s", volume,
checkResult.second()));
+ }
+
volumeToPoolIds.put(volume.getId(), pool.getId());
}
_itMgr.storageMigration(vm.getUuid(), volumeToPoolIds);
return findMigratedVm(vm.getId(), vm.getType());
}
+ private void checkIfDestinationPoolHasSameStoragePool(StoragePool
destPool, VMInstanceVO vm) {
+ Long hostId = vm.getHostId();
+ if (hostId != null) {
+ Host host = _hostDao.findById(hostId);
+ if
(!storageManager.checkIfHostAndStoragePoolHasCommonStorageAccessGroups(host,
destPool)) {
+ throw new
InvalidParameterValueException(String.format("Destination pool %s does not have
matching storage tags as host %s", destPool.getName(), host.getName()));
Review Comment:
```suggestion
throw new
InvalidParameterValueException(String.format("Destination pool %s does not have
matching storage access groups as host %s", destPool.getName(),
host.getName()));
```
--
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]