MCPcopy Create free account
hub / github.com/apache/cloudstack / createClusters

Method createClusters

tools/marvin/marvin/deployDataCenter.py:191–231  ·  view source on GitHub ↗
(self, clusters, zoneId, podId, vmwareDc=None)

Source from the content-addressed store, hash-verified

189 self.__cleanAndExit()
190
191 def createClusters(self, clusters, zoneId, podId, vmwareDc=None):
192 try:
193 if clusters is None:
194 return
195 if vmwareDc is not None:
196 vmwareDc.zoneid = zoneId
197 self.addVmWareDataCenter(vmwareDc)
198
199 for cluster in clusters:
200 clustercmd = addCluster.addClusterCmd()
201 clustercmd.clustername = cluster.clustername
202 clustercmd.clustertype = cluster.clustertype
203 clustercmd.hypervisor = cluster.hypervisor
204 clustercmd.password = cluster.password
205 clustercmd.podid = podId
206 clustercmd.url = cluster.url
207 clustercmd.username = cluster.username
208 clustercmd.zoneid = zoneId
209 clusterresponse = self.__apiClient.addCluster(clustercmd)
210 if clusterresponse[0].id:
211 clusterId = clusterresponse[0].id
212 self.__tcRunLogger.\
213 debug("Cluster Name : %s Id : %s Created Successfully"
214 % (str(cluster.clustername), str(clusterId)))
215 self.__addToCleanUp("Cluster", clusterId)
216 if cluster.hypervisor.lower() != "vmware":
217 self.addHosts(cluster.hosts, zoneId, podId, clusterId,
218 cluster.hypervisor)
219 self.waitForHost(zoneId, clusterId)
220 if cluster.hypervisor.lower() != "baremetal":
221 self.createPrimaryStorages(cluster.primaryStorages,
222 zoneId,
223 podId,
224 clusterId)
225
226 except Exception as e:
227 print("Exception Occurred %s" % GetDetailExceptionInfo(e))
228 self.__tcRunLogger.exception("====Cluster %s Creation Failed"
229 "=====" %
230 str(cluster.clustername))
231 self.__cleanAndExit()
232
233 def waitForHost(self, zoneId, clusterId):
234 """

Callers 1

createPodsMethod · 0.95

Calls 9

addVmWareDataCenterMethod · 0.95
__addToCleanUpMethod · 0.95
addHostsMethod · 0.95
waitForHostMethod · 0.95
createPrimaryStoragesMethod · 0.95
__cleanAndExitMethod · 0.95
GetDetailExceptionInfoFunction · 0.90
addClusterMethod · 0.80
debugMethod · 0.80

Tested by

no test coverage detected