Skip to content

Commit

Permalink
CLOUDSTACK-10085 : Upload volume from local fails when global config …
Browse files Browse the repository at this point in the history
…max.account.seconday.storage is set to -1
  • Loading branch information
niteshsarda authored and DaanHoogland committed Nov 3, 2017
1 parent 1d36b72 commit a50a461
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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";
Expand Down

0 comments on commit a50a461

Please sign in to comment.