Skip to content

Commit a50a461

Browse files
niteshsardaDaanHoogland
authored andcommitted
CLOUDSTACK-10085 : Upload volume from local fails when global config max.account.seconday.storage is set to -1
1 parent 1d36b72 commit a50a461

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

services/secondary-storage/server/src/org/apache/cloudstack/storage/resource/NfsSecondaryStorageResource.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,7 @@
3535
import java.util.List;
3636
import java.util.Map;
3737
import java.util.UUID;
38-
3938
import javax.naming.ConfigurationException;
40-
4139
import com.amazonaws.services.s3.model.S3ObjectSummary;
4240
import com.cloud.agent.api.Answer;
4341
import com.cloud.agent.api.CheckHealthAnswer;
@@ -76,6 +74,7 @@
7674
import com.cloud.exception.InvalidParameterValueException;
7775
import com.cloud.host.Host;
7876
import com.cloud.host.Host.Type;
77+
import com.cloud.configuration.Resource;
7978
import com.cloud.hypervisor.Hypervisor.HypervisorType;
8079
import com.cloud.resource.ServerResourceBase;
8180
import com.cloud.storage.DataStoreRole;
@@ -2809,7 +2808,7 @@ private synchronized void checkSecondaryStorageResourceLimit(TemplateOrVolumePos
28092808
int accountDirSizeInGB = getSizeInGB(accountTemplateDirSize + accountSnapshotDirSize + accountVolumeDirSize);
28102809
int defaultMaxAccountSecondaryStorageInGB = Integer.parseInt(cmd.getDefaultMaxAccountSecondaryStorage());
28112810

2812-
if ((accountDirSizeInGB + contentLengthInGB) > defaultMaxAccountSecondaryStorageInGB) {
2811+
if (defaultMaxAccountSecondaryStorageInGB != Resource.RESOURCE_UNLIMITED && (accountDirSizeInGB + contentLengthInGB) > defaultMaxAccountSecondaryStorageInGB) {
28132812
s_logger.error("accountDirSizeInGb: " + accountDirSizeInGB + " defaultMaxAccountSecondaryStorageInGB: " + defaultMaxAccountSecondaryStorageInGB + " contentLengthInGB:"
28142813
+ contentLengthInGB);
28152814
String errorMessage = "Maximum number of resources of type secondary_storage for account has exceeded";

0 commit comments

Comments
 (0)