mirror of https://github.com/apache/cloudstack.git
Config generator script for Advanced Mode CloudStack
This commit is contained in:
parent
461727fea0
commit
ec0a6e0420
|
|
@ -7,11 +7,11 @@
|
|||
# * Only a sandbox
|
||||
############################################################
|
||||
'''
|
||||
|
||||
import random
|
||||
import marvin
|
||||
from ConfigParser import SafeConfigParser
|
||||
from optparse import OptionParser
|
||||
from configGenerator import *
|
||||
import random
|
||||
from marvin.configGenerator import *
|
||||
|
||||
|
||||
def getGlobalSettings(config):
|
||||
|
|
@ -28,7 +28,7 @@ def describeResources(config):
|
|||
z = zone()
|
||||
z.dns1 = config.get('environment', 'dns')
|
||||
z.internaldns1 = config.get('environment', 'dns')
|
||||
z.name = 'Sandbox-%s'%(config.get('environment', 'hypervisor'))
|
||||
z.name = 'Sandbox-%s'%(config.get('cloudstack', 'hypervisor'))
|
||||
z.networktype = 'Advanced'
|
||||
z.guestcidraddress = '10.1.1.0/24'
|
||||
|
||||
|
|
@ -37,37 +37,37 @@ def describeResources(config):
|
|||
p.gateway = config.get('cloudstack', 'private.gateway')
|
||||
p.startip = config.get('cloudstack', 'private.pod.startip')
|
||||
p.endip = config.get('cloudstack', 'private.pod.endip')
|
||||
p.netmask = '255.255.255.0'
|
||||
p.netmask = config.get('cloudstack', 'private.netmask')
|
||||
|
||||
v = iprange()
|
||||
v.gateway = config.get('cloudstack', 'public.gateway')
|
||||
v.startip = config.get('cloudstack', 'public.vlan.startip')
|
||||
v.endip = config.get('cloudstack', 'public.vlan.endip')
|
||||
v.netmask = '255.255.255.0'
|
||||
v.netmask = config.get('cloudstack', 'public.netmask')
|
||||
v.vlan = config.get('cloudstack', 'public.vlan')
|
||||
z.ipranges.append(v)
|
||||
|
||||
c = cluster()
|
||||
c.clustername = 'C0'
|
||||
c.hypervisor = config.get('environment', 'hypervisor')
|
||||
c.hypervisor = config.get('cloudstack', 'hypervisor')
|
||||
c.clustertype = 'CloudManaged'
|
||||
|
||||
h = host()
|
||||
h.username = 'root'
|
||||
h.password = 'password'
|
||||
h.password = config.get('cloudstack', 'host.password')
|
||||
h.url = 'http://%s'%(config.get('cloudstack', 'host'))
|
||||
c.hosts.append(h)
|
||||
|
||||
ps = primaryStorage()
|
||||
ps.name = 'PS0'
|
||||
ps.url = config.get('cloudstack', 'pool')
|
||||
ps.url = config.get('cloudstack', 'primary.pool')
|
||||
c.primaryStorages.append(ps)
|
||||
|
||||
p.clusters.append(c)
|
||||
z.pods.append(p)
|
||||
|
||||
secondary = secondaryStorage()
|
||||
secondary.url = config.get('cloudstack', 'secondary')
|
||||
secondary.url = config.get('cloudstack', 'secondary.pool')
|
||||
z.secondaryStorages.append(secondary)
|
||||
|
||||
'''Add zone'''
|
||||
|
|
@ -80,7 +80,9 @@ def describeResources(config):
|
|||
|
||||
'''Add a database'''
|
||||
db = dbServer()
|
||||
db.dbSvr = config.get('environment', 'database')
|
||||
db.dbSvr = config.get('environment', 'mysql.host')
|
||||
db.user = config.get('environment', 'mysql.cloud.user')
|
||||
db.passwd = config.get('environment', 'mysql.cloud.passwd')
|
||||
zs.dbSvr = db
|
||||
|
||||
'''Add some configuration'''
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
[globals]
|
||||
#global settings in cloudstack
|
||||
expunge.delay=60
|
||||
expunge.interval=60
|
||||
storage.cleanup.interval=300
|
||||
|
|
@ -17,20 +18,27 @@ secstorage.allowed.internal.sites=10.147.28.0/24
|
|||
[environment]
|
||||
dns=10.147.28.6
|
||||
mshost=10.147.29.111
|
||||
database=10.147.29.111
|
||||
mysql.host=10.147.29.111
|
||||
mysql.cloud.user=cloud
|
||||
mysql.cloud.passwd=cloud
|
||||
[cloudstack]
|
||||
#guest VLAN
|
||||
zone.vlan=675-679
|
||||
#pod configuration
|
||||
#management network
|
||||
private.gateway=10.147.29.1
|
||||
private.pod.startip=10.147.29.150
|
||||
private.pod.endip=10.147.29.159
|
||||
#public vlan range
|
||||
private.netmask=255.255.255.0
|
||||
#public network
|
||||
public.gateway=10.147.31.1
|
||||
public.vlan=31
|
||||
public.vlan.startip=10.147.31.150
|
||||
public.vlan.endip=10.147.31.159
|
||||
#hosts
|
||||
public.netmask=255.255.255.0
|
||||
#hypervisor host information
|
||||
hypervisor=XenServer
|
||||
host=10.147.29.58
|
||||
#pools
|
||||
pool=nfs://10.147.28.6:/export/home/sandbox/kamakura
|
||||
secondary=nfs://10.147.28.6:/export/home/sandbox/sstor
|
||||
host.password=password
|
||||
#storage pools
|
||||
primary.pool=nfs://10.147.28.6:/export/home/sandbox/kamakura
|
||||
secondary.pool=nfs://10.147.28.6:/export/home/sandbox/sstor
|
||||
|
|
|
|||
Loading…
Reference in New Issue