Return-Path: X-Original-To: apmail-cloudstack-commits-archive@www.apache.org Delivered-To: apmail-cloudstack-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 35638108A6 for ; Fri, 12 Jul 2013 00:44:02 +0000 (UTC) Received: (qmail 97976 invoked by uid 500); 12 Jul 2013 00:44:02 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 97961 invoked by uid 500); 12 Jul 2013 00:44:02 -0000 Mailing-List: contact commits-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list commits@cloudstack.apache.org Received: (qmail 97954 invoked by uid 99); 12 Jul 2013 00:44:02 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Jul 2013 00:44:02 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id CEE2389470F; Fri, 12 Jul 2013 00:44:01 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: alena1108@apache.org To: commits@cloudstack.apache.org Message-Id: <3a85086d78e5475c93c1fd0334378967@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: git commit: updated refs/heads/4.2 to 52d3e11 Date: Fri, 12 Jul 2013 00:44:01 +0000 (UTC) Updated Branches: refs/heads/4.2 a4f729759 -> 52d3e1190 CLOUDSTACK-2843: added CopyCommand to the list of the commands controlled by execute.in.sequence.hypervisor.commands global config. This command was introduced by the Storage refactoring, and used for volume creation on the primary storage Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/52d3e119 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/52d3e119 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/52d3e119 Branch: refs/heads/4.2 Commit: 52d3e1190f09bcfe43b7c25794c301617637a6de Parents: a4f7297 Author: Alena Prokharchyk Authored: Thu Jul 11 17:17:51 2013 -0700 Committer: Alena Prokharchyk Committed: Thu Jul 11 17:43:33 2013 -0700 ---------------------------------------------------------------------- api/src/com/cloud/server/ManagementService.java | 2 ++ .../cloudstack/storage/command/CopyCommand.java | 7 +++++-- .../motion/AncientDataMotionStrategy.java | 19 +++++++++++-------- server/src/com/cloud/configuration/Config.java | 2 +- .../src/com/cloud/server/ManagementServer.java | 2 -- setup/db/db/schema-410to420.sql | 2 +- 6 files changed, 20 insertions(+), 14 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/52d3e119/api/src/com/cloud/server/ManagementService.java ---------------------------------------------------------------------- diff --git a/api/src/com/cloud/server/ManagementService.java b/api/src/com/cloud/server/ManagementService.java index 8d00ef2..e943a8c 100755 --- a/api/src/com/cloud/server/ManagementService.java +++ b/api/src/com/cloud/server/ManagementService.java @@ -371,4 +371,6 @@ public interface ManagementService { List listDeploymentPlanners(); VirtualMachine upgradeSystemVM(ScaleSystemVMCmd cmd) throws ResourceUnavailableException, ManagementServerException, VirtualMachineMigrationException, ConcurrentOperationException; + + boolean getExecuteInSequence(); } http://git-wip-us.apache.org/repos/asf/cloudstack/blob/52d3e119/engine/api/src/org/apache/cloudstack/storage/command/CopyCommand.java ---------------------------------------------------------------------- diff --git a/engine/api/src/org/apache/cloudstack/storage/command/CopyCommand.java b/engine/api/src/org/apache/cloudstack/storage/command/CopyCommand.java index 852d801..f14f37e 100644 --- a/engine/api/src/org/apache/cloudstack/storage/command/CopyCommand.java +++ b/engine/api/src/org/apache/cloudstack/storage/command/CopyCommand.java @@ -23,12 +23,15 @@ public final class CopyCommand extends Command implements StorageSubSystemComman private DataTO srcTO; private DataTO destTO; private DataTO cacheTO; + boolean executeInSequence = false; - public CopyCommand(DataTO srcData, DataTO destData, int timeout) { + + public CopyCommand(DataTO srcData, DataTO destData, int timeout, boolean executeInSequence) { super(); this.srcTO = srcData; this.destTO = destData; this.setWait(timeout); + this.executeInSequence = executeInSequence; } public DataTO getDestTO() { @@ -41,7 +44,7 @@ public final class CopyCommand extends Command implements StorageSubSystemComman @Override public boolean executeInSequence() { - return true; + return executeInSequence; } public DataTO getCacheTO() { http://git-wip-us.apache.org/repos/asf/cloudstack/blob/52d3e119/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/AncientDataMotionStrategy.java ---------------------------------------------------------------------- diff --git a/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/AncientDataMotionStrategy.java b/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/AncientDataMotionStrategy.java index 04d0436..00c693f 100644 --- a/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/AncientDataMotionStrategy.java +++ b/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/AncientDataMotionStrategy.java @@ -59,6 +59,7 @@ import com.cloud.configuration.dao.ConfigurationDao; import com.cloud.host.Host; import com.cloud.host.dao.HostDao; import com.cloud.hypervisor.Hypervisor.HypervisorType; +import com.cloud.server.ManagementService; import com.cloud.storage.DataStoreRole; import com.cloud.storage.StorageManager; import com.cloud.storage.StoragePool; @@ -113,6 +114,8 @@ public class AncientDataMotionStrategy implements DataMotionStrategy { VolumeManager volumeMgr; @Inject StorageCacheManager cacheMgr; + @Inject + ManagementService _mgmtServer; @Override public boolean canHandle(DataObject srcData, DataObject destData) { @@ -184,7 +187,7 @@ public class AncientDataMotionStrategy implements DataMotionStrategy { srcForCopy = cacheData = cacheMgr.createCacheObject(srcData, destScope); } - CopyCommand cmd = new CopyCommand(srcForCopy.getTO(), destData.getTO(), _primaryStorageDownloadWait); + CopyCommand cmd = new CopyCommand(srcForCopy.getTO(), destData.getTO(), _primaryStorageDownloadWait, _mgmtServer.getExecuteInSequence()); EndPoint ep = selector.select(srcForCopy, destData); answer = ep.sendMessage(cmd); @@ -242,7 +245,7 @@ public class AncientDataMotionStrategy implements DataMotionStrategy { int _createVolumeFromSnapshotWait = NumbersUtil.parseInt(value, Integer.parseInt(Config.CreateVolumeFromSnapshotWait.getDefaultValue())); - CopyCommand cmd = new CopyCommand(srcData.getTO(), volObj.getTO(), _createVolumeFromSnapshotWait); + CopyCommand cmd = new CopyCommand(srcData.getTO(), volObj.getTO(), _createVolumeFromSnapshotWait, _mgmtServer.getExecuteInSequence()); EndPoint ep = selector.select(snapObj, volObj); Answer answer = ep.sendMessage(cmd); @@ -258,7 +261,7 @@ public class AncientDataMotionStrategy implements DataMotionStrategy { } protected Answer cloneVolume(DataObject template, DataObject volume) { - CopyCommand cmd = new CopyCommand(template.getTO(), volume.getTO(), 0); + CopyCommand cmd = new CopyCommand(template.getTO(), volume.getTO(), 0, _mgmtServer.getExecuteInSequence()); try { EndPoint ep = selector.select(volume.getDataStore()); Answer answer = ep.sendMessage(cmd); @@ -301,7 +304,7 @@ public class AncientDataMotionStrategy implements DataMotionStrategy { objOnImageStore.processEvent(Event.CopyingRequested); - CopyCommand cmd = new CopyCommand(objOnImageStore.getTO(), destData.getTO(), _copyvolumewait); + CopyCommand cmd = new CopyCommand(objOnImageStore.getTO(), destData.getTO(), _copyvolumewait, _mgmtServer.getExecuteInSequence()); EndPoint ep = selector.select(objOnImageStore, destData); answer = ep.sendMessage(cmd); @@ -319,7 +322,7 @@ public class AncientDataMotionStrategy implements DataMotionStrategy { return answer; } else { DataObject cacheData = cacheMgr.createCacheObject(srcData, destScope); - CopyCommand cmd = new CopyCommand(cacheData.getTO(), destData.getTO(), _copyvolumewait); + CopyCommand cmd = new CopyCommand(cacheData.getTO(), destData.getTO(), _copyvolumewait, _mgmtServer.getExecuteInSequence()); EndPoint ep = selector.select(cacheData, destData); Answer answer = ep.sendMessage(cmd); return answer; @@ -376,7 +379,7 @@ public class AncientDataMotionStrategy implements DataMotionStrategy { srcData = cacheSnapshotChain(snapshot); } - CopyCommand cmd = new CopyCommand(srcData.getTO(), destData.getTO(), _createprivatetemplatefromsnapshotwait); + CopyCommand cmd = new CopyCommand(srcData.getTO(), destData.getTO(), _createprivatetemplatefromsnapshotwait, _mgmtServer.getExecuteInSequence()); EndPoint ep = selector.select(srcData, destData); Answer answer = ep.sendMessage(cmd); return answer; @@ -393,12 +396,12 @@ public class AncientDataMotionStrategy implements DataMotionStrategy { if (needCacheStorage(srcData, destData)) { cacheData = cacheMgr.getCacheObject(srcData, destData.getDataStore().getScope()); - CopyCommand cmd = new CopyCommand(srcData.getTO(), destData.getTO(), _backupsnapshotwait); + CopyCommand cmd = new CopyCommand(srcData.getTO(), destData.getTO(), _backupsnapshotwait, _mgmtServer.getExecuteInSequence()); cmd.setCacheTO(cacheData.getTO()); EndPoint ep = selector.select(srcData, destData); answer = ep.sendMessage(cmd); } else { - CopyCommand cmd = new CopyCommand(srcData.getTO(), destData.getTO(), _backupsnapshotwait); + CopyCommand cmd = new CopyCommand(srcData.getTO(), destData.getTO(), _backupsnapshotwait, _mgmtServer.getExecuteInSequence()); EndPoint ep = selector.select(srcData, destData); answer = ep.sendMessage(cmd); } http://git-wip-us.apache.org/repos/asf/cloudstack/blob/52d3e119/server/src/com/cloud/configuration/Config.java ---------------------------------------------------------------------- diff --git a/server/src/com/cloud/configuration/Config.java b/server/src/com/cloud/configuration/Config.java index d3ed718..e77f6ce 100755 --- a/server/src/com/cloud/configuration/Config.java +++ b/server/src/com/cloud/configuration/Config.java @@ -432,7 +432,7 @@ public enum Config { "routes", ConfigurationParameterScope.zone.toString()), InternalLbVmServiceOfferingId("Advanced", ManagementServer.class, String.class, "internallbvm.service.offering", null, "Uuid of the service offering used by internal lb vm; if NULL - default system internal lb offering will be used", null), - ExecuteInSequence("Advanced", ManagementServer.class, Boolean.class, "execute.in.sequence.hypervisor.commands", "false", "If set to true, StartCommand, StopCommand, CopyVolumeCommand, CreateCommand will be synchronized on the agent side." + + ExecuteInSequence("Advanced", ManagementServer.class, Boolean.class, "execute.in.sequence.hypervisor.commands", "false", "If set to true, StartCommand, StopCommand, CopyCommand will be synchronized on the agent side." + " If set to false, these commands become asynchronous. Default value is false.", null), ExecuteInSequenceNetworkElementCommands("Advanced", NetworkManager.class, Boolean.class, "execute.in.sequence.network.element.commands", "false", "If set to true, DhcpEntryCommand, SavePasswordCommand, UserDataCommand, VmDataCommand will be synchronized on the agent side." + " If set to false, these commands become asynchronous. Default value is false.", null); http://git-wip-us.apache.org/repos/asf/cloudstack/blob/52d3e119/server/src/com/cloud/server/ManagementServer.java ---------------------------------------------------------------------- diff --git a/server/src/com/cloud/server/ManagementServer.java b/server/src/com/cloud/server/ManagementServer.java index aec1be7..f60ce48 100755 --- a/server/src/com/cloud/server/ManagementServer.java +++ b/server/src/com/cloud/server/ManagementServer.java @@ -72,6 +72,4 @@ public interface ManagementServer extends ManagementService, PluggableService { String getEncryptionIV(); void resetEncryptionKeyIV(); - boolean getExecuteInSequence(); - } http://git-wip-us.apache.org/repos/asf/cloudstack/blob/52d3e119/setup/db/db/schema-410to420.sql ---------------------------------------------------------------------- diff --git a/setup/db/db/schema-410to420.sql b/setup/db/db/schema-410to420.sql index 1e9c201..b48ae6a 100644 --- a/setup/db/db/schema-410to420.sql +++ b/setup/db/db/schema-410to420.sql @@ -2153,7 +2153,7 @@ UPDATE `cloud`.`networks` set name='Shared SG enabled network', display_text='Sh INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'use.system.public.ips', 'true', 'If true, when account has dedicated public ip range(s), once the ips dedicated to the account have been consumed ips will be acquired from the system pool'); INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'use.system.guest.vlans', 'true', 'If true, when account has dedicated guest vlan range(s), once the vlans dedicated to the account have been consumed vlans will be allocated from the system pool'); -INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'execute.in.sequence.hypervisor.commands', 'false', 'If set to true, StartCommand, StopCommand, CopyVolumeCommand, CreateCommand will be synchronized on the agent side. If set to false, these commands become asynchronous. Default value is false.'); +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'execute.in.sequence.hypervisor.commands', 'false', 'If set to true, StartCommand, StopCommand, CopyCommand will be synchronized on the agent side. If set to false, these commands become asynchronous. Default value is false.'); INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'execute.in.sequence.network.element.commands', 'false', 'If set to true, DhcpEntryCommand, SavePasswordCommand, UserDataCommand, VmDataCommand will be synchronized on the agent side. If set to false, these commands become asynchronous. Default value is false.'); INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'direct.agent.scan.interval', 90, 'Time interval (in seconds) to run the direct agent scan task.');