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

Function descSetupInBasicMode

tools/marvin/marvin/configGenerator.py:422–527  ·  view source on GitHub ↗

sample code to generate setup configuration file

()

Source from the content-addressed store, hash-verified

420
421
422def descSetupInBasicMode():
423 '''sample code to generate setup configuration file'''
424 zs = cloudstackConfiguration()
425
426 for l in range(1):
427 z = zone()
428 z.dns1 = "8.8.8.8"
429 z.dns2 = "8.8.4.4"
430 z.internaldns1 = "192.168.110.254"
431 z.internaldns2 = "192.168.110.253"
432 z.name = "test" + str(l)
433 z.networktype = 'Basic'
434 z.securitygroupenabled = 'True'
435
436 # If security groups are reqd
437 sgprovider = provider()
438 sgprovider.broadcastdomainrange = 'Pod'
439 sgprovider.name = 'SecurityGroupProvider'
440
441 pn = physicalNetwork()
442 pn.name = "test-network"
443 pn.traffictypes = [trafficType("Guest"), trafficType("Management")]
444 pn.providers.append(sgprovider)
445
446 z.physical_networks.append(pn)
447
448 '''create 10 pods'''
449 for i in range(2):
450 p = pod()
451 p.name = "test" + str(l) + str(i)
452 p.gateway = "192.168.%d.1" % i
453 p.netmask = "255.255.255.0"
454 p.startip = "192.168.%d.150" % i
455 p.endip = "192.168.%d.220" % i
456
457 '''add two pod guest ip ranges'''
458 for j in range(2):
459 ip = iprange()
460 ip.gateway = p.gateway
461 ip.netmask = p.netmask
462 ip.startip = "192.168.%d.%d" % (i, j * 20)
463 ip.endip = "192.168.%d.%d" % (i, j * 20 + 10)
464
465 p.guestIpRanges.append(ip)
466
467 '''add 10 clusters'''
468 for j in range(2):
469 c = cluster()
470 c.clustername = "test" + str(l) + str(i) + str(j)
471 c.clustertype = "CloudManaged"
472 c.hypervisor = "Simulator"
473
474 '''add 10 hosts'''
475 for k in range(2):
476 h = host()
477 h.username = "root"
478 h.password = "password"
479 memory = 8 * 1024 * 1024 * 1024

Callers 1

configGenerator.pyFile · 0.85

Calls 15

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

Tested by

no test coverage detected