Multiple fixes to the testClient to accomodate further changes to 3.0 APIs

reviewed-by: Kishan
* Revert back to old guestCidrAddress
* Add default traffic types
* fixed typo when creating physical network, specifid wrong zone
* correctly specifying the guest VLAN as part of updating physical network
This commit is contained in:
Prasanna Santhanam 2012-02-18 23:38:27 +05:30
parent d4a180f097
commit 1b8a23f5be
3 changed files with 62 additions and 270 deletions

View File

@ -209,7 +209,13 @@ class deployDataCenters():
traffic_type = addTrafficType.addTrafficTypeCmd()
traffic_type.physicalnetworkid = physical_network_id
traffic_type.traffictype = traffictype
self.apiClient.addTrafficType(traffic_type)
return self.apiClient.addTrafficType(traffic_type)
def enableZone(self, zoneid, allocation_state="Enabled"):
zoneCmd = updateZone.updateZoneCmd()
zoneCmd.id = zoneid
zoneCmd.allocationstate = allocation_state
return self.apiClient.updateZone(zoneCmd)
def createZones(self, zones):
for zone in zones:
@ -221,22 +227,19 @@ class deployDataCenters():
createzone.name = zone.name
createzone.securitygroupenabled = zone.securitygroupenabled
createzone.networktype = zone.networktype
createzone.guestcidraddress = zone.guestcidraddress
zoneresponse = self.apiClient.createZone(createzone)
zoneId = zoneresponse.id
phynetwrk = self.createPhysicalNetwork(zone.name + "-pnet", \
zoneId, zone.vlan)
zoneId)
if zone.networktype == "Advanced":
self.addTrafficTypes(phynetwrk.id, ["Guest", "Public", \
"Management"])
elif zone.networktype == "Basic":
self.addTrafficTypes(phynetwrk.id, ["Guest", "Public", \
"Management", "Storage"])
self.configureProviders(phynetwrk, zone)
self.updatePhysicalNetwork(phynetwrk.id, "Enabled")
self.updatePhysicalNetwork(phynetwrk.id, "Enabled", vlan=zone.vlan)
if zone.networktype == "Basic":
listnetworkoffering = \

View File

@ -1,273 +1,65 @@
{
"zones": [
{
"name": "Sandbox-Simulator",
"name": "Sandbox-simulator",
"guestcidraddress": "10.1.1.0/24",
"dns2": "10.223.110.254",
"dns1": "4.2.2.2",
"vlan": "100-300",
"providers": [
{
"broadcastdomainrange": "ZONE",
"name": "VirtualRouter"
}
],
"dns1": "10.147.28.6",
"vlan": "100-500",
"ipranges": [
{
"startip": "172.1.2.2",
"endip": "172.1.2.200",
"startip": "172.2.1.2",
"endip": "172.2.1.252",
"netmask": "255.255.255.0",
"vlan": "30",
"gateway": "172.1.2.1"
"gateway": "172.2.1.1"
}
],
"networktype": "Advanced",
"pods": [
{
"endip": "172.1.1.200",
"endip": "172.1.2.252",
"name": "POD0",
"startip": "172.1.1.2",
"startip": "172.1.2.2",
"netmask": "255.255.255.0",
"clusters": [
{
"clustername": "POD1-CLUSTER1",
"hypervisor": "Simulator",
"clustername": "C0",
"hypervisor": "simulator",
"hosts": [
{
"username": "root",
"url": "http://sim/test-1",
"password": "password"
},
{
"username": "root",
"url": "http://sim/test-2",
"url": "http://sim",
"password": "password"
}
],
"clustertype": "CloudManaged",
"primaryStorages": [
{
"url": "nfs://172.16.24.32/export/path/1",
"name": "spool1"
}
]
},
{
"clustername": "POD1-CLUSTER2",
"hypervisor": "Simulator",
"hosts": [
{
"username": "root",
"url": "http://sim/test-3",
"password": "password"
},
{
"username": "root",
"url": "http://sim/test-4",
"password": "password"
}
],
"clustertype": "CloudManaged",
"primaryStorages": [
{
"url": "nfs://172.16.24.32/export/path/2",
"name": "spool2"
}
]
},
{
"clustername": "POD1-CLUSTER3",
"hypervisor": "Simulator",
"hosts": [
{
"username": "root",
"url": "http://sim/test-5",
"password": "password"
},
{
"username": "root",
"url": "http://sim/test-6",
"password": "password"
}
],
"clustertype": "CloudManaged",
"primaryStorages": [
{
"url": "nfs://172.16.24.32/export/path/3",
"name": "spool3"
}
]
},
{
"clustername": "POD1-CLUSTER4",
"hypervisor": "Simulator",
"hosts": [
{
"username": "root",
"url": "http://sim/test-7",
"password": "password"
},
{
"username": "root",
"url": "http://sim/test-8",
"password": "password"
}
],
"clustertype": "CloudManaged",
"primaryStorages": [
{
"url": "nfs://172.16.24.32/export/path/4",
"name": "spool4"
}
]
},
{
"clustername": "POD1-CLUSTER5",
"hypervisor": "Simulator",
"hosts": [
{
"username": "root",
"url": "http://sim/test-9",
"password": "password"
},
{
"username": "root",
"url": "http://sim/test-10",
"password": "password"
}
],
"clustertype": "CloudManaged",
"primaryStorages": [
{
"url": "nfs://172.16.24.32/export/path/5",
"name": "spool5"
}
]
},
{
"clustername": "POD1-CLUSTER6",
"hypervisor": "Simulator",
"hosts": [
{
"username": "root",
"url": "http://sim/test-11",
"password": "password"
},
{
"username": "root",
"url": "http://sim/test-12",
"password": "password"
}
],
"clustertype": "CloudManaged",
"primaryStorages": [
{
"url": "nfs://172.16.24.32/export/path/6",
"name": "spool6"
}
]
},
{
"clustername": "POD1-CLUSTER7",
"hypervisor": "Simulator",
"hosts": [
{
"username": "root",
"url": "http://sim/test-13",
"password": "password"
},
{
"username": "root",
"url": "http://sim/test-14",
"password": "password"
}
],
"clustertype": "CloudManaged",
"primaryStorages": [
{
"url": "nfs://172.16.24.32/export/path/7",
"name": "spool7"
}
]
},
{
"clustername": "POD1-CLUSTER8",
"hypervisor": "Simulator",
"hosts": [
{
"username": "root",
"url": "http://sim/test-15",
"password": "password"
},
{
"username": "root",
"url": "http://sim/test-16",
"password": "password"
}
],
"clustertype": "CloudManaged",
"primaryStorages": [
{
"url": "nfs://172.16.24.32/export/path/8",
"name": "spool8"
}
]
},
{
"clustername": "POD1-CLUSTER9",
"hypervisor": "Simulator",
"hosts": [
{
"username": "root",
"url": "http://sim/test-17",
"password": "password"
},
{
"username": "root",
"url": "http://sim/test-18",
"password": "password"
}
],
"clustertype": "CloudManaged",
"primaryStorages": [
{
"url": "nfs://172.16.24.32/export/path/9",
"name": "spool9"
}
]
},
{
"clustername": "POD1-CLUSTER10",
"hypervisor": "Simulator",
"hosts": [
{
"username": "root",
"url": "http://sim/test-19",
"password": "password"
},
{
"username": "root",
"url": "http://sim/test-20",
"password": "password"
}
],
"clustertype": "CloudManaged",
"primaryStorages": [
{
"url": "nfs://172.16.24.32/export/path/10",
"name": "spool10"
"url": "nfs://172.2.2.6:/export/home/primary",
"name": "PS0"
}
]
}
],
"gateway": "172.1.1.1"
"gateway": "172.1.2.1"
}
],
"internaldns1": "10.147.28.6",
"internaldns2": "10.223.110.254",
"secondaryStorages": [
{
"url": "nfs://172.16.25.32/secondary/path"
"url": "nfs://172.2.2.6:/export/home/secondary"
}
]
}
],
"dbSvr": {
"dbSvr": "10.147.28.40",
"dbSvr": "localhost",
"passwd": "cloud",
"db": "cloud",
"port": 3306,
@ -285,61 +77,61 @@
],
"globalConfig": [
{
"name": "use.user.concentrated.pod.allocation",
"value": "false"
"name": "storage.cleanup.interval",
"value": "300"
},
{
"name": "vm.op.wait.interval",
"value": "5"
},
{
"name": "default.page.size",
"value": "10000"
},
{
"name": "instance.name",
"value": "QA"
},
{
"name": "workers",
"value": "10"
},
{
"name": "direct.agent.load.size",
"value": "1000"
},
{
"name": "account.cleanup.interval",
"value": "600"
},
{
"name": "guest.domain.suffix",
"value": "sandbox.simulator"
},
{
"name": "expunge.delay",
"value": "60"
},
{
"name": "vm.allocation.algorithm",
"value": "random"
},
{
"name": "check.pod.cidrs",
"value": "false"
},
{
"name": "instance.name",
"value": "SIMQA"
},
{
"name": "workers",
"value": "10"
},
{
"name": "vm.op.wait.interval",
"value": "5"
},
{
"name": "guest.domain.suffix",
"value": "sandbox.simulator"
"value": "userdispersing"
},
{
"name": "expunge.interval",
"value": "60"
},
{
"name": "linkLocalIp.nums",
"value": "10"
},
{
"name": "expunge.workers",
"value": "3"
},
{
"name": "check.pod.cidrs",
"value": "true"
}
],
"mgtSvr": [
{
"mgtSvrIp": "10.147.28.40",
"mgtSvrIp": "localhost",
"port": 8096
}
]

View File

@ -31,10 +31,7 @@ def describeResources(config):
z.name = 'Sandbox-%s'%(config.get('environment', 'hypervisor'))
z.networktype = 'Advanced'
z.guestcidraddress = '10.1.1.0/24'
prov = provider()
prov.vlan = config.get('cloudstack','guest.vlan')
z.providers.append(prov)
z.vlan = config.get('cloudstack','guest.vlan')
p = pod()
p.name = 'POD0'