cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edi...@apache.org
Subject git commit: updated refs/heads/object_store to 4d992fd
Date Thu, 02 May 2013 00:51:41 GMT
Updated Branches:
  refs/heads/object_store 50066a602 -> 4d992fd18


fix template download to primary storage


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

Branch: refs/heads/object_store
Commit: 4d992fd18f710f4ee96e66d09e0e90e5656caf80
Parents: 50066a6
Author: Edison Su <sudison@gmail.com>
Authored: Wed May 1 17:51:04 2013 -0700
Committer: Edison Su <sudison@gmail.com>
Committed: Wed May 1 17:51:24 2013 -0700

----------------------------------------------------------------------
 .../storage/motion/AncientDataMotionStrategy.java  |    4 ++-
 engine/storage/integration-test/pom.xml            |    9 +++++-
 .../storage/test/ChildTestConfiguration.java       |   20 +++++++++++-
 .../test/resource/storageContext.xml               |   24 +++++++--------
 .../storage/volume/VolumeServiceImpl.java          |    6 +--
 .../xen/resource/XenServerStorageResource.java     |   23 ++++++++------
 tools/devcloud/devcloud.cfg                        |    2 +-
 7 files changed, 57 insertions(+), 31 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4d992fd1/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 5b8cbf6..66001ad 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
@@ -307,7 +307,9 @@ public class AncientDataMotionStrategy implements DataMotionStrategy {
             errMsg = e.toString();
         }
         CopyCommandResult result = new CopyCommandResult(null, answer);
-        result.setResult(errMsg);
+        if (!answer.getResult()) {
+            result.setResult(answer.getDetails());
+        }
         callback.complete(result);
 
         return null;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4d992fd1/engine/storage/integration-test/pom.xml
----------------------------------------------------------------------
diff --git a/engine/storage/integration-test/pom.xml b/engine/storage/integration-test/pom.xml
index 1bce37a..4abbf12 100644
--- a/engine/storage/integration-test/pom.xml
+++ b/engine/storage/integration-test/pom.xml
@@ -46,7 +46,13 @@
     </dependency>
     <dependency>
       <groupId>org.apache.cloudstack</groupId>
-      <artifactId>cloud-engine-storage-imagemotion</artifactId>
+      <artifactId>cloud-engine-storage-datamotion</artifactId>
+      <version>${project.version}</version>
+      <scope>test</scope>
+    </dependency>
+     <dependency>
+      <groupId>org.apache.cloudstack</groupId>
+      <artifactId>cloud-engine-storage-cache</artifactId>
       <version>${project.version}</version>
       <scope>test</scope>
     </dependency>
@@ -56,6 +62,7 @@
       <version>${project.version}</version>
       <scope>test</scope>
     </dependency>
+    
     <dependency>
       <groupId>org.apache.httpcomponents</groupId>
       <artifactId>httpclient</artifactId>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4d992fd1/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/ChildTestConfiguration.java
----------------------------------------------------------------------
diff --git a/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/ChildTestConfiguration.java
b/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/ChildTestConfiguration.java
index 4b8dbb8..1895c90 100644
--- a/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/ChildTestConfiguration.java
+++ b/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/ChildTestConfiguration.java
@@ -23,6 +23,7 @@ import org.apache.cloudstack.engine.service.api.OrchestrationService;
 import org.apache.cloudstack.engine.subsystem.api.storage.EndPointSelector;
 import org.apache.cloudstack.framework.rpc.RpcProvider;
 import org.apache.cloudstack.storage.HostEndpointRpcServer;
+import org.apache.cloudstack.storage.cache.manager.StorageCacheManagerImpl;
 import org.apache.cloudstack.storage.test.ChildTestConfiguration.Library;
 import org.mockito.Mockito;
 import org.springframework.context.annotation.Bean;
@@ -69,11 +70,14 @@ import com.cloud.storage.dao.VMTemplatePoolDaoImpl;
 import com.cloud.storage.dao.VMTemplateZoneDaoImpl;
 import com.cloud.storage.dao.VolumeDaoImpl;
 import com.cloud.storage.dao.VolumeHostDaoImpl;
+import com.cloud.storage.download.DownloadMonitor;
 import com.cloud.storage.s3.S3Manager;
 import com.cloud.storage.snapshot.SnapshotManager;
 import com.cloud.storage.swift.SwiftManager;
 import com.cloud.tags.dao.ResourceTagsDaoImpl;
 import com.cloud.template.TemplateManager;
+import com.cloud.user.AccountManager;
+import com.cloud.user.ResourceLimitService;
 import com.cloud.user.dao.UserDaoImpl;
 import com.cloud.utils.component.SpringComponentScanUtils;
 import com.cloud.vm.VirtualMachineManager;
@@ -121,9 +125,9 @@ import com.cloud.vm.snapshot.dao.VMSnapshotDaoImpl;
         OCFS2ManagerImpl.class,
         ClusterDetailsDaoImpl.class,
         SecondaryStorageVmDaoImpl.class,
-        
         ConsoleProxyDaoImpl.class,
         StoragePoolWorkDaoImpl.class,
+        StorageCacheManagerImpl.class,
         UserDaoImpl.class
 
 },
@@ -148,6 +152,20 @@ public class ChildTestConfiguration extends TestConfiguration {
     }
     
     @Bean
+    public ResourceLimitService limtServe() {
+        return Mockito.mock(ResourceLimitService.class);
+    }
+    
+    @Bean
+    public DownloadMonitor downloadMonitor() {
+        return Mockito.mock(DownloadMonitor.class);
+    }
+    
+    @Bean
+    public AccountManager acctMgt() {
+        return Mockito.mock(AccountManager.class);
+    }
+    @Bean
     public RpcProvider rpcProvider() {
     	return Mockito.mock(RpcProvider.class);
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4d992fd1/engine/storage/integration-test/test/resource/storageContext.xml
----------------------------------------------------------------------
diff --git a/engine/storage/integration-test/test/resource/storageContext.xml b/engine/storage/integration-test/test/resource/storageContext.xml
index 7c5382d..c403491 100644
--- a/engine/storage/integration-test/test/resource/storageContext.xml
+++ b/engine/storage/integration-test/test/resource/storageContext.xml
@@ -24,20 +24,18 @@
   <context:component-scan
     base-package="org.apache.cloudstack.storage" />
     
-  <!-- @DB support -->
-  <aop:config proxy-target-class="true">
-    <aop:aspect id="dbContextBuilder" ref="transactionContextBuilder">
-      <aop:pointcut id="captureAnyMethod" expression="execution(* *(..))" />
-
-      <aop:around pointcut-ref="captureAnyMethod" method="AroundAnyMethod" />
-    </aop:aspect>
-
-  </aop:config>
-  
+   <bean id="componentContext" class="com.cloud.utils.component.ComponentContext" />
   <bean id="transactionContextBuilder" class="com.cloud.utils.db.TransactionContextBuilder"
/>
-  <bean id="componentContext" class="com.cloud.utils.component.ComponentContext"/>
-   <bean class="org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor">
-    <property name="requiredParameterValue" value="false" />
+  <bean id="actionEventInterceptor" class="com.cloud.event.ActionEventInterceptor" />
+<bean class="org.apache.cloudstack.storage.test.ChildTestConfiguration" />
+  <bean id="instantiatePostProcessor" class="com.cloud.utils.component.ComponentInstantiationPostProcessor">
+    <property name="Interceptors">
+        <list>
+            <ref bean="transactionContextBuilder" />
+            <ref bean="actionEventInterceptor" />
+        </list>
+    </property>
   </bean>
 
+
 </beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4d992fd1/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java
b/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java
index b57333e..4e39dde 100644
--- a/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java
+++ b/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java
@@ -103,7 +103,7 @@ public class VolumeServiceImpl implements VolumeService {
     @Inject
     ResourceLimitService _resourceLimitMgr;
     @Inject
-    DownloadMonitor _dlMonitor;
+    DownloadMonitor downloadMonitor;
     @Inject
     AccountManager _accountMgr;
     @Inject
@@ -112,8 +112,6 @@ public class VolumeServiceImpl implements VolumeService {
     @Inject
     ConfigurationDao configDao;
     @Inject
-    SecondaryStorageVmManager _ssvmMgr;
-    @Inject
     AgentManager _agentMgr;
     @Inject
     VolumeDataStoreDao _volumeStoreDao;
@@ -815,7 +813,7 @@ public class VolumeServiceImpl implements VolumeService {
                 }
                 s_logger.debug("Volume " + volumeHost.getVolumeId() + " needs to be downloaded
to " + store.getName());
                 //TODO: pass a callback later
-                _dlMonitor.downloadVolumeToStorage(this.volFactory.getVolume(volumeHost.getVolumeId()),
store,  volumeHost.getDownloadUrl(), volumeHost.getChecksum(), volumeHost.getFormat(), null);
+                downloadMonitor.downloadVolumeToStorage(this.volFactory.getVolume(volumeHost.getVolumeId()),
store,  volumeHost.getDownloadUrl(), volumeHost.getChecksum(), volumeHost.getFormat(), null);
             }
         }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4d992fd1/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServerStorageResource.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServerStorageResource.java
b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServerStorageResource.java
index d2dfb47..77e5ca6 100644
--- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServerStorageResource.java
+++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServerStorageResource.java
@@ -711,14 +711,13 @@ public class XenServerStorageResource {
     protected CopyCmdAnswer copyTemplateToPrimaryStorage(DataTO srcData, DataTO destData,
int wait) {
         DataStoreTO srcStore = srcData.getDataStore();
         try {
-            if (srcStore.getRole() == DataStoreRole.ImageCache && srcData.getObjectType()
== DataObjectType.TEMPLATE) {
-                ImageStoreTO srcImageStore = (ImageStoreTO)srcStore;
+            if ((srcStore instanceof NfsTO) && (srcData.getObjectType() == DataObjectType.TEMPLATE))
{
+                NfsTO srcImageStore = (NfsTO)srcStore;
                 TemplateObjectTO srcTemplate = (TemplateObjectTO)srcData;
-                String storeUrl = srcImageStore.getUri();
-                if (!storeUrl.startsWith("nfs")) {
-                    return new CopyCmdAnswer("only nfs image cache store supported");
-                }
-                String tmplpath = storeUrl + ":" + srcData.getPath();
+                String storeUrl = srcImageStore.getUrl();
+            
+                URI uri = new URI(storeUrl);
+                String tmplpath = uri.getHost() + ":" + uri.getPath() + "/" + srcData.getPath();
                 PrimaryDataStoreTO destStore = (PrimaryDataStoreTO)destData.getDataStore();
                 String poolName = destStore.getUuid();
                 Connection conn = hypervisorResource.getConnection();
@@ -749,9 +748,8 @@ public class XenServerStorageResource {
                 } catch (Exception e) {
                 }
 
-                VolumeObjectTO newVol = new VolumeObjectTO();
+                TemplateObjectTO newVol = new TemplateObjectTO();
                 newVol.setUuid(snapshotvdi.getUuid(conn));
-                newVol.setSize(phySize);
                 newVol.setPath(newVol.getUuid());
                 return new CopyCmdAnswer(newVol);
             }
@@ -1214,8 +1212,13 @@ public class XenServerStorageResource {
         DataTO destData = cmd.getDestTO();
         DataStoreTO srcDataStore = srcData.getDataStore();
         DataStoreTO destDataStore = destData.getDataStore();
+        DataObjectType srcType = srcData.getObjectType();
+        DataObjectType destType = destData.getObjectType();
+        DataStoreRole destRole = destDataStore.getRole();
+        
+        boolean nfs = (srcDataStore instanceof NfsTO) ? true : false;
 
-        if (srcData.getObjectType() == DataObjectType.TEMPLATE && (srcDataStore instanceof
NfsTO)  && destData.getDataStore().getRole() == DataStoreRole.Primary) {
+        if ((srcData.getObjectType() == DataObjectType.TEMPLATE) && (srcDataStore
instanceof NfsTO)  && (destData.getDataStore().getRole() == DataStoreRole.Primary))
{
             //copy template to primary storage
             return copyTemplateToPrimaryStorage(srcData, destData, cmd.getWait());
         } else if (srcData.getObjectType() == DataObjectType.TEMPLATE && srcDataStore.getRole()
== DataStoreRole.Primary && destDataStore.getRole() == DataStoreRole.Primary) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4d992fd1/tools/devcloud/devcloud.cfg
----------------------------------------------------------------------
diff --git a/tools/devcloud/devcloud.cfg b/tools/devcloud/devcloud.cfg
index bf4cc92..0be6026 100644
--- a/tools/devcloud/devcloud.cfg
+++ b/tools/devcloud/devcloud.cfg
@@ -83,7 +83,7 @@
             "internaldns1": "192.168.56.1", 
             "secondaryStorages": [
                 {
-                    "url": "nfs://192.168.56.10:/opt/storage/secondary",
+                    "url": "nfs://192.168.56.10/opt/storage/secondary",
                     "providerName": "CloudStack ImageStore Provider",
                     "details": {
                     }


Mime
View raw message