mirror of https://github.com/apache/cloudstack.git
Fix marvin test to add S3 image store and cache storage.
This commit is contained in:
parent
fa11575212
commit
292e77b96b
|
|
@ -245,6 +245,7 @@ listS3s=1
|
|||
addImageStore=1
|
||||
listImageStores=1
|
||||
deleteImageStore=1
|
||||
createCacheStore=1
|
||||
|
||||
#### host commands
|
||||
addHost=3
|
||||
|
|
|
|||
|
|
@ -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){
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@
|
|||
"secondaryStorages": [
|
||||
{
|
||||
"url": "nfs://192.168.56.10/opt/storage/secondary",
|
||||
"providerName": "CloudStack ImageStore Provider",
|
||||
"providerName": "NFS",
|
||||
"details": {
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue