You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by "DK101010 (via GitHub)" <gi...@apache.org> on 2023/07/19 08:49:00 UTC

[GitHub] [cloudstack] DK101010 commented on a diff in pull request #6699: multi local storage handling for kvm

DK101010 commented on code in PR #6699:
URL: https://github.com/apache/cloudstack/pull/6699#discussion_r1267759818


##########
plugins/storage/volume/default/src/main/java/org/apache/cloudstack/storage/datastore/lifecycle/CloudStackPrimaryDataStoreLifeCycleImpl.java:
##########
@@ -550,7 +509,16 @@ private HypervisorType getHypervisorType(long hostId) {
 
     @Override
     public boolean attachHost(DataStore store, HostScope scope, StoragePoolInfo existingInfo) {
-        dataStoreHelper.attachHost(store, scope, existingInfo);
+        DataStore dataStore = dataStoreHelper.attachHost(store, scope, existingInfo);
+        if(existingInfo.getCapacityBytes() == 0){
+            try {
+                storageMgr.connectHostToSharedPool(scope.getScopeId(), dataStore.getId());
+            } catch (StorageUnavailableException ex) {
+                java.util.logging.Logger.getLogger(CloudStackPrimaryDataStoreLifeCycleImpl.class.getName()).log(Level.SEVERE, null, ex);
+            } catch (StorageConflictException ex) {
+                java.util.logging.Logger.getLogger(CloudStackPrimaryDataStoreLifeCycleImpl.class.getName()).log(Level.SEVERE, null, ex);

Review Comment:
   Good question, I am guided by the previous code examples. What is the advantage of s_logger?



-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org