abh1sar commented on code in PR #12047:
URL: https://github.com/apache/cloudstack/pull/12047#discussion_r2681273752
##########
plugins/storage/volume/linstor/src/main/java/org/apache/cloudstack/storage/datastore/driver/LinstorPrimaryDataStoreDriverImpl.java:
##########
@@ -1063,13 +1065,27 @@ public void copyAsync(DataObject srcData, DataObject
dstData, AsyncCompletionCal
Answer answer = copyVolume(srcData, dstData);
res = new CopyCommandResult(null, answer);
} else {
- Answer answer = new Answer(null, false, "noimpl");
- res = new CopyCommandResult(null, answer);
- res.setResult("Not implemented yet");
+ throw new CloudRuntimeException("Not implemented for Linstor
primary storage.");
}
callback.complete(res);
}
+ private Host getEnabledClusterHost(StoragePool storagePool, List<String>
linstorNodeNames) {
+ List<HostVO> csHosts;
+ if (storagePool.getClusterId() != null) {
+ csHosts = _hostDao.findByClusterId(storagePool.getClusterId());
+ } else {
+ csHosts =
_hostDao.findByDataCenterId(storagePool.getDataCenterId());
Review Comment:
Will findHypervisorHostInZone be better here?
It will only return the hosts which have ResourceState.Enabled and
Status.Up.
##########
plugins/storage/volume/linstor/src/main/java/org/apache/cloudstack/storage/datastore/driver/LinstorPrimaryDataStoreDriverImpl.java:
##########
@@ -1063,13 +1065,27 @@ public void copyAsync(DataObject srcData, DataObject
dstData, AsyncCompletionCal
Answer answer = copyVolume(srcData, dstData);
res = new CopyCommandResult(null, answer);
} else {
- Answer answer = new Answer(null, false, "noimpl");
- res = new CopyCommandResult(null, answer);
- res.setResult("Not implemented yet");
+ throw new CloudRuntimeException("Not implemented for Linstor
primary storage.");
}
callback.complete(res);
}
+ private Host getEnabledClusterHost(StoragePool storagePool, List<String>
linstorNodeNames) {
+ List<HostVO> csHosts;
+ if (storagePool.getClusterId() != null) {
+ csHosts = _hostDao.findByClusterId(storagePool.getClusterId());
Review Comment:
Will findHypervisorHostInCluster be better here?
It will only return the hosts which have ResourceState.Enabled and
Status.Up.
--
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]