Fixed issues with execute in sequence

This commit is contained in:
Alex Huang 2013-11-19 17:20:23 -08:00
parent 829f1db6e8
commit 465626f6d1
7 changed files with 54 additions and 55 deletions

View File

@ -20,8 +20,6 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import com.cloud.exception.*;
import org.apache.cloudstack.api.ServerApiException; import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.command.admin.cluster.ListClustersCmd; import org.apache.cloudstack.api.command.admin.cluster.ListClustersCmd;
import org.apache.cloudstack.api.command.admin.config.ListCfgsByCmd; import org.apache.cloudstack.api.command.admin.config.ListCfgsByCmd;
@ -34,7 +32,12 @@ import org.apache.cloudstack.api.command.admin.resource.DeleteAlertsCmd;
import org.apache.cloudstack.api.command.admin.resource.ListAlertsCmd; import org.apache.cloudstack.api.command.admin.resource.ListAlertsCmd;
import org.apache.cloudstack.api.command.admin.resource.ListCapacityCmd; import org.apache.cloudstack.api.command.admin.resource.ListCapacityCmd;
import org.apache.cloudstack.api.command.admin.resource.UploadCustomCertificateCmd; import org.apache.cloudstack.api.command.admin.resource.UploadCustomCertificateCmd;
import org.apache.cloudstack.api.command.admin.systemvm.*; import org.apache.cloudstack.api.command.admin.systemvm.DestroySystemVmCmd;
import org.apache.cloudstack.api.command.admin.systemvm.ListSystemVMsCmd;
import org.apache.cloudstack.api.command.admin.systemvm.RebootSystemVmCmd;
import org.apache.cloudstack.api.command.admin.systemvm.ScaleSystemVMCmd;
import org.apache.cloudstack.api.command.admin.systemvm.StopSystemVmCmd;
import org.apache.cloudstack.api.command.admin.systemvm.UpgradeSystemVMCmd;
import org.apache.cloudstack.api.command.admin.vlan.ListVlanIpRangesCmd; import org.apache.cloudstack.api.command.admin.vlan.ListVlanIpRangesCmd;
import org.apache.cloudstack.api.command.user.address.ListPublicIpAddressesCmd; import org.apache.cloudstack.api.command.user.address.ListPublicIpAddressesCmd;
import org.apache.cloudstack.api.command.user.config.ListCapabilitiesCmd; import org.apache.cloudstack.api.command.user.config.ListCapabilitiesCmd;
@ -55,6 +58,10 @@ import com.cloud.capacity.Capacity;
import com.cloud.dc.Pod; import com.cloud.dc.Pod;
import com.cloud.dc.Vlan; import com.cloud.dc.Vlan;
import com.cloud.domain.Domain; import com.cloud.domain.Domain;
import com.cloud.exception.ConcurrentOperationException;
import com.cloud.exception.ManagementServerException;
import com.cloud.exception.ResourceUnavailableException;
import com.cloud.exception.VirtualMachineMigrationException;
import com.cloud.host.Host; import com.cloud.host.Host;
import com.cloud.hypervisor.Hypervisor.HypervisorType; import com.cloud.hypervisor.Hypervisor.HypervisorType;
import com.cloud.hypervisor.HypervisorCapabilities; import com.cloud.hypervisor.HypervisorCapabilities;
@ -365,7 +372,5 @@ public interface ManagementService {
VirtualMachine upgradeSystemVM(ScaleSystemVMCmd cmd) throws ResourceUnavailableException, ManagementServerException, VirtualMachineMigrationException, ConcurrentOperationException; VirtualMachine upgradeSystemVM(ScaleSystemVMCmd cmd) throws ResourceUnavailableException, ManagementServerException, VirtualMachineMigrationException, ConcurrentOperationException;
boolean getExecuteInSequence();
void cleanupVMReservations(); void cleanupVMReservations();
} }

View File

@ -20,6 +20,8 @@ import java.net.URI;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.Map; import java.util.Map;
import org.apache.cloudstack.framework.config.ConfigKey;
import com.cloud.agent.api.to.NicTO; import com.cloud.agent.api.to.NicTO;
import com.cloud.agent.api.to.VirtualMachineTO; import com.cloud.agent.api.to.VirtualMachineTO;
import com.cloud.deploy.DeployDestination; import com.cloud.deploy.DeployDestination;
@ -46,11 +48,14 @@ import com.cloud.utils.fsm.NoTransitionException;
* Manages allocating resources to vms. * Manages allocating resources to vms.
*/ */
public interface VirtualMachineManager extends Manager { public interface VirtualMachineManager extends Manager {
static final ConfigKey<Boolean> ExecuteInSequence = new ConfigKey<Boolean>("Advanced", Boolean.class, "execute.in.sequence.hypervisor.commands", "false",
public interface Topics { "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.", true);
public interface Topics {
public static final String VM_POWER_STATE = "vm.powerstate"; public static final String VM_POWER_STATE = "vm.powerstate";
} }
/** /**
* Allocates a new virtual machine instance in the CloudStack DB. This * Allocates a new virtual machine instance in the CloudStack DB. This
* orchestrates the creation of all virtual resources needed in CloudStack * orchestrates the creation of all virtual resources needed in CloudStack

View File

@ -35,6 +35,8 @@ import javax.ejb.Local;
import javax.inject.Inject; import javax.inject.Inject;
import javax.naming.ConfigurationException; import javax.naming.ConfigurationException;
import org.apache.log4j.Logger;
import org.apache.cloudstack.affinity.dao.AffinityGroupVMMapDao; import org.apache.cloudstack.affinity.dao.AffinityGroupVMMapDao;
import org.apache.cloudstack.context.CallContext; import org.apache.cloudstack.context.CallContext;
import org.apache.cloudstack.engine.orchestration.service.NetworkOrchestrationService; import org.apache.cloudstack.engine.orchestration.service.NetworkOrchestrationService;
@ -50,7 +52,6 @@ import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
import org.apache.cloudstack.storage.datastore.db.StoragePoolVO; import org.apache.cloudstack.storage.datastore.db.StoragePoolVO;
import org.apache.cloudstack.storage.to.VolumeObjectTO; import org.apache.cloudstack.storage.to.VolumeObjectTO;
import org.apache.cloudstack.utils.identity.ManagementServerNode; import org.apache.cloudstack.utils.identity.ManagementServerNode;
import org.apache.log4j.Logger;
import com.cloud.agent.AgentManager; import com.cloud.agent.AgentManager;
import com.cloud.agent.Listener; import com.cloud.agent.Listener;
@ -281,7 +282,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
Map<VirtualMachine.Type, VirtualMachineGuru> _vmGurus = new HashMap<VirtualMachine.Type, VirtualMachineGuru>(); Map<VirtualMachine.Type, VirtualMachineGuru> _vmGurus = new HashMap<VirtualMachine.Type, VirtualMachineGuru>();
protected StateMachine2<State, VirtualMachine.Event, VirtualMachine> _stateMachine; protected StateMachine2<State, VirtualMachine.Event, VirtualMachine> _stateMachine;
static final ConfigKey<Integer> StartRetry = new ConfigKey<Integer>(Integer.class, "start.retry", "Advanced", "10", "Number of times to retry create and start commands", true); static final ConfigKey<Integer> StartRetry = new ConfigKey<Integer>("Advanced", Integer.class, "start.retry", "10", "Number of times to retry create and start commands", true);
static final ConfigKey<Integer> VmOpWaitInterval = new ConfigKey<Integer>("Advanced", Integer.class, "vm.op.wait.interval", "120", static final ConfigKey<Integer> VmOpWaitInterval = new ConfigKey<Integer>("Advanced", Integer.class, "vm.op.wait.interval", "120",
"Time (in seconds) to wait before checking if a previous operation has succeeded", true); "Time (in seconds) to wait before checking if a previous operation has succeeded", true);
@ -298,6 +299,8 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
static final ConfigKey<Integer> ClusterDeltaSyncInterval = new ConfigKey<Integer>("Advanced", Integer.class, "sync.interval", "60", "Cluster Delta sync interval in seconds", static final ConfigKey<Integer> ClusterDeltaSyncInterval = new ConfigKey<Integer>("Advanced", Integer.class, "sync.interval", "60", "Cluster Delta sync interval in seconds",
false); false);
ScheduledExecutorService _executor = null; ScheduledExecutorService _executor = null;
protected long _nodeId; protected long _nodeId;
@ -328,7 +331,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
} }
assert (plan.getClusterId() == null && plan.getPoolId() == null) : "We currently don't support cluster and pool preset yet"; assert (plan.getClusterId() == null && plan.getPoolId() == null) : "We currently don't support cluster and pool preset yet";
final VMInstanceVO vmFinal = _vmDao.persist(vm); final VMInstanceVO vmFinal = _vmDao.persist(vm);
final LinkedHashMap<? extends DiskOffering, Long> dataDiskOfferingsFinal = dataDiskOfferings == null ? final LinkedHashMap<? extends DiskOffering, Long> dataDiskOfferingsFinal = dataDiskOfferings == null ?
new LinkedHashMap<DiskOffering, Long>() : dataDiskOfferings; new LinkedHashMap<DiskOffering, Long>() : dataDiskOfferings;
@ -560,7 +563,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
while (retry-- != 0) { while (retry-- != 0) {
try { try {
final ItWorkVO workFinal = work; final ItWorkVO workFinal = work;
Ternary<VMInstanceVO, ReservationContext, ItWorkVO> result = Ternary<VMInstanceVO, ReservationContext, ItWorkVO> result =
Transaction.execute(new TransactionCallbackWithException<Ternary<VMInstanceVO, ReservationContext, ItWorkVO>, NoTransitionException>() { Transaction.execute(new TransactionCallbackWithException<Ternary<VMInstanceVO, ReservationContext, ItWorkVO>, NoTransitionException>() {
@Override @Override
public Ternary<VMInstanceVO, ReservationContext, ItWorkVO> doInTransaction(TransactionStatus status) throws NoTransitionException { public Ternary<VMInstanceVO, ReservationContext, ItWorkVO> doInTransaction(TransactionStatus status) throws NoTransitionException {
@ -840,7 +843,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
handlePath(vmTO.getDisks(), vm.getHypervisorType()); handlePath(vmTO.getDisks(), vm.getHypervisorType());
cmds = new Commands(Command.OnError.Stop); cmds = new Commands(Command.OnError.Stop);
cmds.addCommand(new StartCommand(vmTO, dest.getHost(), getExecuteInSequence())); cmds.addCommand(new StartCommand(vmTO, dest.getHost(), ExecuteInSequence.value()));
vmGuru.finalizeDeployment(cmds, vmProfile, dest, ctx); vmGuru.finalizeDeployment(cmds, vmProfile, dest, ctx);
@ -883,7 +886,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
s_logger.info("The guru did not like the answers so stopping " + vm); s_logger.info("The guru did not like the answers so stopping " + vm);
} }
StopCommand cmd = new StopCommand(vm, getExecuteInSequence()); StopCommand cmd = new StopCommand(vm, ExecuteInSequence.value());
StopAnswer answer = (StopAnswer)_agentMgr.easySend(destHostId, cmd); StopAnswer answer = (StopAnswer)_agentMgr.easySend(destHostId, cmd);
if ( answer != null ) { if ( answer != null ) {
String hypervisortoolsversion = answer.getHypervisorToolsVersion(); String hypervisortoolsversion = answer.getHypervisorToolsVersion();
@ -1043,13 +1046,9 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
} }
} }
protected boolean getExecuteInSequence() {
return false;
}
protected boolean sendStop(VirtualMachineGuru guru, VirtualMachineProfile profile, boolean force) { protected boolean sendStop(VirtualMachineGuru guru, VirtualMachineProfile profile, boolean force) {
VirtualMachine vm = profile.getVirtualMachine(); VirtualMachine vm = profile.getVirtualMachine();
StopCommand stop = new StopCommand(vm, getExecuteInSequence()); StopCommand stop = new StopCommand(vm, ExecuteInSequence.value());
try { try {
StopAnswer answer = (StopAnswer) _agentMgr.send(vm.getHostId(), stop); StopAnswer answer = (StopAnswer) _agentMgr.send(vm.getHostId(), stop);
if ( answer != null ) { if ( answer != null ) {
@ -1253,7 +1252,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
} }
vmGuru.prepareStop(profile); vmGuru.prepareStop(profile);
StopCommand stop = new StopCommand(vm, getExecuteInSequence()); StopCommand stop = new StopCommand(vm, ExecuteInSequence.value());
boolean stopped = false; boolean stopped = false;
StopAnswer answer = null; StopAnswer answer = null;
try { try {
@ -1988,11 +1987,11 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
} }
public Command cleanup(VirtualMachine vm) { public Command cleanup(VirtualMachine vm) {
return new StopCommand(vm, getExecuteInSequence()); return new StopCommand(vm, ExecuteInSequence.value());
} }
public Command cleanup(String vmName) { public Command cleanup(String vmName) {
return new StopCommand(vmName, getExecuteInSequence()); return new StopCommand(vmName, ExecuteInSequence.value());
} }
public Commands fullHostSync(final long hostId, StartupRoutingCommand startup) { public Commands fullHostSync(final long hostId, StartupRoutingCommand startup) {
@ -2742,7 +2741,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
this.name = name; this.name = name;
this.state = state; this.state = state;
this.vm = vm; this.vm = vm;
this.hostUuid = host; hostUuid = host;
this.hvtoolsversion= hvtoolsversion; this.hvtoolsversion= hvtoolsversion;
} }
@ -3389,7 +3388,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
@Override @Override
public ConfigKey<?>[] getConfigKeys() { public ConfigKey<?>[] getConfigKeys() {
return new ConfigKey<?>[] {ClusterDeltaSyncInterval, StartRetry, VmDestroyForcestop, VmOpCancelInterval, VmOpCleanupInterval, VmOpCleanupWait, VmOpLockStateRetry, return new ConfigKey<?>[] {ClusterDeltaSyncInterval, StartRetry, VmDestroyForcestop, VmOpCancelInterval, VmOpCleanupInterval, VmOpCleanupWait, VmOpLockStateRetry,
VmOpWaitInterval}; VmOpWaitInterval, ExecuteInSequence};
} }
public List<StoragePoolAllocator> getStoragePoolAllocators() { public List<StoragePoolAllocator> getStoragePoolAllocators() {
@ -3398,7 +3397,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
@Inject @Inject
public void setStoragePoolAllocators(List<StoragePoolAllocator> storagePoolAllocators) { public void setStoragePoolAllocators(List<StoragePoolAllocator> storagePoolAllocators) {
this._storagePoolAllocators = storagePoolAllocators; _storagePoolAllocators = storagePoolAllocators;
} }
} }

View File

@ -57,7 +57,6 @@ import com.cloud.agent.api.to.NfsTO;
import com.cloud.agent.api.to.VirtualMachineTO; import com.cloud.agent.api.to.VirtualMachineTO;
import com.cloud.configuration.Config; import com.cloud.configuration.Config;
import com.cloud.host.Host; import com.cloud.host.Host;
import com.cloud.server.ManagementService;
import com.cloud.storage.DataStoreRole; import com.cloud.storage.DataStoreRole;
import com.cloud.storage.StoragePool; import com.cloud.storage.StoragePool;
import com.cloud.storage.VolumeVO; import com.cloud.storage.VolumeVO;
@ -65,6 +64,7 @@ import com.cloud.storage.dao.VolumeDao;
import com.cloud.utils.NumbersUtil; import com.cloud.utils.NumbersUtil;
import com.cloud.utils.db.DB; import com.cloud.utils.db.DB;
import com.cloud.utils.exception.CloudRuntimeException; import com.cloud.utils.exception.CloudRuntimeException;
import com.cloud.vm.VirtualMachineManager;
@Component @Component
public class public class
@ -80,8 +80,6 @@ AncientDataMotionStrategy implements DataMotionStrategy {
DataStoreManager dataStoreMgr; DataStoreManager dataStoreMgr;
@Inject @Inject
StorageCacheManager cacheMgr; StorageCacheManager cacheMgr;
@Inject
ManagementService _mgmtServer;
@Override @Override
public StrategyPriority canHandle(DataObject srcData, DataObject destData) { public StrategyPriority canHandle(DataObject srcData, DataObject destData) {
@ -162,7 +160,7 @@ AncientDataMotionStrategy implements DataMotionStrategy {
srcForCopy = cacheData = cacheMgr.createCacheObject(srcData, destScope); srcForCopy = cacheData = cacheMgr.createCacheObject(srcData, destScope);
} }
CopyCommand cmd = new CopyCommand(srcForCopy.getTO(), destData.getTO(), _primaryStorageDownloadWait, _mgmtServer.getExecuteInSequence()); CopyCommand cmd = new CopyCommand(srcForCopy.getTO(), destData.getTO(), _primaryStorageDownloadWait, VirtualMachineManager.ExecuteInSequence.value());
EndPoint ep = selector.select(srcForCopy, destData); EndPoint ep = selector.select(srcForCopy, destData);
if (ep == null) { if (ep == null) {
String errMsg = "No remote endpoint to send command, check if host or ssvm is down?"; String errMsg = "No remote endpoint to send command, check if host or ssvm is down?";
@ -247,7 +245,7 @@ AncientDataMotionStrategy implements DataMotionStrategy {
ep = selector.select(snapObj, volObj); ep = selector.select(snapObj, volObj);
} }
CopyCommand cmd = new CopyCommand(srcData.getTO(), volObj.getTO(), _createVolumeFromSnapshotWait, _mgmtServer.getExecuteInSequence()); CopyCommand cmd = new CopyCommand(srcData.getTO(), volObj.getTO(), _createVolumeFromSnapshotWait, VirtualMachineManager.ExecuteInSequence.value());
Answer answer = null; Answer answer = null;
if (ep == null) { if (ep == null) {
String errMsg = "No remote endpoint to send command, check if host or ssvm is down?"; String errMsg = "No remote endpoint to send command, check if host or ssvm is down?";
@ -270,7 +268,7 @@ AncientDataMotionStrategy implements DataMotionStrategy {
} }
protected Answer cloneVolume(DataObject template, DataObject volume) { protected Answer cloneVolume(DataObject template, DataObject volume) {
CopyCommand cmd = new CopyCommand(template.getTO(), volume.getTO(), 0, _mgmtServer.getExecuteInSequence()); CopyCommand cmd = new CopyCommand(template.getTO(), volume.getTO(), 0, VirtualMachineManager.ExecuteInSequence.value());
try { try {
EndPoint ep = selector.select(volume.getDataStore()); EndPoint ep = selector.select(volume.getDataStore());
Answer answer = null; Answer answer = null;
@ -320,7 +318,7 @@ AncientDataMotionStrategy implements DataMotionStrategy {
objOnImageStore.processEvent(Event.CopyingRequested); objOnImageStore.processEvent(Event.CopyingRequested);
CopyCommand cmd = new CopyCommand(objOnImageStore.getTO(), destData.getTO(), _copyvolumewait, _mgmtServer.getExecuteInSequence()); CopyCommand cmd = new CopyCommand(objOnImageStore.getTO(), destData.getTO(), _copyvolumewait, VirtualMachineManager.ExecuteInSequence.value());
EndPoint ep = selector.select(objOnImageStore, destData); EndPoint ep = selector.select(objOnImageStore, destData);
if (ep == null) { if (ep == null) {
String errMsg = "No remote endpoint to send command, check if host or ssvm is down?"; String errMsg = "No remote endpoint to send command, check if host or ssvm is down?";
@ -344,7 +342,7 @@ AncientDataMotionStrategy implements DataMotionStrategy {
return answer; return answer;
} else { } else {
DataObject cacheData = cacheMgr.createCacheObject(srcData, destScope); DataObject cacheData = cacheMgr.createCacheObject(srcData, destScope);
CopyCommand cmd = new CopyCommand(cacheData.getTO(), destData.getTO(), _copyvolumewait, _mgmtServer.getExecuteInSequence()); CopyCommand cmd = new CopyCommand(cacheData.getTO(), destData.getTO(), _copyvolumewait, VirtualMachineManager.ExecuteInSequence.value());
EndPoint ep = selector.select(cacheData, destData); EndPoint ep = selector.select(cacheData, destData);
Answer answer = null; Answer answer = null;
if (ep == null) { if (ep == null) {
@ -457,7 +455,7 @@ AncientDataMotionStrategy implements DataMotionStrategy {
ep = selector.select(srcData, destData); ep = selector.select(srcData, destData);
} }
CopyCommand cmd = new CopyCommand(srcData.getTO(), destData.getTO(), _createprivatetemplatefromsnapshotwait, _mgmtServer.getExecuteInSequence()); CopyCommand cmd = new CopyCommand(srcData.getTO(), destData.getTO(), _createprivatetemplatefromsnapshotwait, VirtualMachineManager.ExecuteInSequence.value());
Answer answer = null; Answer answer = null;
if (ep == null) { if (ep == null) {
String errMsg = "No remote endpoint to send command, check if host or ssvm is down?"; String errMsg = "No remote endpoint to send command, check if host or ssvm is down?";
@ -486,7 +484,7 @@ AncientDataMotionStrategy implements DataMotionStrategy {
Scope selectedScope = pickCacheScopeForCopy(srcData, destData); Scope selectedScope = pickCacheScopeForCopy(srcData, destData);
cacheData = cacheMgr.getCacheObject(srcData, selectedScope); cacheData = cacheMgr.getCacheObject(srcData, selectedScope);
CopyCommand cmd = new CopyCommand(srcData.getTO(), destData.getTO(), _backupsnapshotwait, _mgmtServer.getExecuteInSequence()); CopyCommand cmd = new CopyCommand(srcData.getTO(), destData.getTO(), _backupsnapshotwait, VirtualMachineManager.ExecuteInSequence.value());
cmd.setCacheTO(cacheData.getTO()); cmd.setCacheTO(cacheData.getTO());
EndPoint ep = selector.select(srcData, destData); EndPoint ep = selector.select(srcData, destData);
if (ep == null) { if (ep == null) {
@ -497,7 +495,7 @@ AncientDataMotionStrategy implements DataMotionStrategy {
answer = ep.sendMessage(cmd); answer = ep.sendMessage(cmd);
} }
} else { } else {
CopyCommand cmd = new CopyCommand(srcData.getTO(), destData.getTO(), _backupsnapshotwait, _mgmtServer.getExecuteInSequence()); CopyCommand cmd = new CopyCommand(srcData.getTO(), destData.getTO(), _backupsnapshotwait, VirtualMachineManager.ExecuteInSequence.value());
EndPoint ep = selector.select(srcData, destData); EndPoint ep = selector.select(srcData, destData);
if (ep == null) { if (ep == null) {
String errMsg = "No remote endpoint to send command, check if host or ssvm is down?"; String errMsg = "No remote endpoint to send command, check if host or ssvm is down?";

View File

@ -30,11 +30,13 @@
<artifactId>cloud-core</artifactId> <artifactId>cloud-core</artifactId>
<version>${project.version}</version> <version>${project.version}</version>
</dependency> </dependency>
<!--
<dependency> <dependency>
<groupId>org.apache.cloudstack</groupId> <groupId>org.apache.cloudstack</groupId>
<artifactId>cloud-server</artifactId> <artifactId>cloud-server</artifactId>
<version>${project.version}</version> <version>${project.version}</version>
</dependency> </dependency>
-->
<dependency> <dependency>
<groupId>org.apache.cloudstack</groupId> <groupId>org.apache.cloudstack</groupId>
<artifactId>cloud-engine-components-api</artifactId> <artifactId>cloud-engine-components-api</artifactId>

View File

@ -410,8 +410,6 @@ public enum Config {
BlacklistedRoutes("Advanced", VpcManager.class, String.class, "blacklisted.routes", null, "Routes that are blacklisted, can not be used for Static Routes creation for the VPC Private Gateway", BlacklistedRoutes("Advanced", VpcManager.class, String.class, "blacklisted.routes", null, "Routes that are blacklisted, can not be used for Static Routes creation for the VPC Private Gateway",
"routes", ConfigKey.Scope.Zone.toString()), "routes", ConfigKey.Scope.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), 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, CopyCommand will be synchronized on the agent side." +
" If set to false, these commands become asynchronous. Default value is false.", null),
ExecuteInSequenceNetworkElementCommands("Advanced", NetworkOrchestrationService.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." + ExecuteInSequenceNetworkElementCommands("Advanced", NetworkOrchestrationService.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), " If set to false, these commands become asynchronous. Default value is false.", null),

View File

@ -42,7 +42,6 @@ import javax.crypto.spec.SecretKeySpec;
import javax.inject.Inject; import javax.inject.Inject;
import javax.naming.ConfigurationException; import javax.naming.ConfigurationException;
import org.apache.cloudstack.api.command.admin.router.UpgradeRouterTemplateCmd;
import org.apache.commons.codec.binary.Base64; import org.apache.commons.codec.binary.Base64;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
@ -145,6 +144,7 @@ import org.apache.cloudstack.api.command.admin.router.RebootRouterCmd;
import org.apache.cloudstack.api.command.admin.router.StartRouterCmd; import org.apache.cloudstack.api.command.admin.router.StartRouterCmd;
import org.apache.cloudstack.api.command.admin.router.StopRouterCmd; import org.apache.cloudstack.api.command.admin.router.StopRouterCmd;
import org.apache.cloudstack.api.command.admin.router.UpgradeRouterCmd; import org.apache.cloudstack.api.command.admin.router.UpgradeRouterCmd;
import org.apache.cloudstack.api.command.admin.router.UpgradeRouterTemplateCmd;
import org.apache.cloudstack.api.command.admin.storage.AddImageStoreCmd; import org.apache.cloudstack.api.command.admin.storage.AddImageStoreCmd;
import org.apache.cloudstack.api.command.admin.storage.AddS3Cmd; import org.apache.cloudstack.api.command.admin.storage.AddS3Cmd;
import org.apache.cloudstack.api.command.admin.storage.CancelPrimaryStorageMaintenanceCmd; import org.apache.cloudstack.api.command.admin.storage.CancelPrimaryStorageMaintenanceCmd;
@ -271,6 +271,7 @@ import org.apache.cloudstack.api.command.user.iso.UpdateIsoCmd;
import org.apache.cloudstack.api.command.user.iso.UpdateIsoPermissionsCmd; import org.apache.cloudstack.api.command.user.iso.UpdateIsoPermissionsCmd;
import org.apache.cloudstack.api.command.user.job.ListAsyncJobsCmd; import org.apache.cloudstack.api.command.user.job.ListAsyncJobsCmd;
import org.apache.cloudstack.api.command.user.job.QueryAsyncJobResultCmd; import org.apache.cloudstack.api.command.user.job.QueryAsyncJobResultCmd;
import org.apache.cloudstack.api.command.user.loadbalancer.AssignCertToLoadBalancerCmd;
import org.apache.cloudstack.api.command.user.loadbalancer.AssignToLoadBalancerRuleCmd; import org.apache.cloudstack.api.command.user.loadbalancer.AssignToLoadBalancerRuleCmd;
import org.apache.cloudstack.api.command.user.loadbalancer.CreateApplicationLoadBalancerCmd; import org.apache.cloudstack.api.command.user.loadbalancer.CreateApplicationLoadBalancerCmd;
import org.apache.cloudstack.api.command.user.loadbalancer.CreateLBHealthCheckPolicyCmd; import org.apache.cloudstack.api.command.user.loadbalancer.CreateLBHealthCheckPolicyCmd;
@ -280,18 +281,17 @@ import org.apache.cloudstack.api.command.user.loadbalancer.DeleteApplicationLoad
import org.apache.cloudstack.api.command.user.loadbalancer.DeleteLBHealthCheckPolicyCmd; import org.apache.cloudstack.api.command.user.loadbalancer.DeleteLBHealthCheckPolicyCmd;
import org.apache.cloudstack.api.command.user.loadbalancer.DeleteLBStickinessPolicyCmd; import org.apache.cloudstack.api.command.user.loadbalancer.DeleteLBStickinessPolicyCmd;
import org.apache.cloudstack.api.command.user.loadbalancer.DeleteLoadBalancerRuleCmd; import org.apache.cloudstack.api.command.user.loadbalancer.DeleteLoadBalancerRuleCmd;
import org.apache.cloudstack.api.command.user.loadbalancer.DeleteSslCertCmd;
import org.apache.cloudstack.api.command.user.loadbalancer.ListApplicationLoadBalancersCmd; import org.apache.cloudstack.api.command.user.loadbalancer.ListApplicationLoadBalancersCmd;
import org.apache.cloudstack.api.command.user.loadbalancer.ListLBHealthCheckPoliciesCmd; import org.apache.cloudstack.api.command.user.loadbalancer.ListLBHealthCheckPoliciesCmd;
import org.apache.cloudstack.api.command.user.loadbalancer.ListLBStickinessPoliciesCmd; import org.apache.cloudstack.api.command.user.loadbalancer.ListLBStickinessPoliciesCmd;
import org.apache.cloudstack.api.command.user.loadbalancer.ListLoadBalancerRuleInstancesCmd; import org.apache.cloudstack.api.command.user.loadbalancer.ListLoadBalancerRuleInstancesCmd;
import org.apache.cloudstack.api.command.user.loadbalancer.ListLoadBalancerRulesCmd; import org.apache.cloudstack.api.command.user.loadbalancer.ListLoadBalancerRulesCmd;
import org.apache.cloudstack.api.command.user.loadbalancer.ListSslCertsCmd;
import org.apache.cloudstack.api.command.user.loadbalancer.RemoveCertFromLoadBalancerCmd;
import org.apache.cloudstack.api.command.user.loadbalancer.RemoveFromLoadBalancerRuleCmd; import org.apache.cloudstack.api.command.user.loadbalancer.RemoveFromLoadBalancerRuleCmd;
import org.apache.cloudstack.api.command.user.loadbalancer.UpdateLoadBalancerRuleCmd; import org.apache.cloudstack.api.command.user.loadbalancer.UpdateLoadBalancerRuleCmd;
import org.apache.cloudstack.api.command.user.loadbalancer.UploadSslCertCmd; import org.apache.cloudstack.api.command.user.loadbalancer.UploadSslCertCmd;
import org.apache.cloudstack.api.command.user.loadbalancer.DeleteSslCertCmd;
import org.apache.cloudstack.api.command.user.loadbalancer.ListSslCertsCmd;
import org.apache.cloudstack.api.command.user.loadbalancer.AssignCertToLoadBalancerCmd;
import org.apache.cloudstack.api.command.user.loadbalancer.RemoveCertFromLoadBalancerCmd;
import org.apache.cloudstack.api.command.user.nat.CreateIpForwardingRuleCmd; import org.apache.cloudstack.api.command.user.nat.CreateIpForwardingRuleCmd;
import org.apache.cloudstack.api.command.user.nat.DeleteIpForwardingRuleCmd; import org.apache.cloudstack.api.command.user.nat.DeleteIpForwardingRuleCmd;
import org.apache.cloudstack.api.command.user.nat.DisableStaticNatCmd; import org.apache.cloudstack.api.command.user.nat.DisableStaticNatCmd;
@ -574,13 +574,12 @@ import com.cloud.utils.db.DB;
import com.cloud.utils.db.Filter; import com.cloud.utils.db.Filter;
import com.cloud.utils.db.GlobalLock; import com.cloud.utils.db.GlobalLock;
import com.cloud.utils.db.JoinBuilder; import com.cloud.utils.db.JoinBuilder;
import com.cloud.utils.db.TransactionCallback;
import com.cloud.utils.db.TransactionCallbackNoReturn;
import com.cloud.utils.db.TransactionStatus;
import com.cloud.utils.db.JoinBuilder.JoinType; import com.cloud.utils.db.JoinBuilder.JoinType;
import com.cloud.utils.db.SearchBuilder; import com.cloud.utils.db.SearchBuilder;
import com.cloud.utils.db.SearchCriteria; import com.cloud.utils.db.SearchCriteria;
import com.cloud.utils.db.Transaction; import com.cloud.utils.db.Transaction;
import com.cloud.utils.db.TransactionCallbackNoReturn;
import com.cloud.utils.db.TransactionStatus;
import com.cloud.utils.exception.CloudRuntimeException; import com.cloud.utils.exception.CloudRuntimeException;
import com.cloud.utils.net.MacAddress; import com.cloud.utils.net.MacAddress;
import com.cloud.utils.net.NetUtils; import com.cloud.utils.net.NetUtils;
@ -819,8 +818,6 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe
_availableIdsMap.put(id, true); _availableIdsMap.put(id, true);
} }
_executeInSequence = Boolean.parseBoolean(_configDao.getValue(Config.ExecuteInSequence.key()));
return true; return true;
} }
@ -3508,11 +3505,6 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe
_encryptionIV = null; _encryptionIV = null;
} }
@Override
public boolean getExecuteInSequence() {
return _executeInSequence;
}
private static String getBase64EncodedRandomKey(int nBits) { private static String getBase64EncodedRandomKey(int nBits) {
SecureRandom random; SecureRandom random;
try { try {
@ -3906,6 +3898,6 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe
} }
public void setLockMasterListener(LockMasterListener lockMasterListener) { public void setLockMasterListener(LockMasterListener lockMasterListener) {
this._lockMasterListener = lockMasterListener; _lockMasterListener = lockMasterListener;
} }
} }