cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kelv...@apache.org
Subject git commit: updated refs/heads/vmsync to 444a15b
Date Tue, 07 May 2013 00:03:18 GMT
Updated Branches:
  refs/heads/vmsync a8a09ba28 -> 444a15b61


Hook CPVM and SSVM into new sync framework


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/444a15b6
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/444a15b6
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/444a15b6

Branch: refs/heads/vmsync
Commit: 444a15b6194a3d313f278b8befa14e1b9b8a0a3d
Parents: a8a09ba
Author: Kelven Yang <kelveny@gmail.com>
Authored: Mon May 6 16:59:20 2013 -0700
Committer: Kelven Yang <kelveny@gmail.com>
Committed: Mon May 6 16:59:20 2013 -0700

----------------------------------------------------------------------
 client/tomcatconf/applicationContext.xml.in        |    5 +++
 .../consoleproxy/ConsoleProxyManagerImpl.java      |    1 +
 .../secondary/SecondaryStorageManagerImpl.java     |   27 ++++++++++++++-
 server/src/com/cloud/vm/dao/VMInstanceDaoImpl.java |    1 -
 4 files changed, 32 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/444a15b6/client/tomcatconf/applicationContext.xml.in
----------------------------------------------------------------------
diff --git a/client/tomcatconf/applicationContext.xml.in b/client/tomcatconf/applicationContext.xml.in
index 206d890..2c2031f 100644
--- a/client/tomcatconf/applicationContext.xml.in
+++ b/client/tomcatconf/applicationContext.xml.in
@@ -780,6 +780,8 @@
   <bean id="volumeManagerImpl" class="com.cloud.storage.VolumeManagerImpl" />
   <bean id="ClassicalPrimaryDataStoreProvider" class="org.apache.cloudstack.storage.datastore.provider.CloudStackPrimaryDataStoreProviderImpl"
/>
 
+  <bean id="VirtualMachinePowerStateSyncImpl" class="com.cloud.vm.VirtualMachinePowerStateSyncImpl"
/>
+
 
 <!--=======================================================================================================-->
 <!--                                                                                 
                     -->
@@ -791,6 +793,7 @@
   <!-- Async management -->
   <bean id="asyncJobDaoImpl" class="com.cloud.async.dao.AsyncJobDaoImpl" />
   <bean id="asyncJobJoinDaoImpl" class="com.cloud.api.query.dao.AsyncJobJoinDaoImpl" />
+  <bean id="asyncJobJournalDaoImpl" class="com.cloud.async.dao.AsyncJobJournalDaoImpl"
/>
   <bean id="asyncJobManagerImpl" class="com.cloud.async.AsyncJobManagerImpl">
     <property name="defaultDispatcher" value="ApiAsyncJobDispatcher" />
   </bean>
@@ -805,6 +808,8 @@
     <property name="name" value="VmWorkJobDispatcher" />
   </bean>
 
+  <bean id="vmWorkJobDaoImpl" class="com.cloud.vm.VmWorkJobDaoImpl" />  
+
   <!--
     Baremetal components
   -->

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/444a15b6/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java b/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java
index 7ee889b..a9b62e2 100755
--- a/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java
+++ b/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java
@@ -2053,6 +2053,7 @@ public class ConsoleProxyManagerImpl extends ManagerBase implements
ConsoleProxy
 	    	_itMgr.processVmStartWork(vm, ((VmWorkStart)work).getParams(), 
 	    		user, account,  ((VmWorkStart)work).getPlan());
     	} catch(Exception e) {
+    		s_logger.error("Exception in process VM-start work", e);
     		String result = SerializerHelper.toObjectSerializedString(e);
     		AsyncJobExecutionContext.getCurrentExecutionContext().completeAsyncJob(AsyncJobResult.STATUS_FAILED,
0, result);
     	}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/444a15b6/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java b/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java
index 170e4bf..49d29fc 100755
--- a/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java
+++ b/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java
@@ -51,6 +51,8 @@ import com.cloud.agent.api.check.CheckSshCommand;
 import com.cloud.agent.api.to.NicTO;
 import com.cloud.agent.api.to.VirtualMachineTO;
 import com.cloud.agent.manager.Commands;
+import com.cloud.async.AsyncJobExecutionContext;
+import com.cloud.async.AsyncJobResult;
 import com.cloud.capacity.dao.CapacityDao;
 import com.cloud.cluster.ClusterManager;
 import com.cloud.cluster.ManagementServerNode;
@@ -58,6 +60,7 @@ import com.cloud.configuration.Config;
 import com.cloud.configuration.ZoneConfig;
 import com.cloud.configuration.dao.ConfigurationDao;
 import com.cloud.consoleproxy.ConsoleProxyManager;
+import com.cloud.dao.EntityManager;
 import com.cloud.dc.DataCenter;
 import com.cloud.dc.DataCenter.NetworkType;
 import com.cloud.dc.DataCenterVO;
@@ -93,6 +96,7 @@ import com.cloud.resource.ResourceManager;
 import com.cloud.resource.ResourceStateAdapter;
 import com.cloud.resource.ServerResource;
 import com.cloud.resource.UnableDeleteHostException;
+import com.cloud.serializer.SerializerHelper;
 import com.cloud.service.ServiceOfferingVO;
 import com.cloud.service.dao.ServiceOfferingDao;
 import com.cloud.storage.SnapshotVO;
@@ -109,8 +113,10 @@ import com.cloud.storage.swift.SwiftManager;
 import com.cloud.storage.template.TemplateConstants;
 import com.cloud.user.Account;
 import com.cloud.user.AccountService;
+import com.cloud.user.AccountVO;
 import com.cloud.user.User;
 import com.cloud.user.UserContext;
+import com.cloud.user.UserVO;
 import com.cloud.utils.DateUtil;
 import com.cloud.utils.NumbersUtil;
 import com.cloud.utils.Pair;
@@ -137,6 +143,7 @@ import com.cloud.vm.VirtualMachineGuru;
 import com.cloud.vm.VirtualMachineManager;
 import com.cloud.vm.VirtualMachineName;
 import com.cloud.vm.VirtualMachineProfile;
+import com.cloud.vm.VmWorkStart;
 import com.cloud.vm.dao.SecondaryStorageVmDao;
 import com.cloud.vm.dao.UserVmDetailsDao;
 import com.cloud.vm.dao.VMInstanceDao;
@@ -250,6 +257,9 @@ public class SecondaryStorageManagerImpl extends ManagerBase implements
Secondar
     private SystemVmLoadScanner<Long> _loadScanner;
     private Map<Long, ZoneHostInfo> _zoneHostInfoMap; // map <zone id, info about
running host in zone>
 
+    @Inject
+    EntityManager _entityMgr;
+    
     private final GlobalLock _allocLock = GlobalLock.getInternLock(getAllocLockName());
 
     public SecondaryStorageManagerImpl() {
@@ -1476,10 +1486,25 @@ public class SecondaryStorageManagerImpl extends ManagerBase implements
Secondar
 	
     @Override
     public void vmWorkStart(VmWork work) {
+    	assert(work instanceof VmWorkStart);
+    	
+    	SecondaryStorageVmVO vm = findById(work.getVmId());
+    	
+    	UserVO user = _entityMgr.findById(UserVO.class, work.getUserId());
+    	AccountVO account = _entityMgr.findById(AccountVO.class, work.getAccountId());
+    	
+    	try {
+	    	_itMgr.processVmStartWork(vm, ((VmWorkStart)work).getParams(), 
+	    		user, account, ((VmWorkStart)work).getPlan());
+    	} catch(Exception e) {
+    		s_logger.error("Exception in process VM-start work", e);
+    		String result = SerializerHelper.toObjectSerializedString(e);
+    		AsyncJobExecutionContext.getCurrentExecutionContext().completeAsyncJob(AsyncJobResult.STATUS_FAILED,
0, result);
+    	}
     }
     
     @Override
     public void vmWorkStop(VmWork work) {
+    	// TODO
     }
-
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/444a15b6/server/src/com/cloud/vm/dao/VMInstanceDaoImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/vm/dao/VMInstanceDaoImpl.java b/server/src/com/cloud/vm/dao/VMInstanceDaoImpl.java
index 254c965..bb159a4 100644
--- a/server/src/com/cloud/vm/dao/VMInstanceDaoImpl.java
+++ b/server/src/com/cloud/vm/dao/VMInstanceDaoImpl.java
@@ -390,7 +390,6 @@ public class VMInstanceDaoImpl extends GenericDaoBase<VMInstanceVO,
Long> implem
     	ub.set(vmi, "hostId", newHostId);
     	ub.set(vmi, "podIdToDeployIn", vmi.getPodIdToDeployIn());
     	ub.set(vmi, _updateTimeAttr, new Date());
-    	ub.set(vmi,  "lastEvent", event);
 
     	int result = update(vmi, sc);
     	if (result == 0 && s_logger.isDebugEnabled()) {


Mime
View raw message