DaanHoogland closed pull request #2270: CLOUDSTACK-10085 : Upload volume from 
local fails when global config max.account.seconday.storage is set to -1
URL: https://github.com/apache/cloudstack/pull/2270
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/services/secondary-storage/server/src/org/apache/cloudstack/storage/resource/NfsSecondaryStorageResource.java
 
b/services/secondary-storage/server/src/org/apache/cloudstack/storage/resource/NfsSecondaryStorageResource.java
index 37cb72830b4..eb6f220f7ca 100644
--- 
a/services/secondary-storage/server/src/org/apache/cloudstack/storage/resource/NfsSecondaryStorageResource.java
+++ 
b/services/secondary-storage/server/src/org/apache/cloudstack/storage/resource/NfsSecondaryStorageResource.java
@@ -35,9 +35,7 @@
 import java.util.List;
 import java.util.Map;
 import java.util.UUID;
-
 import javax.naming.ConfigurationException;
-
 import com.amazonaws.services.s3.model.S3ObjectSummary;
 import com.cloud.agent.api.Answer;
 import com.cloud.agent.api.CheckHealthAnswer;
@@ -76,6 +74,7 @@
 import com.cloud.exception.InvalidParameterValueException;
 import com.cloud.host.Host;
 import com.cloud.host.Host.Type;
+import com.cloud.configuration.Resource;
 import com.cloud.hypervisor.Hypervisor.HypervisorType;
 import com.cloud.resource.ServerResourceBase;
 import com.cloud.storage.DataStoreRole;
@@ -2809,7 +2808,7 @@ private synchronized void 
checkSecondaryStorageResourceLimit(TemplateOrVolumePos
         int accountDirSizeInGB = getSizeInGB(accountTemplateDirSize + 
accountSnapshotDirSize + accountVolumeDirSize);
         int defaultMaxAccountSecondaryStorageInGB = 
Integer.parseInt(cmd.getDefaultMaxAccountSecondaryStorage());
 
-        if ((accountDirSizeInGB + contentLengthInGB) > 
defaultMaxAccountSecondaryStorageInGB) {
+        if (defaultMaxAccountSecondaryStorageInGB != 
Resource.RESOURCE_UNLIMITED && (accountDirSizeInGB + contentLengthInGB) > 
defaultMaxAccountSecondaryStorageInGB) {
             s_logger.error("accountDirSizeInGb: " + accountDirSizeInGB + " 
defaultMaxAccountSecondaryStorageInGB: " + 
defaultMaxAccountSecondaryStorageInGB + " contentLengthInGB:"
                     + contentLengthInGB);
             String errorMessage = "Maximum number of resources of type 
secondary_storage for account has exceeded";


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to