cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mc...@apache.org
Subject git commit: updated refs/heads/object_store to 292e77b
Date Thu, 09 May 2013 23:19:41 GMT
Updated Branches:
  refs/heads/object_store fa1157521 -> 292e77b96


Fix marvin test to add S3 image store and cache storage.

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

Branch: refs/heads/object_store
Commit: 292e77b96b0a518765a5065320cec45bf87ef1ec
Parents: fa11575
Author: Min Chen <min.chen@citrix.com>
Authored: Thu May 9 16:19:06 2013 -0700
Committer: Min Chen <min.chen@citrix.com>
Committed: Thu May 9 16:19:06 2013 -0700

----------------------------------------------------------------------
 client/tomcatconf/commands.properties.in           |    1 +
 .../resource/LocalNfsSecondaryStorageResource.java |    4 +
 .../cloudstack/storage/LocalHostEndpoint.java      |    2 +-
 .../src/com/cloud/server/ManagementServerImpl.java |    1 +
 setup/db/db/schema-410to420.sql                    |    3 +-
 tools/devcloud/devcloud.cfg                        |    2 +-
 tools/devcloud/devcloud_s3.cfg                     |  141 +++++++++++++++
 tools/marvin/marvin/configGenerator.py             |    7 +
 tools/marvin/marvin/deployDataCenter.py            |   21 ++-
 9 files changed, 177 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/292e77b9/client/tomcatconf/commands.properties.in
----------------------------------------------------------------------
diff --git a/client/tomcatconf/commands.properties.in b/client/tomcatconf/commands.properties.in
index 002da87..c935122 100644
--- a/client/tomcatconf/commands.properties.in
+++ b/client/tomcatconf/commands.properties.in
@@ -245,6 +245,7 @@ listS3s=1
 addImageStore=1
 listImageStores=1
 deleteImageStore=1
+createCacheStore=1
 
 #### host commands
 addHost=3

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/292e77b9/core/src/com/cloud/storage/resource/LocalNfsSecondaryStorageResource.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/storage/resource/LocalNfsSecondaryStorageResource.java b/core/src/com/cloud/storage/resource/LocalNfsSecondaryStorageResource.java
index a2cf757..4c708af 100644
--- a/core/src/com/cloud/storage/resource/LocalNfsSecondaryStorageResource.java
+++ b/core/src/com/cloud/storage/resource/LocalNfsSecondaryStorageResource.java
@@ -32,6 +32,10 @@ import com.cloud.utils.exception.CloudRuntimeException;
 public class LocalNfsSecondaryStorageResource extends
 		NfsSecondaryStorageResource {
 
+    public LocalNfsSecondaryStorageResource(){
+        this._dlMgr = new DownloadManagerImpl();
+    }
+
     @Override
     public Answer executeRequest(Command cmd) {
         if (cmd instanceof DownloadSystemTemplateCommand){

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/292e77b9/engine/storage/src/org/apache/cloudstack/storage/LocalHostEndpoint.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/LocalHostEndpoint.java b/engine/storage/src/org/apache/cloudstack/storage/LocalHostEndpoint.java
index 1ae13b6..d689f36 100644
--- a/engine/storage/src/org/apache/cloudstack/storage/LocalHostEndpoint.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/LocalHostEndpoint.java
@@ -23,7 +23,7 @@ public class LocalHostEndpoint implements EndPoint {
 	private ScheduledExecutorService executor;
 	ServerResource resource;
 	public LocalHostEndpoint() {
-		resource = ComponentContext.inject(LocalNfsSecondaryStorageResource.class);
+		resource = new LocalNfsSecondaryStorageResource();
 		executor = Executors.newScheduledThreadPool(10);
 	}
 	@Override

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/292e77b9/server/src/com/cloud/server/ManagementServerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/server/ManagementServerImpl.java b/server/src/com/cloud/server/ManagementServerImpl.java
index 92d8c7b..b0f0fcb 100755
--- a/server/src/com/cloud/server/ManagementServerImpl.java
+++ b/server/src/com/cloud/server/ManagementServerImpl.java
@@ -2153,6 +2153,7 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe
         cmdList.add(AddImageStoreCmd.class);
         cmdList.add(ListImageStoresCmd.class);
         cmdList.add(DeleteImageStoreCmd.class);
+        cmdList.add(CreateCacheStoreCmd.class);
         return cmdList;
     }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/292e77b9/setup/db/db/schema-410to420.sql
----------------------------------------------------------------------
diff --git a/setup/db/db/schema-410to420.sql b/setup/db/db/schema-410to420.sql
index 6ce0d2d..75d29f6 100644
--- a/setup/db/db/schema-410to420.sql
+++ b/setup/db/db/schema-410to420.sql
@@ -115,7 +115,8 @@ CREATE VIEW `cloud`.`image_store_view` AS
             left join
         `cloud`.`data_center` ON image_store.data_center_id = data_center.id
             left join
-        `cloud`.`image_store_details` ON image_store_details.store_id = image_store.id;
+        `cloud`.`image_store_details` ON image_store_details.store_id = image_store.id
+    where image_store.role = 'Image';
             
 -- here we have to allow null for store_id to accomodate baremetal case to search for ready
templates since template state is only stored in this table
 -- FK also commented out due to this            

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

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/292e77b9/tools/devcloud/devcloud_s3.cfg
----------------------------------------------------------------------
diff --git a/tools/devcloud/devcloud_s3.cfg b/tools/devcloud/devcloud_s3.cfg
new file mode 100644
index 0000000..885f54a
--- /dev/null
+++ b/tools/devcloud/devcloud_s3.cfg
@@ -0,0 +1,141 @@
+#  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.
+#
+
+{
+    "zones": [
+        {
+            "name": "DevCloud0", 
+            "physical_networks": [
+                {
+                    "broadcastdomainrange": "Zone", 
+                    "name": "test-network", 
+                    "traffictypes": [
+                        {
+                            "typ": "Guest"
+                        }, 
+                        {
+                            "typ": "Management"
+                        } 
+                    ], 
+                    "providers": [
+                        {
+                            "broadcastdomainrange": "ZONE", 
+                            "name": "VirtualRouter"
+                        },
+                        {
+                            "broadcastdomainrange": "Pod",
+                            "name": "SecurityGroupProvider"
+                        }
+                    ]
+                }
+            ],
+            "dns2": "4.4.4.4", 
+            "dns1": "8.8.8.8",
+            "securitygroupenabled": "true", 
+            "localstorageenabled": "true",
+            "networktype": "Basic", 
+            "pods": [
+                {
+                    "endip": "192.168.56.220", 
+                    "name": "test00", 
+                    "startip": "192.168.56.200", 
+                    "guestIpRanges": [
+                        {
+                            "startip": "192.168.56.100", 
+                            "endip": "192.168.56.199", 
+                            "netmask": "255.255.255.0", 
+                            "gateway": "192.168.56.1"
+                        }
+                    ], 
+                    "netmask": "255.255.255.0", 
+                    "clusters": [
+                        {
+                            "clustername": "test000", 
+                            "hypervisor": "XenServer", 
+                            "hosts": [
+                                {
+                                    "username": "root", 
+                                    "url": "http://192.168.56.10/", 
+                                    "password": "password"
+                                }
+                            ], 
+                            "clustertype": "CloudManaged"
+                        }
+                    ], 
+                    "gateway": "192.168.56.1"
+                }
+            ], 
+            "internaldns1": "192.168.56.1", 
+            "secondaryStorages": [
+                {
+                    "providerName": "S3",
+                    "details": [
+                        {
+                            "key" : "accesskey",
+                            "value" :"OYAZXCAFUC1DAFOXNJWI"
+                        },
+                        {
+                            "key" : "secretkey",
+                            "value" : "OYAZXCAFUC1DAFOXNJWI"
+                        },
+                        {
+                            "key" : "endpoint",
+                            "value" : "10.223.89.7:8080"
+                        },
+                        {
+                            "key" : "bucket",
+                            "value" : "cloudstack" 
+                        }
+                    ]
+                }
+            ],
+            "cacheStorages": [
+                {
+                    "url": "nfs://192.168.56.10/opt/storage/cache",
+                    "providerName": "NFS",
+                    "details": [
+                    ]
+                }
+            ]            
+         }
+    ], 
+    "logger": [
+        {
+            "name": "TestClient", 
+            "file": "/tmp/testclient.log"
+        }, 
+        {
+            "name": "TestCase", 
+            "file": "/tmp/testcase.log"
+        }
+    ], 
+    "mgtSvr": [
+        {
+            "mgtSvrIp": "127.0.0.1", 
+            "port": 8096
+        }
+    ],
+    "dbSvr": 
+        {
+	    "dbSvr": "127.0.0.1",
+	    "port": 3306,
+	    "user": "cloud",
+	    "passwd": "cloud",
+	    "db": "cloud"
+        }
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/292e77b9/tools/marvin/marvin/configGenerator.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/configGenerator.py b/tools/marvin/marvin/configGenerator.py
index 8235b09..adb8f54 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 = []
+        self.cacheStorages = []
 
         
 class traffictype():
@@ -182,6 +183,12 @@ class secondaryStorage():
         self.providerName = None
         self.details = None
 
+class cacheStorage():
+    def __init__(self):
+        self.url = None
+        self.providerName = None
+        self.details = None
+        
 class s3():
     def __init__(self):
         self.accesskey = None

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/292e77b9/tools/marvin/marvin/deployDataCenter.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/deployDataCenter.py b/tools/marvin/marvin/deployDataCenter.py
index aaf0501..164af74 100644
--- a/tools/marvin/marvin/deployDataCenter.py
+++ b/tools/marvin/marvin/deployDataCenter.py
@@ -141,10 +141,26 @@ class deployDataCenters():
             secondarycmd = addImageStore.addImageStoreCmd()
             secondarycmd.url = secondary.url
             secondarycmd.provider = secondary.providerName
-            """if secondary.provider == "CloudStack ImageStore Provider":"""
-            secondarycmd.zoneid = zoneId
+            secondarycmd.details = []
+            for item in secondary.details:
+                secondarycmd.details.append(item.__dict__)
+            if secondarycmd.provider == "NFS":
+                secondarycmd.zoneid = zoneId
             self.apiClient.addImageStore(secondarycmd)
 
+    def createCacheStorages(self, cacheStorages, zoneId):
+        if cacheStorages is None:
+            return
+        for cache in cacheStorages:
+            cachecmd = createCacheStore.createCacheStoreCmd()
+            cachecmd.url = cache.url
+            cachecmd.provider = cache.providerName
+            cachecmd.zoneid = zoneId
+            cachecmd.details = []
+            for item in cache.details:
+                cachecmd.details.append(item.__dict__)            
+            self.apiClient.createCacheStore(cachecmd)
+            
     def createnetworks(self, networks, zoneId):
         if networks is None:
             return
@@ -322,6 +338,7 @@ class deployDataCenters():
                                         zoneId)
 
             self.createSecondaryStorages(zone.secondaryStorages, zoneId)
+            self.createCacheStorages(zone.cacheStorages, zoneId)
             self.enableZone(zoneId, "Enabled")
         return
     


Mime
View raw message