[ https://issues.apache.org/jira/browse/CLOUDSTACK-10040?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16297334#comment-16297334 ]
ASF GitHub Bot commented on CLOUDSTACK-10040: --------------------------------------------- rhtyd closed pull request #2232: CLOUDSTACK-10040 Upload volume fails when management server can not r… URL: https://github.com/apache/cloudstack/pull/2232 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/server/src/com/cloud/storage/VolumeApiServiceImpl.java b/server/src/com/cloud/storage/VolumeApiServiceImpl.java index 3330cc74a26..a46beb40ea7 100644 --- a/server/src/com/cloud/storage/VolumeApiServiceImpl.java +++ b/server/src/com/cloud/storage/VolumeApiServiceImpl.java @@ -135,6 +135,7 @@ import org.apache.cloudstack.engine.subsystem.api.storage.VolumeService.VolumeApiResult; import org.apache.cloudstack.framework.async.AsyncCallFuture; import org.apache.cloudstack.framework.config.ConfigKey; +import org.apache.cloudstack.framework.config.Configurable; import org.apache.cloudstack.framework.config.dao.ConfigurationDao; import org.apache.cloudstack.framework.jobs.AsyncJob; import org.apache.cloudstack.framework.jobs.AsyncJobExecutionContext; @@ -173,7 +174,7 @@ import java.util.UUID; import java.util.concurrent.ExecutionException; -public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiService, VmWorkJobHandler { +public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiService, VmWorkJobHandler, Configurable { private final static Logger s_logger = Logger.getLogger(VolumeApiServiceImpl.class); public static final String VM_WORK_JOB_HANDLER = VolumeApiServiceImpl.class.getSimpleName(); @@ -260,6 +261,17 @@ static final ConfigKey<Long> VmJobCheckInterval = new ConfigKey<Long>("Advanced", Long.class, "vm.job.check.interval", "3000", "Interval in milliseconds to check if the job is complete", false); + static final ConfigKey<Boolean> ValidateURLExistence = + new ConfigKey<Boolean>( + "Advanced", + Boolean.class, + "validate.url.existence", + "true", + "Whether url of the given volume during upload needs to be validated for existence", + false, + ConfigKey.Scope.Zone); + + private long _maxVolumeSizeInGb; private final StateMachine2<Volume.State, Volume.Event, Volume> _volStateMachine; @@ -403,8 +415,11 @@ private boolean validateVolume(Account caller, long ownerId, Long zoneId, String throw new InvalidParameterValueException("File:// type urls are currently unsupported"); } UriUtils.validateUrl(format, url); - // check URL existence - UriUtils.checkUrlExistence(url); + + // check URL existence + if(ValidateURLExistence.value()) { + UriUtils.checkUrlExistence(url); + } // Check that the resource limit for secondary storage won't be exceeded _resourceLimitMgr.checkResourceLimit(_accountMgr.getAccount(ownerId), ResourceType.secondary_storage, UriUtils.getRemoteSize(url)); } else { @@ -3066,4 +3081,15 @@ private VmWorkJobVO createPlaceHolderWork(long instanceId) { return workJob; } + + @Override + public String getConfigComponentName() { + return VolumeApiService.class.getSimpleName(); + } + + @Override + public ConfigKey<?>[] getConfigKeys() { + return new ConfigKey<?>[] { ValidateURLExistence}; + } + } ---------------------------------------------------------------- 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: us...@infra.apache.org > Upload volume fails when management server can not reach the URL > ---------------------------------------------------------------- > > Key: CLOUDSTACK-10040 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10040 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Components: Volumes > Affects Versions: 4.10.0.0 > Reporter: subhash yedugundla > > Upload volume from internet fails when the management server cannot reach the > URL ( internet) > During the upload volume, we check the validity of the URL through management > server first and then download the volume to secondary storage through SSVM. > We have customer environments where the management server doesn’t have > internet access ( possibility in some customer environments as per their > security policies). This will now cause a failure even though the SSVM has > internet connection -- This message was sent by Atlassian JIRA (v6.4.14#64029)