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 efef4ac
Date Fri, 03 May 2013 01:06:49 GMT
Updated Branches:
  refs/heads/object_store 87fafb728 -> efef4ac69


download template to primary storage works now


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

Branch: refs/heads/object_store
Commit: efef4ac69c503f4af70123facdbde01512f513cc
Parents: 87fafb7
Author: Edison Su <sudison@gmail.com>
Authored: Thu May 2 18:03:57 2013 -0700
Committer: Edison Su <sudison@gmail.com>
Committed: Thu May 2 18:06:31 2013 -0700

----------------------------------------------------------------------
 .../cloudstack/storage/to/VolumeObjectTO.java      |    2 +-
 .../storage/test/CloudStackTestNGBase.java         |   14 +-
 .../storage/test/DirectAgentManagerSimpleImpl.java |   12 +-
 .../apache/cloudstack/storage/test/VolumeTest.java |  298 +++++++++++++++
 .../cloudstack/storage/test/volumeServiceTest.java |   16 -
 .../cloudstack/storage/volume/VolumeObject.java    |    7 +-
 .../storage/volume/VolumeServiceImpl.java          |    2 +-
 7 files changed, 328 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/efef4ac6/engine/api/src/org/apache/cloudstack/storage/to/VolumeObjectTO.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/storage/to/VolumeObjectTO.java b/engine/api/src/org/apache/cloudstack/storage/to/VolumeObjectTO.java
index 4ca1f9b..df56935 100644
--- a/engine/api/src/org/apache/cloudstack/storage/to/VolumeObjectTO.java
+++ b/engine/api/src/org/apache/cloudstack/storage/to/VolumeObjectTO.java
@@ -40,7 +40,7 @@ public class VolumeObjectTO implements DataTO {
     
     public VolumeObjectTO(VolumeInfo volume) {
         this.uuid = volume.getUuid();
-        this.path = volume.getUri();
+        this.path = volume.getPath();
         //this.volumeType = volume.getType();
         //this.diskType = volume.getDiskType();
         if (volume.getDataStore() != null) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/efef4ac6/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/CloudStackTestNGBase.java
----------------------------------------------------------------------
diff --git a/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/CloudStackTestNGBase.java
b/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/CloudStackTestNGBase.java
index 40267a7..4ea3d3f 100644
--- a/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/CloudStackTestNGBase.java
+++ b/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/CloudStackTestNGBase.java
@@ -36,6 +36,7 @@ public class CloudStackTestNGBase extends AbstractTestNGSpringContextTests
{
     private String localStorageUuid;
     private String primaryStorageUrl;
     private String secondaryStorage;
+    private String imageInstallPath;
     private Transaction txn;
 
     private String s3AccessKey;
@@ -66,13 +67,14 @@ public class CloudStackTestNGBase extends AbstractTestNGSpringContextTests
{
     }
 
     @BeforeMethod(alwaysRun = true)
+
     @Parameters({"devcloud-host-uuid", "devcloud-host-gateway", "devcloud-host-cidr",
         "devcloud-host-ip", "template-url", "devcloud-local-storage-uuid",
-        "primary-storage-want-to-add", "devcloud-secondary-storage", "s3-accesskey", "s3-secretkey",
"s3-endpoint", "s3-template-bucket", "s3-usehttps"})
+        "primary-storage-want-to-add", "devcloud-secondary-storage", "s3-accesskey", "s3-secretkey",
"s3-endpoint", "s3-template-bucket", "s3-usehttps", "image-install-path"})
     protected void setup(String hostuuid, String gateway, String cidr,
             String hostIp, String templateUrl, String localStorageUuid,
             String primaryStorage, String secondaryStorage, String s3_accessKey, String s3_secretKey,
String s3_endpoint, String s3_template_bucket,
-            String s3_usehttps) {
+            String s3_usehttps, String imageInstallPath) {
         this.hostGuid = hostuuid;
         this.hostGateway = gateway;
         this.hostCidr = cidr;
@@ -80,6 +82,7 @@ public class CloudStackTestNGBase extends AbstractTestNGSpringContextTests
{
         this.templateUrl = templateUrl;
         this.localStorageUuid = localStorageUuid;
         this.primaryStorageUrl = primaryStorage;
+        this.imageInstallPath = imageInstallPath;
         this.setSecondaryStorage(secondaryStorage);
         // set S3 parameters
         this.s3AccessKey = s3_accessKey;
@@ -125,6 +128,7 @@ public class CloudStackTestNGBase extends AbstractTestNGSpringContextTests
{
 		this.secondaryStorage = secondaryStorage;
 	}
 
+
     public String getS3AccessKey() {
         return s3AccessKey;
     }
@@ -145,6 +149,12 @@ public class CloudStackTestNGBase extends AbstractTestNGSpringContextTests
{
         return s3UseHttps;
     }
 
+    public String getImageInstallPath() {
+        return imageInstallPath;
+    }
 
+    public void setImageInstallPath(String imageInstallPath) {
+        this.imageInstallPath = imageInstallPath;
+    }
 
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/efef4ac6/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/DirectAgentManagerSimpleImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/DirectAgentManagerSimpleImpl.java
b/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/DirectAgentManagerSimpleImpl.java
index 6941ff8..127c0e3 100644
--- a/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/DirectAgentManagerSimpleImpl.java
+++ b/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/DirectAgentManagerSimpleImpl.java
@@ -79,8 +79,16 @@ public class DirectAgentManagerSimpleImpl extends ManagerBase implements
AgentMa
 
     @Override
     public Answer easySend(Long hostId, Command cmd) {
-        // TODO Auto-generated method stub
-        return null;
+      try {
+        return this.send(hostId, cmd);
+    } catch (AgentUnavailableException e) {
+        // TODO Auto-generated catch block
+        e.printStackTrace();
+    } catch (OperationTimedoutException e) {
+        // TODO Auto-generated catch block
+        e.printStackTrace();
+    }
+      return null;
     }
 
     protected void loadResource(Long hostId) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/efef4ac6/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/VolumeTest.java
----------------------------------------------------------------------
diff --git a/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/VolumeTest.java
b/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/VolumeTest.java
new file mode 100644
index 0000000..cceceda
--- /dev/null
+++ b/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/VolumeTest.java
@@ -0,0 +1,298 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cloudstack.storage.test;
+
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+
+import javax.inject.Inject;
+
+import org.apache.cloudstack.engine.subsystem.api.storage.ClusterScope;
+import org.apache.cloudstack.engine.subsystem.api.storage.DataObject;
+import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
+import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreLifeCycle;
+import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreManager;
+import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreProvider;
+import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreProviderManager;
+import org.apache.cloudstack.engine.subsystem.api.storage.EndPoint;
+import org.apache.cloudstack.engine.subsystem.api.storage.EndPointSelector;
+import org.apache.cloudstack.engine.subsystem.api.storage.ObjectInDataStoreStateMachine.Event;
+import org.apache.cloudstack.engine.subsystem.api.storage.VolumeDataFactory;
+import org.apache.cloudstack.engine.subsystem.api.storage.VolumeInfo;
+import org.apache.cloudstack.engine.subsystem.api.storage.type.RootDisk;
+import org.apache.cloudstack.engine.subsystem.api.storage.TemplateDataFactory;
+import org.apache.cloudstack.engine.subsystem.api.storage.TemplateInfo;
+import org.apache.cloudstack.engine.subsystem.api.storage.TemplateService;
+import org.apache.cloudstack.engine.subsystem.api.storage.VolumeService;
+import org.apache.cloudstack.storage.LocalHostEndpoint;
+import org.apache.cloudstack.storage.RemoteHostEndPoint;
+import org.apache.cloudstack.storage.command.CopyCmdAnswer;
+import org.apache.cloudstack.storage.datastore.db.ImageStoreDao;
+import org.apache.cloudstack.storage.datastore.db.ImageStoreVO;
+import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
+import org.apache.cloudstack.storage.datastore.db.StoragePoolVO;
+import org.apache.cloudstack.storage.datastore.db.TemplateDataStoreDao;
+import org.apache.cloudstack.storage.datastore.db.TemplateDataStoreVO;
+import org.apache.cloudstack.storage.to.TemplateObjectTO;
+import org.apache.cloudstack.storage.volume.db.VolumeDao2;
+import org.apache.cloudstack.storage.volume.db.VolumeVO;
+import org.mockito.Mockito;
+import org.springframework.test.context.ContextConfiguration;
+import org.testng.annotations.Test;
+
+import com.cloud.agent.AgentManager;
+import com.cloud.dc.ClusterVO;
+import com.cloud.dc.DataCenterVO;
+import com.cloud.dc.HostPodVO;
+import com.cloud.dc.DataCenter.NetworkType;
+import com.cloud.dc.dao.ClusterDao;
+import com.cloud.dc.dao.DataCenterDao;
+import com.cloud.dc.dao.HostPodDao;
+import com.cloud.host.Host;
+import com.cloud.host.Host.Type;
+import com.cloud.host.HostVO;
+import com.cloud.host.dao.HostDao;
+import com.cloud.hypervisor.Hypervisor.HypervisorType;
+import com.cloud.org.Cluster.ClusterType;
+import com.cloud.org.Managed.ManagedState;
+import com.cloud.resource.ResourceManager;
+import com.cloud.resource.ResourceState;
+import com.cloud.storage.DataStoreRole;
+import com.cloud.storage.Storage;
+import com.cloud.storage.VMTemplateStorageResourceAssoc.Status;
+import com.cloud.storage.VMTemplateVO;
+import com.cloud.storage.Storage.TemplateType;
+import com.cloud.storage.dao.VMTemplateDao;
+import com.cloud.utils.component.ComponentContext;
+
+@ContextConfiguration(locations={"classpath:/storageContext.xml"})
+public class VolumeTest extends CloudStackTestNGBase {
+    @Inject
+    ImageStoreDao imageStoreDao;
+    ImageStoreVO imageStore;
+    Long dcId;
+    Long clusterId;
+    Long podId;
+    HostVO host;
+    String primaryName = "my primary data store";
+    DataStore primaryStore;
+    @Inject
+    HostDao hostDao;
+    @Inject
+    TemplateService imageService;
+    @Inject
+    VolumeService volumeService;
+    @Inject
+    VMTemplateDao imageDataDao;
+    @Inject
+    VolumeDao2 volumeDao;
+    @Inject
+    HostPodDao podDao;
+    @Inject
+    ClusterDao clusterDao;
+    @Inject
+    DataCenterDao dcDao;
+    @Inject
+    PrimaryDataStoreDao primaryStoreDao;
+    @Inject
+    DataStoreProviderManager dataStoreProviderMgr;
+    @Inject
+    TemplateDataStoreDao templateStoreDao;
+    @Inject
+    TemplateDataFactory templateFactory;
+    @Inject
+    PrimaryDataStoreDao primaryDataStoreDao;
+    @Inject
+    AgentManager agentMgr;
+    @Inject
+    DataStoreManager dataStoreMgr;
+    @Inject
+    ResourceManager resourceMgr;
+    @Inject
+    VolumeDataFactory volFactory;
+    @Inject
+    EndPointSelector epSelector;
+    long primaryStoreId;
+    VMTemplateVO image;
+    String imageStoreName = "testImageStore";
+    @Test(priority = -1)
+    public void setUp() {
+        ComponentContext.initComponentsLifeCycle();
+  
+        host = hostDao.findByGuid(this.getHostGuid());
+        if (host != null) {
+            dcId = host.getDataCenterId();
+            clusterId = host.getClusterId();
+            podId = host.getPodId();
+            imageStore = this.imageStoreDao.findByName(imageStoreName);
+        } else {
+            //create data center
+            DataCenterVO dc = new DataCenterVO(UUID.randomUUID().toString(), "test", "8.8.8.8",
null, "10.0.0.1", null,  "10.0.0.1/24",
+                    null, null, NetworkType.Basic, null, null, true,  true, null, null);
+            dc = dcDao.persist(dc);
+            dcId = dc.getId();
+            //create pod
+
+            HostPodVO pod = new HostPodVO(UUID.randomUUID().toString(), dc.getId(), this.getHostGateway(),
this.getHostCidr(), 8, "test");
+            pod = podDao.persist(pod);
+            podId = pod.getId();
+            //create xen cluster
+            ClusterVO cluster = new ClusterVO(dc.getId(), pod.getId(), "devcloud cluster");
+            cluster.setHypervisorType(HypervisorType.XenServer.toString());
+            cluster.setClusterType(ClusterType.CloudManaged);
+            cluster.setManagedState(ManagedState.Managed);
+            cluster = clusterDao.persist(cluster);
+            clusterId = cluster.getId();
+            //create xen host
+
+            host = new HostVO(this.getHostGuid());
+            host.setName("devcloud xen host");
+            host.setType(Host.Type.Routing);
+            host.setPrivateIpAddress(this.getHostIp());
+            host.setDataCenterId(dc.getId());
+            host.setVersion("6.0.1");
+            host.setAvailable(true);
+            host.setSetup(true);
+            host.setPodId(podId);
+            host.setLastPinged(0);
+            host.setResourceState(ResourceState.Enabled);
+            host.setHypervisorType(HypervisorType.XenServer);
+            host.setClusterId(cluster.getId());
+
+            host = hostDao.persist(host);
+            
+            imageStore = new ImageStoreVO();
+            imageStore.setName(imageStoreName);
+            imageStore.setDataCenterId(dcId);
+            imageStore.setProviderName("CloudStack ImageStore Provider");
+            imageStore.setRole(DataStoreRole.Image);
+            imageStore.setUrl(this.getSecondaryStorage());
+            imageStore.setUuid(UUID.randomUUID().toString());
+            imageStore.setProtocol("nfs");
+            imageStore = imageStoreDao.persist(imageStore);
+        }
+       
+        image = new VMTemplateVO();
+        image.setTemplateType(TemplateType.USER);
+        image.setUrl(this.getTemplateUrl());
+        image.setUniqueName(UUID.randomUUID().toString());
+        image.setName(UUID.randomUUID().toString());
+        image.setPublicTemplate(true);
+        image.setFeatured(true);
+        image.setRequiresHvm(true);
+        image.setBits(64);
+        image.setFormat(Storage.ImageFormat.VHD);
+        image.setEnablePassword(true);
+        image.setEnableSshKey(true);
+        image.setGuestOSId(1);
+        image.setBootable(true);
+        image.setPrepopulate(true);
+        image.setCrossZones(true);
+        image.setExtractable(true);
+
+        image = imageDataDao.persist(image);
+        
+        /*TemplateDataStoreVO templateStore = new TemplateDataStoreVO();
+        
+        templateStore.setDataStoreId(imageStore.getId());
+        templateStore.setDownloadPercent(100);
+        templateStore.setDownloadState(Status.DOWNLOADED);
+        templateStore.setDownloadUrl(imageStore.getUrl());
+        templateStore.setInstallPath(this.getImageInstallPath());
+        templateStore.setTemplateId(image.getId());
+        templateStoreDao.persist(templateStore);*/
+        
+        
+        DataStore store = this.dataStoreMgr.getDataStore(imageStore.getId(), DataStoreRole.Image);
+        TemplateInfo template = templateFactory.getTemplate(image.getId());
+        DataObject templateOnStore = store.create(template);
+        TemplateObjectTO to = new TemplateObjectTO();
+        to.setPath(this.getImageInstallPath());
+        CopyCmdAnswer answer = new CopyCmdAnswer(to);
+        templateOnStore.processEvent(Event.CreateOnlyRequested);
+        templateOnStore.processEvent(Event.OperationSuccessed, answer);
+        
+       
+    }
+    
+    @Override
+    protected void injectMockito() {
+        List<HostVO> hosts = new ArrayList<HostVO>();
+        hosts.add(this.host);
+        Mockito.when(resourceMgr.listAllUpAndEnabledHosts((Type) Mockito.any(), Mockito.anyLong(),
Mockito.anyLong(), Mockito.anyLong())).thenReturn(hosts);
+        Mockito.when(epSelector.select(Mockito.any(DataObject.class))).thenReturn(new LocalHostEndpoint());
+        RemoteHostEndPoint ep = RemoteHostEndPoint.getHypervisorHostEndPoint(this.host.getId(),
this.host.getPrivateIpAddress());
+        Mockito.when(epSelector.select(Mockito.any(DataObject.class), Mockito.any(DataObject.class))).thenReturn(ep);
+    }
+    
+    public DataStore createPrimaryDataStore() {
+        try {
+            String uuid = UUID.nameUUIDFromBytes(this.getPrimaryStorageUrl().getBytes()).toString();
+            List<StoragePoolVO> pools = primaryDataStoreDao.findPoolByName(this.primaryName);
+            if (pools.size() > 0) {
+                return this.dataStoreMgr.getPrimaryDataStore(pools.get(0).getId());
+            }
+            
+            DataStoreProvider provider = dataStoreProviderMgr.getDataStoreProvider("cloudstack
primary data store provider");
+            Map<String, Object> params = new HashMap<String, Object>();
+            URI uri = new URI(this.getPrimaryStorageUrl());
+            params.put("url", this.getPrimaryStorageUrl());
+            params.put("server", uri.getHost());
+            params.put("path", uri.getPath());
+            params.put("protocol", Storage.StoragePoolType.NetworkFilesystem);
+            params.put("zoneId", dcId);
+            params.put("clusterId", clusterId);
+            params.put("name", this.primaryName);
+            params.put("port", 1);
+            params.put("podId", this.podId);
+            params.put("roles", DataStoreRole.Primary.toString());
+            params.put("uuid", uuid);
+            params.put("providerName", String.valueOf(provider.getName()));
+
+            DataStoreLifeCycle lifeCycle = provider.getDataStoreLifeCycle();
+            DataStore store = lifeCycle.initialize(params);
+            ClusterScope scope = new ClusterScope(clusterId, podId, dcId);
+            lifeCycle.attachCluster(store, scope);
+            return store;
+        } catch (Exception e) {
+            return null;
+        }
+    }
+    
+    private VolumeVO createVolume(Long templateId, long dataStoreId) {
+        VolumeVO volume = new VolumeVO(1000, new RootDisk().toString(), UUID.randomUUID().toString(),
templateId);
+        //volume.setPoolId(dataStoreId);
+        volume = volumeDao.persist(volume);
+        return volume;
+    }
+    
+    @Test
+    public void testCopyBaseImage() {
+        DataStore primaryStore = createPrimaryDataStore();
+        primaryStoreId = primaryStore.getId();
+        primaryStore = this.dataStoreMgr.getPrimaryDataStore(primaryStoreId);
+        VolumeVO volume = createVolume(image.getId(), primaryStore.getId());
+        VolumeInfo volInfo = this.volFactory.getVolume(volume.getId());
+        this.volumeService.createVolumeFromTemplateAsync(volInfo, this.primaryStoreId, this.templateFactory.getTemplate(this.image.getId()));
+    }
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/efef4ac6/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/volumeServiceTest.java
----------------------------------------------------------------------
diff --git a/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/volumeServiceTest.java
b/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/volumeServiceTest.java
index 919ca35..2152b2e 100644
--- a/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/volumeServiceTest.java
+++ b/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/volumeServiceTest.java
@@ -183,22 +183,6 @@ public class volumeServiceTest extends CloudStackTestNGBase {
 		imageStore.setUuid(UUID.randomUUID().toString());
 		imageStore = imageStoreDao.persist(imageStore);
 
-		//primaryStore = createPrimaryDataStore();
-
-		//CreateVolumeAnswer createVolumeFromImageAnswer = new CreateVolumeAnswer(UUID.randomUUID().toString());
-
-		/*try {
-			Mockito.when(agentMgr.send(Mockito.anyLong(), Mockito.any(CreateVolumeFromBaseImageCommand.class))).thenReturn(createVolumeFromImageAnswer);
-		} catch (AgentUnavailableException e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		} catch (OperationTimedoutException e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		}*/
-
-
-		//Mockito.when(primaryStoreDao.findById(Mockito.anyLong())).thenReturn(primaryStore);
 	}
 
     @Override

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/efef4ac6/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeObject.java
----------------------------------------------------------------------
diff --git a/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeObject.java
b/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeObject.java
index 567905d..c503832 100644
--- a/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeObject.java
+++ b/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeObject.java
@@ -242,7 +242,12 @@ public class VolumeObject implements VolumeInfo {
 
     @Override
     public String getPath() {
-        return this.volumeVO.getPath();
+        if (this.dataStore.getRole() == DataStoreRole.Primary) {
+            return this.volumeVO.getPath();
+        } else {
+            DataObjectInStore objInStore = this.ojbectInStoreMgr.findObject(this, dataStore);
+            return objInStore.getInstallPath();
+        }
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/efef4ac6/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 4e39dde..8dccdb3 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
@@ -377,7 +377,7 @@ public class VolumeServiceImpl implements VolumeService {
             templateOnPrimaryStoreObj.processEvent(Event.OperationFailed);
             VolumeApiResult result = new VolumeApiResult(volume);
             result.setResult(e.toString());
-            caller.complete(result);
+            future.complete(result);
         }
         return;
     }


Mime
View raw message