Skip to content

Commit d721133

Browse files
author
Pearl Dsilva
committed
Make global setting non-dynamic
1 parent 4fb69e6 commit d721133

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

engine/components-api/src/main/java/com/cloud/storage/StorageManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ public interface StorageManager extends StorageService {
113113
"In second, timeout for download template to primary storage", false);
114114

115115
ConfigKey<Integer> SecStorageMaxMigrateSessions = new ConfigKey<Integer>("Advanced", Integer.class, "secstorage.max.migrate.sessions", "2",
116-
"The max number of concurrent copy command execution sessions that an SSVM can handle", true, ConfigKey.Scope.Global);
116+
"The max number of concurrent copy command execution sessions that an SSVM can handle", false, ConfigKey.Scope.Global);
117117

118118
ConfigKey<Integer> MaxDataMigrationWaitTime = new ConfigKey<Integer>("Advanced", Integer.class, "max.data.migration.wait.time", "15",
119119
"Maximum wait time for a data migration task before spawning a new SSVM", false, ConfigKey.Scope.Global);

engine/storage/image/src/main/java/org/apache/cloudstack/storage/image/SecondaryStorageServiceImpl.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
import org.apache.cloudstack.framework.async.AsyncCallbackDispatcher;
3838
import org.apache.cloudstack.framework.async.AsyncCompletionCallback;
3939
import org.apache.cloudstack.framework.async.AsyncRpcContext;
40+
import org.apache.cloudstack.storage.datastore.ObjectInDataStoreManager;
4041
import org.apache.cloudstack.storage.datastore.db.SnapshotDataStoreDao;
4142
import org.apache.cloudstack.storage.datastore.db.SnapshotDataStoreVO;
4243
import org.apache.cloudstack.storage.datastore.db.TemplateDataStoreDao;
@@ -65,6 +66,8 @@ public class SecondaryStorageServiceImpl implements SecondaryStorageService {
6566
SnapshotDataStoreDao snapshotStoreDao;
6667
@Inject
6768
VolumeDataStoreDao volumeDataStoreDao;
69+
@Inject
70+
private ObjectInDataStoreManager objectInStoreMgr;
6871

6972
private class MigrateDataContext<T> extends AsyncRpcContext<T> {
7073
final DataObject srcData;
@@ -137,7 +140,7 @@ public AsyncCallFuture<DataObjectResult> migrateData(DataObject srcDataObject, D
137140
s_logger.debug("Failed to copy Data", e);
138141
if (destDataObject != null) {
139142
s_logger.info("Deleting data on destination store: " + destDataObject.getDataStore().getName());
140-
destDataObject.getDataStore().delete(destDataObject);
143+
objectInStoreMgr.delete(destDataObject);
141144
}
142145
if (!(srcDataObject instanceof VolumeInfo)) {
143146
srcDataObject.processEvent(ObjectInDataStoreStateMachine.Event.OperationFailed);
@@ -182,7 +185,7 @@ protected Void migrateDataCallBack(AsyncCallbackDispatcher<SecondaryStorageServi
182185
}
183186

184187
if (destData != null) {
185-
destData.getDataStore().delete(destData);
188+
objectInStoreMgr.delete(destData);
186189
}
187190
} else {
188191
if (destData instanceof VolumeInfo) {

engine/storage/src/main/java/org/apache/cloudstack/storage/image/BaseImageStoreDriverImpl.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@
8888
import com.cloud.utils.db.TransactionLegacy;
8989
import com.cloud.utils.exception.CloudRuntimeException;
9090
import com.cloud.utils.net.Proxy;
91+
import com.cloud.vm.VirtualMachineManager;
9192
import com.cloud.vm.dao.SecondaryStorageVmDao;
9293

9394
public abstract class BaseImageStoreDriverImpl implements ImageStoreDriver {
@@ -344,7 +345,7 @@ public void copyAsync(DataObject srcdata, DataObject destData, AsyncCompletionCa
344345
(srcdata.getType() == DataObjectType.VOLUME && destData.getType() == DataObjectType.VOLUME)) {
345346

346347
int nMaxExecutionMinutes = NumbersUtil.parseInt(configDao.getValue(Config.SecStorageCmdExecutionTimeMax.key()), 30);
347-
CopyCommand cmd = new CopyCommand(srcdata.getTO(), destData.getTO(), nMaxExecutionMinutes * 60 * 1000, true);
348+
CopyCommand cmd = new CopyCommand(srcdata.getTO(), destData.getTO(), nMaxExecutionMinutes * 60 * 1000, VirtualMachineManager.ExecuteInSequence.value());
348349
Answer answer = null;
349350

350351
// Select host endpoint such that the load is balanced out

0 commit comments

Comments
 (0)