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

Method createZones

tools/marvin/marvin/deployDataCenter.py:735–853  ·  view source on GitHub ↗
(self, zones)

Source from the content-addressed store, hash-verified

733 return FAILED
734
735 def createZones(self, zones):
736 try:
737 for zone in zones:
738 zonecmd = createZone.createZoneCmd()
739 zonecmd.dns1 = zone.dns1
740 zonecmd.dns2 = zone.dns2
741 zonecmd.internaldns1 = zone.internaldns1
742 zonecmd.internaldns2 = zone.internaldns2
743 zonecmd.name = zone.name
744 zonecmd.securitygroupenabled = zone.securitygroupenabled
745 zonecmd.localstorageenabled = zone.localstorageenabled
746 zonecmd.networktype = zone.networktype
747 zonecmd.domain = zone.domain
748 if zone.securitygroupenabled != "true":
749 zonecmd.guestcidraddress = zone.guestcidraddress
750 zoneId = self.createZone(zonecmd)
751 if zoneId == FAILED:
752 self.__tcRunLogger.\
753 exception(
754 "====Zone: %s Creation Failed. So Exiting=====" %
755 str(zone.name))
756 self.__cleanAndExit()
757 self.isTungstenZone = False
758 for pnet in zone.physical_networks:
759 phynetwrk = self.createPhysicalNetwork(pnet, zoneId)
760 self.configureProviders(phynetwrk, pnet.providers)
761 self.updatePhysicalNetwork(phynetwrk.id, "Enabled",
762 vlan=pnet.vlan)
763 if "TF" in pnet.isolationmethods:
764 self.isTungstenZone = True
765 self.configureTungstenService(zoneId, phynetwrk.id, zone.tungstenprovider)
766 if zone.securitygroupenabled:
767 self.enableTungstenProvider(zoneId, phynetwrk.id)
768
769 if zone.networktype == "Basic":
770 listnetworkoffering =\
771 listNetworkOfferings.listNetworkOfferingsCmd()
772 listnetworkoffering.name =\
773 "DefaultSharedNetscalerEIPandELBNetworkOffering" \
774 if len([x for x in zone.physical_networks[0].
775 traffictypes if x.typ == 'Public']) > 0 \
776 else "DefaultSharedNetworkOfferingWithSGService"
777 if zone.networkofferingname is not None:
778 listnetworkoffering.name = zone.networkofferingname
779 listnetworkofferingresponse = \
780 self.__apiClient.listNetworkOfferings(
781 listnetworkoffering)
782 guestntwrk = configGenerator.network()
783 guestntwrk.displaytext = "guestNetworkForBasicZone"
784 guestntwrk.name = "guestNetworkForBasicZone"
785 guestntwrk.zoneid = zoneId
786 guestntwrk.networkofferingid = \
787 listnetworkofferingresponse[0].id
788 networkid = self.createNetworks([guestntwrk], zoneId)
789 self.createPods(zone.pods, zoneId, networkid)
790 if self.isEipElbZone(zone):
791 self.createVlanIpRanges(
792 zone.networktype, zone.ipranges,

Callers 1

deployMethod · 0.95

Calls 15

createZoneMethod · 0.95
__cleanAndExitMethod · 0.95
createPhysicalNetworkMethod · 0.95
configureProvidersMethod · 0.95
updatePhysicalNetworkMethod · 0.95
createNetworksMethod · 0.95
createPodsMethod · 0.95
isEipElbZoneMethod · 0.95
createVlanIpRangesMethod · 0.95

Tested by

no test coverage detected