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

Function descSetupInAdvancedMode

tools/marvin/marvin/configGenerator.py:654–766  ·  view source on GitHub ↗

sample code to generate setup configuration file

()

Source from the content-addressed store, hash-verified

652
653
654def descSetupInAdvancedMode():
655 '''sample code to generate setup configuration file'''
656 zs = cloudstackConfiguration()
657
658 for l in range(1):
659 z = zone()
660 z.dns1 = "8.8.8.8"
661 z.dns2 = "8.8.4.4"
662 z.internaldns1 = "192.168.110.254"
663 z.internaldns2 = "192.168.110.253"
664 z.name = "test" + str(l)
665 z.networktype = 'Advanced'
666 z.guestcidraddress = "10.1.1.0/24"
667 z.vlan = "100-2000"
668
669 pn = physicalNetwork()
670 pn.name = "test-network"
671 pn.traffictypes = [trafficType("Guest"), trafficType("Management"),
672 trafficType("Public")]
673
674 vpcprovider = provider('VpcVirtualRouter')
675
676 nsprovider = provider('Netscaler')
677 nsprovider.devices.append(netscaler(hostname='10.147.40.100'))
678
679 pn.providers.extend([vpcprovider, nsprovider])
680 z.physical_networks.append(pn)
681
682 '''create 10 pods'''
683 for i in range(2):
684 p = pod()
685 p.name = "test" + str(l) + str(i)
686 p.gateway = "192.168.%d.1" % i
687 p.netmask = "255.255.255.0"
688 p.startip = "192.168.%d.200" % i
689 p.endip = "192.168.%d.220" % i
690
691 '''add 10 clusters'''
692 for j in range(2):
693 c = cluster()
694 c.clustername = "test" + str(l) + str(i) + str(j)
695 c.clustertype = "CloudManaged"
696 c.hypervisor = "Simulator"
697
698 '''add 10 hosts'''
699 for k in range(2):
700 h = host()
701 h.username = "root"
702 h.password = "password"
703 memory = 8 * 1024 * 1024 * 1024
704 localstorage = 1 * 1024 * 1024 * 1024 * 1024
705 # h.url = "http://sim/%d%d%d%d/cpucore=1&cpuspeed=8000&\
706 # memory=%d&localstorage=%d"%(l, i, j, k, memory,
707 # localstorage)
708 h.url = "http://sim/%d%d%d%d" % (l, i, j, k)
709 c.hosts.append(h)
710
711 '''add 2 primary storages'''

Callers 1

configGenerator.pyFile · 0.85

Calls 15

zoneClass · 0.85
physicalNetworkClass · 0.85
trafficTypeClass · 0.85
netscalerClass · 0.85
podClass · 0.85
clusterClass · 0.85
hostClass · 0.85
primaryStorageClass · 0.85
secondaryStorageClass · 0.85
iprangeClass · 0.85
managementServerClass · 0.85

Tested by

no test coverage detected