cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mc...@apache.org
Subject [1/3] git commit: updated refs/heads/object_store to 3c6b7c2
Date Wed, 01 May 2013 19:10:49 GMT
Updated Branches:
  refs/heads/object_store bbd5d1321 -> 3c6b7c2a0


Bugfix to make deployDataCenter.py work.

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

Branch: refs/heads/object_store
Commit: 36c1538f0627a7645b6b932ff828ae4c227101b4
Parents: bbd5d13
Author: Min Chen <min.chen@citrix.com>
Authored: Tue Apr 30 17:42:48 2013 -0700
Committer: Min Chen <min.chen@citrix.com>
Committed: Tue Apr 30 17:42:48 2013 -0700

----------------------------------------------------------------------
 .../subsystem/api/storage/ImageStoreProvider.java  |    2 ++
 .../storage/datastore/db/SnapshotDataStoreVO.java  |    9 +++++++--
 .../storage/datastore/db/VolumeDataStoreVO.java    |    5 +++++
 .../datastore/ObjectInDataStoreManagerImpl.java    |    5 +++++
 .../storage/image/datastore/ImageStoreHelper.java  |    2 +-
 .../CloudStackImageStoreLifeCycleImpl.java         |    4 ++++
 .../provider/CloudStackImageStoreProviderImpl.java |    5 +++++
 .../lifecycle/S3ImageStoreLifeCycleImpl.java       |    3 +++
 .../provider/S3ImageStoreProviderImpl.java         |    5 +++++
 .../provider/SampleImageStoreProviderImpl.java     |    5 +++++
 .../lifecycle/SwiftImageStoreLifeCycleImpl.java    |    6 +++++-
 .../provider/SwiftImageStoreProviderImpl.java      |    5 +++++
 .../src/com/cloud/storage/StorageManagerImpl.java  |    6 ++++--
 .../storage/download/DownloadMonitorImpl.java      |    7 ++++++-
 .../secondary/SecondaryStorageManagerImpl.java     |    2 +-
 setup/db/db/schema-410to420.sql                    |    8 ++++++++
 tools/marvin/marvin/configGenerator.py             |    3 +++
 tools/marvin/marvin/deployDataCenter.py            |    6 ++++--
 18 files changed, 78 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/36c1538f/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/ImageStoreProvider.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/ImageStoreProvider.java
b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/ImageStoreProvider.java
index 9b4b937..0f3f05b 100644
--- a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/ImageStoreProvider.java
+++ b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/ImageStoreProvider.java
@@ -24,4 +24,6 @@ import com.cloud.storage.ScopeType;
 public interface ImageStoreProvider extends DataStoreProvider {
 
     public boolean isScopeSupported(ScopeType scope);
+
+    public boolean needDownloadSysTemplate();
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/36c1538f/engine/api/src/org/apache/cloudstack/storage/datastore/db/SnapshotDataStoreVO.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/storage/datastore/db/SnapshotDataStoreVO.java
b/engine/api/src/org/apache/cloudstack/storage/datastore/db/SnapshotDataStoreVO.java
index af478ab..0085086 100644
--- a/engine/api/src/org/apache/cloudstack/storage/datastore/db/SnapshotDataStoreVO.java
+++ b/engine/api/src/org/apache/cloudstack/storage/datastore/db/SnapshotDataStoreVO.java
@@ -51,7 +51,7 @@ public class SnapshotDataStoreVO implements StateObject<ObjectInDataStoreStateMa
 
 	@Column(name="store_id")
 	private long dataStoreId;
-	
+
 	@Column(name="store_role")
 	@Enumerated(EnumType.STRING)
 	private DataStoreRole role;
@@ -74,7 +74,7 @@ public class SnapshotDataStoreVO implements StateObject<ObjectInDataStoreStateMa
 
 	@Column(name="parent_snapshot_id")
 	private long parentSnapshotId;
-	
+
 	@Column (name="job_id")
 	private String jobId;
 
@@ -236,6 +236,11 @@ public class SnapshotDataStoreVO implements StateObject<ObjectInDataStoreStateMa
         return this.state;
     }
 
+
+    public void setState(ObjectInDataStoreStateMachine.State state) {
+        this.state = state;
+    }
+
     @Override
     public long getObjectId() {
         return this.getSnapshotId();

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/36c1538f/engine/api/src/org/apache/cloudstack/storage/datastore/db/VolumeDataStoreVO.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/storage/datastore/db/VolumeDataStoreVO.java
b/engine/api/src/org/apache/cloudstack/storage/datastore/db/VolumeDataStoreVO.java
index 7593e2c..c722bbf 100755
--- a/engine/api/src/org/apache/cloudstack/storage/datastore/db/VolumeDataStoreVO.java
+++ b/engine/api/src/org/apache/cloudstack/storage/datastore/db/VolumeDataStoreVO.java
@@ -347,6 +347,11 @@ public class VolumeDataStoreVO implements StateObject<ObjectInDataStoreStateMach
         return this.state;
     }
 
+
+    public void setState(ObjectInDataStoreStateMachine.State state) {
+        this.state = state;
+    }
+
     @Override
     public long getObjectId() {
         return this.getVolumeId();

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/36c1538f/engine/storage/src/org/apache/cloudstack/storage/datastore/ObjectInDataStoreManagerImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/datastore/ObjectInDataStoreManagerImpl.java
b/engine/storage/src/org/apache/cloudstack/storage/datastore/ObjectInDataStoreManagerImpl.java
index 3b01475..f16afa0 100644
--- a/engine/storage/src/org/apache/cloudstack/storage/datastore/ObjectInDataStoreManagerImpl.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/datastore/ObjectInDataStoreManagerImpl.java
@@ -23,6 +23,7 @@ import org.apache.cloudstack.engine.subsystem.api.storage.DataObjectInStore;
 import org.apache.cloudstack.engine.subsystem.api.storage.DataObjectType;
 import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
 import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreManager;
+import org.apache.cloudstack.engine.subsystem.api.storage.ObjectInDataStoreStateMachine;
 import org.apache.cloudstack.engine.subsystem.api.storage.ObjectInDataStoreStateMachine.Event;
 import org.apache.cloudstack.engine.subsystem.api.storage.ObjectInDataStoreStateMachine.State;
 import org.apache.cloudstack.engine.subsystem.api.storage.SnapshotDataFactory;
@@ -109,6 +110,7 @@ public class ObjectInDataStoreManagerImpl implements ObjectInDataStoreManager
{
                 ss.setSnapshotId(obj.getId());
                 ss.setDataStoreId(dataStore.getId());
                 ss.setRole(dataStore.getRole());
+                ss.setState(ObjectInDataStoreStateMachine.State.Allocated);
                 ss = snapshotDataStoreDao.persist(ss);
             }
         } else {
@@ -121,6 +123,7 @@ public class ObjectInDataStoreManagerImpl implements ObjectInDataStoreManager
{
                 if (dataStore.getRole() == DataStoreRole.ImageCache) {
                 	ts.setInstallPath("template/tmpl/" + templateDao.findById(obj.getId()).getAccountId()
+ "/" + obj.getId());
                 }
+                ts.setState(ObjectInDataStoreStateMachine.State.Allocated);
                 ts = templateDataStoreDao.persist(ts);
                 break;
             case SNAPSHOT:
@@ -131,6 +134,7 @@ public class ObjectInDataStoreManagerImpl implements ObjectInDataStoreManager
{
                 if (dataStore.getRole() == DataStoreRole.ImageCache) {
                 	ss.setInstallPath("/snapshots/" + snapshotDao.findById(obj.getId()).getAccountId()
+ "/" + obj.getId());
                 }
+                ss.setState(ObjectInDataStoreStateMachine.State.Allocated);
                 ss = snapshotDataStoreDao.persist(ss);
                 break;
             case VOLUME:
@@ -140,6 +144,7 @@ public class ObjectInDataStoreManagerImpl implements ObjectInDataStoreManager
{
                 if (dataStore.getRole() == DataStoreRole.ImageCache) {
                 	vs.setInstallPath("/volumes/" + volumeDao.findById(obj.getId()).getAccountId()
+ "/" + obj.getId());
                 }
+                vs.setState(ObjectInDataStoreStateMachine.State.Allocated);
                 vs = volumeDataStoreDao.persist(vs);
                 break;
             }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/36c1538f/engine/storage/src/org/apache/cloudstack/storage/image/datastore/ImageStoreHelper.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/image/datastore/ImageStoreHelper.java
b/engine/storage/src/org/apache/cloudstack/storage/image/datastore/ImageStoreHelper.java
index 64f8591..1d24f12 100644
--- a/engine/storage/src/org/apache/cloudstack/storage/image/datastore/ImageStoreHelper.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/image/datastore/ImageStoreHelper.java
@@ -70,7 +70,7 @@ public class ImageStoreHelper {
         store.setScope((ScopeType)params.get("scope"));
         store.setUuid((String)params.get("uuid"));
         store.setUrl((String)params.get("url"));
-        store.setRole(DataStoreRole.getRole((String)params.get("role")));
+        store.setRole((DataStoreRole)params.get("role"));
         store = imageStoreDao.persist(store);
 
         // persist details

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/36c1538f/plugins/storage/image/default/src/org/apache/cloudstack/storage/datastore/lifecycle/CloudStackImageStoreLifeCycleImpl.java
----------------------------------------------------------------------
diff --git a/plugins/storage/image/default/src/org/apache/cloudstack/storage/datastore/lifecycle/CloudStackImageStoreLifeCycleImpl.java
b/plugins/storage/image/default/src/org/apache/cloudstack/storage/datastore/lifecycle/CloudStackImageStoreLifeCycleImpl.java
index 922205a..84df712 100644
--- a/plugins/storage/image/default/src/org/apache/cloudstack/storage/datastore/lifecycle/CloudStackImageStoreLifeCycleImpl.java
+++ b/plugins/storage/image/default/src/org/apache/cloudstack/storage/datastore/lifecycle/CloudStackImageStoreLifeCycleImpl.java
@@ -46,6 +46,7 @@ import com.cloud.resource.Discoverer;
 import com.cloud.resource.ResourceListener;
 import com.cloud.resource.ResourceManager;
 import com.cloud.resource.ServerResource;
+import com.cloud.storage.DataStoreRole;
 import com.cloud.storage.ScopeType;
 import com.cloud.utils.UriUtils;
 
@@ -80,6 +81,7 @@ public class CloudStackImageStoreLifeCycleImpl implements ImageStoreLifeCycle
{
         Long dcId = (Long) dsInfos.get("zoneId");
         String url = (String) dsInfos.get("url");
         String providerName = (String)dsInfos.get("providerName");
+        DataStoreRole role =(DataStoreRole) dsInfos.get("role");
         Map<String, String> details = (Map<String, String>)dsInfos.get("details");
 
         s_logger.info("Trying to add a new host at " + url + " in data center " + dcId);
@@ -115,6 +117,8 @@ public class CloudStackImageStoreLifeCycleImpl implements ImageStoreLifeCycle
{
         imageStoreParameters.put("protocol", uri.getScheme().toLowerCase());
         imageStoreParameters.put("scope", ScopeType.ZONE);  // default cloudstack provider
only supports zone-wide image store
         imageStoreParameters.put("providerName", providerName);
+        imageStoreParameters.put("role", role);
+
 
         ImageStoreVO ids = imageStoreHelper.createImageStore(imageStoreParameters, details);
         return imageStoreMgr.getImageStore(ids.getId());

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/36c1538f/plugins/storage/image/default/src/org/apache/cloudstack/storage/datastore/provider/CloudStackImageStoreProviderImpl.java
----------------------------------------------------------------------
diff --git a/plugins/storage/image/default/src/org/apache/cloudstack/storage/datastore/provider/CloudStackImageStoreProviderImpl.java
b/plugins/storage/image/default/src/org/apache/cloudstack/storage/datastore/provider/CloudStackImageStoreProviderImpl.java
index fdeba4d..953a078 100644
--- a/plugins/storage/image/default/src/org/apache/cloudstack/storage/datastore/provider/CloudStackImageStoreProviderImpl.java
+++ b/plugins/storage/image/default/src/org/apache/cloudstack/storage/datastore/provider/CloudStackImageStoreProviderImpl.java
@@ -94,5 +94,10 @@ public class CloudStackImageStoreProviderImpl implements ImageStoreProvider
{
         return false;
     }
 
+    @Override
+    public boolean needDownloadSysTemplate() {
+         return false;
+    }
+
 
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/36c1538f/plugins/storage/image/s3/src/org/apache/cloudstack/storage/datastore/lifecycle/S3ImageStoreLifeCycleImpl.java
----------------------------------------------------------------------
diff --git a/plugins/storage/image/s3/src/org/apache/cloudstack/storage/datastore/lifecycle/S3ImageStoreLifeCycleImpl.java
b/plugins/storage/image/s3/src/org/apache/cloudstack/storage/datastore/lifecycle/S3ImageStoreLifeCycleImpl.java
index c384356..05c9e37 100644
--- a/plugins/storage/image/s3/src/org/apache/cloudstack/storage/datastore/lifecycle/S3ImageStoreLifeCycleImpl.java
+++ b/plugins/storage/image/s3/src/org/apache/cloudstack/storage/datastore/lifecycle/S3ImageStoreLifeCycleImpl.java
@@ -47,6 +47,7 @@ import com.cloud.resource.Discoverer;
 import com.cloud.resource.ResourceListener;
 import com.cloud.resource.ResourceManager;
 import com.cloud.resource.ServerResource;
+import com.cloud.storage.DataStoreRole;
 import com.cloud.storage.ScopeType;
 import com.cloud.storage.s3.S3Manager;
 import com.cloud.utils.UriUtils;
@@ -85,6 +86,7 @@ public class S3ImageStoreLifeCycleImpl implements ImageStoreLifeCycle {
         String url = (String) dsInfos.get("url");
         String providerName = (String)dsInfos.get("providerName");
         ScopeType scope = (ScopeType)dsInfos.get("scope");
+        DataStoreRole role =(DataStoreRole) dsInfos.get("role");
         Map<String, String> details = (Map<String, String>)dsInfos.get("details");
 
         s_logger.info("Trying to add a S3 store in data center " + dcId);
@@ -113,6 +115,7 @@ public class S3ImageStoreLifeCycleImpl implements ImageStoreLifeCycle
{
             imageStoreParameters.put("scope", ScopeType.REGION);
         }
         imageStoreParameters.put("providerName", providerName);
+        imageStoreParameters.put("role", role);
 
         ImageStoreVO ids = imageStoreHelper.createImageStore(imageStoreParameters, details);
         return imageStoreMgr.getImageStore(ids.getId());

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/36c1538f/plugins/storage/image/s3/src/org/apache/cloudstack/storage/datastore/provider/S3ImageStoreProviderImpl.java
----------------------------------------------------------------------
diff --git a/plugins/storage/image/s3/src/org/apache/cloudstack/storage/datastore/provider/S3ImageStoreProviderImpl.java
b/plugins/storage/image/s3/src/org/apache/cloudstack/storage/datastore/provider/S3ImageStoreProviderImpl.java
index ba27d61..174e2db 100644
--- a/plugins/storage/image/s3/src/org/apache/cloudstack/storage/datastore/provider/S3ImageStoreProviderImpl.java
+++ b/plugins/storage/image/s3/src/org/apache/cloudstack/storage/datastore/provider/S3ImageStoreProviderImpl.java
@@ -94,5 +94,10 @@ public class S3ImageStoreProviderImpl implements ImageStoreProvider {
         return false;
     }
 
+    @Override
+    public boolean needDownloadSysTemplate() {
+         return true;
+    }
+
 
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/36c1538f/plugins/storage/image/sample/src/org/apache/cloudstack/storage/datastore/provider/SampleImageStoreProviderImpl.java
----------------------------------------------------------------------
diff --git a/plugins/storage/image/sample/src/org/apache/cloudstack/storage/datastore/provider/SampleImageStoreProviderImpl.java
b/plugins/storage/image/sample/src/org/apache/cloudstack/storage/datastore/provider/SampleImageStoreProviderImpl.java
index eadb01d..4b96da7 100644
--- a/plugins/storage/image/sample/src/org/apache/cloudstack/storage/datastore/provider/SampleImageStoreProviderImpl.java
+++ b/plugins/storage/image/sample/src/org/apache/cloudstack/storage/datastore/provider/SampleImageStoreProviderImpl.java
@@ -88,5 +88,10 @@ public class SampleImageStoreProviderImpl implements ImageStoreProvider
{
         return false;
     }
 
+    @Override
+    public boolean needDownloadSysTemplate() {
+        return false;
+    }
+
 
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/36c1538f/plugins/storage/image/swift/src/org/apache/cloudstack/storage/datastore/lifecycle/SwiftImageStoreLifeCycleImpl.java
----------------------------------------------------------------------
diff --git a/plugins/storage/image/swift/src/org/apache/cloudstack/storage/datastore/lifecycle/SwiftImageStoreLifeCycleImpl.java
b/plugins/storage/image/swift/src/org/apache/cloudstack/storage/datastore/lifecycle/SwiftImageStoreLifeCycleImpl.java
index 799d4e0..20e0939 100644
--- a/plugins/storage/image/swift/src/org/apache/cloudstack/storage/datastore/lifecycle/SwiftImageStoreLifeCycleImpl.java
+++ b/plugins/storage/image/swift/src/org/apache/cloudstack/storage/datastore/lifecycle/SwiftImageStoreLifeCycleImpl.java
@@ -46,6 +46,7 @@ import com.cloud.resource.Discoverer;
 import com.cloud.resource.ResourceListener;
 import com.cloud.resource.ResourceManager;
 import com.cloud.resource.ServerResource;
+import com.cloud.storage.DataStoreRole;
 import com.cloud.storage.ScopeType;
 import com.cloud.utils.UriUtils;
 
@@ -81,6 +82,8 @@ public class SwiftImageStoreLifeCycleImpl implements ImageStoreLifeCycle
{
         String url = (String) dsInfos.get("url");
         ScopeType scope = (ScopeType)dsInfos.get("scope");
         String providerName = (String)dsInfos.get("providerName");
+        DataStoreRole role =(DataStoreRole) dsInfos.get("role");
+
         Map<String, String> details = (Map<String, String>)dsInfos.get("details");
 
         s_logger.info("Trying to add a swift store at " + url + " in data center " + dcId);
@@ -97,8 +100,9 @@ public class SwiftImageStoreLifeCycleImpl implements ImageStoreLifeCycle
{
             imageStoreParameters.put("scope", ScopeType.REGION);
         }
         imageStoreParameters.put("providerName", providerName);
+        imageStoreParameters.put("role", role);
 
-        ImageStoreVO ids = imageStoreHelper.createImageStore(imageStoreParameters);
+        ImageStoreVO ids = imageStoreHelper.createImageStore(imageStoreParameters, details);
         return imageStoreMgr.getImageStore(ids.getId());
     }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/36c1538f/plugins/storage/image/swift/src/org/apache/cloudstack/storage/datastore/provider/SwiftImageStoreProviderImpl.java
----------------------------------------------------------------------
diff --git a/plugins/storage/image/swift/src/org/apache/cloudstack/storage/datastore/provider/SwiftImageStoreProviderImpl.java
b/plugins/storage/image/swift/src/org/apache/cloudstack/storage/datastore/provider/SwiftImageStoreProviderImpl.java
index 09f09c4..2ba2e9d 100644
--- a/plugins/storage/image/swift/src/org/apache/cloudstack/storage/datastore/provider/SwiftImageStoreProviderImpl.java
+++ b/plugins/storage/image/swift/src/org/apache/cloudstack/storage/datastore/provider/SwiftImageStoreProviderImpl.java
@@ -96,5 +96,10 @@ public class SwiftImageStoreProviderImpl implements ImageStoreProvider
{
         return false;
     }
 
+    @Override
+    public boolean needDownloadSysTemplate() {
+         return true;
+    }
+
 
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/36c1538f/server/src/com/cloud/storage/StorageManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/StorageManagerImpl.java b/server/src/com/cloud/storage/StorageManagerImpl.java
index 05b2257..2eb9370 100755
--- a/server/src/com/cloud/storage/StorageManagerImpl.java
+++ b/server/src/com/cloud/storage/StorageManagerImpl.java
@@ -1913,8 +1913,10 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager,
C
             throw new CloudRuntimeException("Failed to add data store", e);
         }
 
-        // trigger system vm template download
-        this._imageSrv.downloadBootstrapSysTemplate(store);
+        if (((ImageStoreProvider) storeProvider).needDownloadSysTemplate()) {
+            // trigger system vm template download
+            this._imageSrv.downloadBootstrapSysTemplate(store);
+        }
 
         return (ImageStore) _dataStoreMgr.getDataStore(store.getId(), DataStoreRole.Image);
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/36c1538f/server/src/com/cloud/storage/download/DownloadMonitorImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/download/DownloadMonitorImpl.java b/server/src/com/cloud/storage/download/DownloadMonitorImpl.java
index 30549cf..e37a04d 100755
--- a/server/src/com/cloud/storage/download/DownloadMonitorImpl.java
+++ b/server/src/com/cloud/storage/download/DownloadMonitorImpl.java
@@ -74,6 +74,7 @@ import com.cloud.template.TemplateManager;
 import com.cloud.template.VirtualMachineTemplate;
 import com.cloud.user.AccountManager;
 import com.cloud.user.ResourceLimitService;
+import com.cloud.utils.component.ComponentContext;
 import com.cloud.utils.component.ManagerBase;
 import com.cloud.utils.db.DB;
 import com.cloud.utils.db.JoinBuilder;
@@ -160,7 +161,9 @@ public class DownloadMonitorImpl extends ManagerBase implements DownloadMonitor
 
         _copyAuthPasswd = configs.get("secstorage.copy.password");
 
-        _agentMgr.registerForHostEvents(new DownloadListener(this), true, false, false);
+        DownloadListener dl = new DownloadListener(this);
+        ComponentContext.inject(dl);
+        _agentMgr.registerForHostEvents(dl, true, false, false);
 
         ReadyTemplateStatesSearch = _vmTemplateStoreDao.createSearchBuilder();
         ReadyTemplateStatesSearch.and("state", ReadyTemplateStatesSearch.entity().getState(),
SearchCriteria.Op.EQ);
@@ -229,6 +232,7 @@ public class DownloadMonitorImpl extends ManagerBase implements DownloadMonitor
             }
             DownloadListener dl = new DownloadListener(ep, store, template, _timer, this,
dcmd,
                      callback);
+            ComponentContext.inject(dl);  // initialize those auto-wired field in download
listener.
             if (downloadJobExists) {
                 // due to handling existing download job issues, we still keep
                 // downloadState in template_store_ref to avoid big change in
@@ -298,6 +302,7 @@ public class DownloadMonitorImpl extends ManagerBase implements DownloadMonitor
                 return;
             }
             DownloadListener dl = new DownloadListener(ep, store, volume, _timer, this, dcmd,
callback);
+            ComponentContext.inject(dl); // auto-wired those injected fields in DownloadListener
 
             if (downloadJobExists) {
                 dl.setCurrState(volumeHost.getDownloadState());

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/36c1538f/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 e6a41e7..c4fd848 100755
--- a/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java
+++ b/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java
@@ -1347,7 +1347,7 @@ public class SecondaryStorageManagerImpl extends ManagerBase implements
Secondar
 			}
 		}
         */
-		return host;
+		return null; // no need to handle this event anymore since secondary storage is not in
host table anymore.
     }
 
 	@Override

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/36c1538f/setup/db/db/schema-410to420.sql
----------------------------------------------------------------------
diff --git a/setup/db/db/schema-410to420.sql b/setup/db/db/schema-410to420.sql
index 9d9016e..9c492b6 100644
--- a/setup/db/db/schema-410to420.sql
+++ b/setup/db/db/schema-410to420.sql
@@ -76,6 +76,7 @@ CREATE TABLE `cloud`.`image_store` (
   `url` varchar(255) COMMENT 'url for image data store',
   `data_center_id` bigint unsigned  COMMENT 'datacenter id of data store',
   `scope` varchar(255) COMMENT 'scope of data store',
+  `role` varchar(255) COMMENT 'role of data store',
   `uuid` varchar(255) COMMENT 'uuid of data store',
   `parent` varchar(255) COMMENT 'parent path for the storage server',
   `created` datetime COMMENT 'date the image store first signed on',
@@ -135,6 +136,8 @@ CREATE TABLE  `cloud`.`template_store_ref` (
   `state` varchar(255) NOT NULL,
   `destroyed` tinyint(1) COMMENT 'indicates whether the template_store entry was destroyed
by the user or not',
   `is_copy` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'indicates whether this was copied ',
+  `update_count` bigint unsigned,
+  `updated` datetime, 
   PRIMARY KEY  (`id`),
 --  CONSTRAINT `fk_template_store_ref__store_id` FOREIGN KEY `fk_template_store_ref__store_id`
(`store_id`) REFERENCES `image_store` (`id`) ON DELETE CASCADE,
   INDEX `i_template_store_ref__store_id`(`store_id`),
@@ -160,11 +163,14 @@ CREATE TABLE  `cloud`.`snapshot_store_ref` (
   `created` DATETIME NOT NULL,
   `last_updated` DATETIME,
   `job_id` varchar(255),
+  `store_role` varchar(255),
   `size` bigint unsigned,
   `physical_size` bigint unsigned DEFAULT 0,
   `install_path` varchar(255),
   `state` varchar(255) NOT NULL,  
   `destroyed` tinyint(1) COMMENT 'indicates whether the snapshot_store entry was destroyed
by the user or not',
+  `update_count` bigint unsigned,
+  `updated` datetime,   
   PRIMARY KEY  (`id`),
   CONSTRAINT `fk_snapshot_store_ref__store_id` FOREIGN KEY `fk_snapshot_store_ref__store_id`
(`store_id`) REFERENCES `image_store` (`id`) ON DELETE CASCADE,
   INDEX `i_snapshot_store_ref__store_id`(`store_id`),
@@ -192,6 +198,8 @@ CREATE TABLE  `cloud`.`volume_store_ref` (
   `state` varchar(255) NOT NULL,  
   `format` varchar(32) NOT NULL COMMENT 'format for the volume', 
   `destroyed` tinyint(1) COMMENT 'indicates whether the volume_host entry was destroyed by
the user or not',
+  `update_count` bigint unsigned,
+  `updated` datetime,   
   PRIMARY KEY  (`id`),
   CONSTRAINT `fk_volume_store_ref__store_id` FOREIGN KEY `fk_volume_store_ref__store_id`
(`store_id`) REFERENCES `image_store` (`id`) ON DELETE CASCADE,
   INDEX `i_volume_store_ref__store_id`(`store_id`),

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/36c1538f/tools/marvin/marvin/configGenerator.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/configGenerator.py b/tools/marvin/marvin/configGenerator.py
index e2a6a24..8235b09 100644
--- a/tools/marvin/marvin/configGenerator.py
+++ b/tools/marvin/marvin/configGenerator.py
@@ -70,6 +70,7 @@ class zone():
         self.physical_networks = []
         self.pods = []
         self.secondaryStorages = []
+
         
 class traffictype():
     def __init__(self, typ, labeldict=None):
@@ -178,6 +179,8 @@ class primaryStorage():
 class secondaryStorage():
     def __init__(self):
         self.url = None
+        self.providerName = None
+        self.details = None
 
 class s3():
     def __init__(self):

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/36c1538f/tools/marvin/marvin/deployDataCenter.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/deployDataCenter.py b/tools/marvin/marvin/deployDataCenter.py
index cec920c..aaf0501 100644
--- a/tools/marvin/marvin/deployDataCenter.py
+++ b/tools/marvin/marvin/deployDataCenter.py
@@ -138,10 +138,12 @@ class deployDataCenters():
         if secondaryStorages is None:
             return
         for secondary in secondaryStorages:
-            secondarycmd = addSecondaryStorage.addSecondaryStorageCmd()
+            secondarycmd = addImageStore.addImageStoreCmd()
             secondarycmd.url = secondary.url
+            secondarycmd.provider = secondary.providerName
+            """if secondary.provider == "CloudStack ImageStore Provider":"""
             secondarycmd.zoneid = zoneId
-            self.apiClient.addSecondaryStorage(secondarycmd)
+            self.apiClient.addImageStore(secondarycmd)
 
     def createnetworks(self, networks, zoneId):
         if networks is None:


Mime
View raw message