mirror of
https://github.com/apache/cloudstack.git
synced 2025-12-15 18:12:35 +01:00
CLOUDSTACK-3074: include support for vmwaredc mapping to zone
vmware dc can be mapped to the zone after CLOUDSTACK-1963. include
support in marvin for adding the vmwaredc.
vmwaredc : {
name:
username:
vcenter:
password:
zoneid:
}
Will be sent during pod creation before cluster creation.
Signed-off-by: Prasanna Santhanam <tsp@apache.org>
This commit is contained in:
parent
87c401aaaf
commit
f3e3048682
@ -105,10 +105,20 @@ class pod(object):
|
||||
self.endip = None
|
||||
self.zoneid = None
|
||||
self.clusters = []
|
||||
self.vmwaredc = []
|
||||
'''Used in basic network mode'''
|
||||
self.guestIpRanges = []
|
||||
|
||||
|
||||
class VmwareDc(object):
|
||||
def __init__(self):
|
||||
self.zoneid = None
|
||||
self.name = None
|
||||
self.vcenter = None
|
||||
self.username = None
|
||||
self.password = None
|
||||
|
||||
|
||||
class cluster(object):
|
||||
def __init__(self):
|
||||
self.clustername = None
|
||||
|
||||
@ -54,10 +54,22 @@ specify a valid config file" % cfgFile)
|
||||
hostcmd.hypervisor = hypervisor
|
||||
self.apiClient.addHost(hostcmd)
|
||||
|
||||
def createClusters(self, clusters, zoneId, podId):
|
||||
def addVmWareDataCenter(self, vmwareDc):
|
||||
vdc = addVmwareDc.addVmwareDcCmd()
|
||||
vdc.zoneid = vmwareDc.zoneid
|
||||
vdc.name = vmwareDc.name
|
||||
vdc.vcenter = vmwareDc.vcenter
|
||||
vdc.username = vmwareDc.username
|
||||
vdc.password = vmwareDc.password
|
||||
self.apiClient.addVmwareDc(vdc)
|
||||
|
||||
def createClusters(self, clusters, zoneId, podId, vmwareDc=None):
|
||||
if clusters is None:
|
||||
return
|
||||
|
||||
if vmwareDc:
|
||||
self.addVmWareDataCenter(vmwareDc)
|
||||
|
||||
for cluster in clusters:
|
||||
clustercmd = addCluster.addClusterCmd()
|
||||
clustercmd.clustername = cluster.clustername
|
||||
@ -108,7 +120,7 @@ specify a valid config file" % cfgFile)
|
||||
self.createVlanIpRanges("Basic", pod.guestIpRanges, zoneId,
|
||||
podId, networkId)
|
||||
|
||||
self.createClusters(pod.clusters, zoneId, podId)
|
||||
self.createClusters(pod.clusters, zoneId, podId, vmwareDc=pod.vmwaredc)
|
||||
|
||||
def createVlanIpRanges(self, mode, ipranges, zoneId, podId=None,
|
||||
networkId=None, forvirtualnetwork=None):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user