diff --git a/tools/marvin/marvin/configGenerator.py b/tools/marvin/marvin/configGenerator.py index 812bfec4a9a..a966ae089e4 100644 --- a/tools/marvin/marvin/configGenerator.py +++ b/tools/marvin/marvin/configGenerator.py @@ -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 diff --git a/tools/marvin/marvin/deployDataCenter.py b/tools/marvin/marvin/deployDataCenter.py index 941b6e9316c..961718ad67a 100644 --- a/tools/marvin/marvin/deployDataCenter.py +++ b/tools/marvin/marvin/deployDataCenter.py @@ -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):