Skip to content

Commit 939e448

Browse files
committed
Merge pull request #1458 from cloudsadhu/cloudsadhulocal
BUG-ID:CLOUDSTACK-9331:added code in marvin frame&new config file for advBaremetal support Added code in marvin framework&new config file to support baremetal advanced testcases * pr/1458: BUG-ID:CLOUDSTACK-9331:added code in marvin frame&new config file to support baremetal advanced testcases Signed-off-by: Will Stevens <williamstevens@gmail.com>
2 parents 9b525f5 + 5f16199 commit 939e448

File tree

2 files changed

+245
-4
lines changed

2 files changed

+245
-4
lines changed
Lines changed: 208 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,208 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
{
18+
"zones": [
19+
{
20+
"name": "ZoneBaremetal",
21+
"guestcidraddress": "10.1.1.0/24",
22+
"providers": [
23+
{
24+
"broadcastdomainrange": "ZONE",
25+
"name": "VirtualRouter"
26+
}
27+
],
28+
"dns1": "10.x.x.x",
29+
30+
"physical_networks": [
31+
{
32+
"broadcastdomainrange": "Zone",
33+
"name": "Sandbox-pnet",
34+
"vlan": "1020-1025",
35+
"traffictypes": [
36+
{
37+
"typ": "Guest"
38+
},
39+
{
40+
"typ": "Management"
41+
},
42+
{
43+
"typ": "Public"
44+
}
45+
],
46+
"providers": [
47+
{
48+
"broadcastdomainrange": "ZONE",
49+
"name": "VirtualRouter"
50+
}
51+
]
52+
}
53+
],
54+
"ipranges": [
55+
{
56+
"startip": "10.x.x.x",
57+
"endip": "10.x.x.x",
58+
"netmask": "255.255.255.0",
59+
"vlan": "1220",
60+
"gateway": "10.x.x.1"
61+
}
62+
],
63+
"networktype": "Advanced",
64+
"pods": [
65+
{
66+
"endip": "10.x.x.x",
67+
"name": "POD01",
68+
"startip": "10.x.x.x",
69+
"netmask": "255.255.255.192",
70+
"vmwaredc":{"name":"dc-baremetal","vcenter":"10.x.x.x","username":"Administrator@vsphere.local","password":"Password"},
71+
"clusters": [
72+
{
73+
"clustername": "10.x.x.x/dc-baremetal/cluster1",
74+
"hypervisor": "VmWare",
75+
"username": "Administrator@vsphere.local",
76+
"clustertype": "ExternalManaged",
77+
"password": "Password",
78+
"url": "http://10.x.x.x/dc-baremetal/cluster1",
79+
"hosts": [
80+
{
81+
"username": "root",
82+
"url": "http://10.x.x.x",
83+
"password": "password"
84+
},
85+
{
86+
"username": "root",
87+
"url": "http://10.x.x.x",
88+
"password": "password"
89+
}
90+
],
91+
"primaryStorages": [
92+
{
93+
"url": "nfs://10.x.x.x:/export/home/primary",
94+
"name": "PS0"
95+
}
96+
]
97+
},
98+
{
99+
"clustername": "C1",
100+
"hypervisor": "BareMetal",
101+
"hosts": [
102+
{
103+
"username": "root",
104+
"url": "http://10.x.x.x",
105+
"password": "password",
106+
"hostmac": "xx:xx:xx:xx:xx:xx",
107+
"cpunumber": "1",
108+
"cpuspeed": "1000",
109+
"memory": "1024",
110+
"hosttags": "host15"
111+
}
112+
],
113+
"clustertype": "CloudManaged"
114+
}
115+
],
116+
"gateway": "10.x.x.x"
117+
}
118+
],
119+
"internaldns1": "10.x.x.x",
120+
"baremetalrcturl": "http://10.x.x.x/baremetal/baremetalrct.json",
121+
"secondaryStorages": [
122+
{
123+
"url": "nfs://10.x.x.x:/export/home/secondary",
124+
"provider": "nfs",
125+
"name":"secondary"
126+
}
127+
]
128+
}
129+
],
130+
"logger": {
131+
"LogFolderPath": "/tmp/"
132+
},
133+
"dbSvr": {
134+
"dbSvr": "10.22.13.12",
135+
"passwd": "password",
136+
"db": "cloud",
137+
"port": 3306,
138+
"user": "root"
139+
},
140+
141+
"globalConfig": [
142+
{
143+
"name": "network.gc.wait",
144+
"value": "60"
145+
},
146+
{
147+
"name": "storage.cleanup.interval",
148+
"value": "30"
149+
},
150+
{
151+
"name": "account.cleanup.interval",
152+
"value": "60"
153+
},
154+
{
155+
"name": "secstorage.allowed.internal.sites",
156+
"value": "10.x.x.0/24"
157+
},
158+
{
159+
"name": "vm.op.wait.interval",
160+
"value": "5"
161+
},
162+
{
163+
"name": "network.gc.interval",
164+
"value": "60"
165+
},
166+
{
167+
"name": "guest.domain.suffix",
168+
"value": "auto.advanced"
169+
},
170+
{
171+
"name": "expunge.delay",
172+
"value": "60"
173+
},
174+
{
175+
"name": "vm.allocation.algorithm",
176+
"value": "userdispersing"
177+
},
178+
{
179+
"name": "expunge.interval",
180+
"value": "60"
181+
},
182+
{
183+
"name": "instance.name",
184+
"value": "QA"
185+
},
186+
{
187+
"name": "expunge.workers",
188+
"value": "3"
189+
},
190+
{
191+
"name": "baremetal.internal.storage.server.ip",
192+
"value": "10.2.1.2"
193+
},
194+
{
195+
"name": "check.pod.cidrs",
196+
"value": "true"
197+
}
198+
],
199+
"mgtSvr": [
200+
{
201+
"mgtSvrIp": "10.22.10.12",
202+
"port": 8096,
203+
"user": "root",
204+
"password": "password",
205+
"hypervisor": "vmware"
206+
}
207+
]
208+
}

tools/marvin/marvin/deployDataCenter.py

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,12 @@ def addHosts(self, hosts, zoneId, podId, clusterId, hypervisor):
133133
hostcmd.username = host.username
134134
hostcmd.zoneid = zoneId
135135
hostcmd.hypervisor = hypervisor
136+
if hostcmd.hypervisor.lower() == "baremetal":
137+
hostcmd.hostmac=host.hostmac
138+
hostcmd.cpunumber=host.cpunumber
139+
hostcmd.cpuspeed=host.cpuspeed
140+
hostcmd.memory=host.memory
141+
hostcmd.hosttags=host.hosttags
136142
ret = self.__apiClient.addHost(hostcmd)
137143
if ret:
138144
self.__tcRunLogger.debug("=== Add Host Successful ===")
@@ -164,6 +170,25 @@ def addVmWareDataCenter(self, vmwareDc):
164170
self.__tcRunLogger.exception("=== Adding VmWare DC Failed===")
165171
self.__cleanAndExit()
166172

173+
def addBaremetalRct(self, config):
174+
networktype= config.zones[0].networktype
175+
baremetalrcturl= config.zones[0].baremetalrcturl
176+
if networktype is None or baremetalrcturl is None:
177+
return
178+
if networktype.lower()=="advanced":
179+
180+
try:
181+
brctcmd = addBaremetalRct.addBaremetalRctCmd()
182+
brctcmd.baremetalrcturl=baremetalrcturl
183+
ret = self.__apiClient.addBaremetalRct(brctcmd)
184+
if ret.id:
185+
self.__tcRunLogger.debug("=== Adding Baremetal Rct file Successful===")
186+
self.__addToCleanUp("BaremetalRct", ret.id)
187+
except Exception as e:
188+
print "Exception Occurred: %s" % GetDetailExceptionInfo(e)
189+
self.__tcRunLogger.exception("=== Adding Baremetal Rct file Failed===")
190+
self.__cleanAndExit()
191+
167192
def createClusters(self, clusters, zoneId, podId, vmwareDc=None):
168193
try:
169194
if clusters is None:
@@ -193,10 +218,12 @@ def createClusters(self, clusters, zoneId, podId, vmwareDc=None):
193218
self.addHosts(cluster.hosts, zoneId, podId, clusterId,
194219
cluster.hypervisor)
195220
self.waitForHost(zoneId, clusterId)
196-
self.createPrimaryStorages(cluster.primaryStorages,
197-
zoneId,
198-
podId,
199-
clusterId)
221+
if cluster.hypervisor.lower() != "baremetal":
222+
self.createPrimaryStorages(cluster.primaryStorages,
223+
zoneId,
224+
podId,
225+
clusterId)
226+
200227
except Exception as e:
201228
print "Exception Occurred %s" % GetDetailExceptionInfo(e)
202229
self.__tcRunLogger.exception("====Cluster %s Creation Failed"
@@ -888,6 +915,12 @@ def deploy(self):
888915
self.__persistDcConfig()
889916
print "\n====Deploy DC Successful====="
890917
self.__tcRunLogger.debug("\n====Deploy DC Successful====")
918+
'''
919+
Upload baremetalSwitch configuration(.rct) file if enabled zone has baremetal isolated network.
920+
'''
921+
self.addBaremetalRct(self.__config)
922+
self.__tcRunLogger.debug("\n==== AddbaremetalRct Successful====")
923+
891924
return SUCCESS
892925
except Exception as e:
893926
print "\nException Occurred Under deploy :%s" % \

0 commit comments

Comments
 (0)