From 8d3cbc82d80eb0c4ead6f68377157fd477fe2d76 Mon Sep 17 00:00:00 2001 From: Prasanna Santhanam Date: Sat, 12 Jan 2013 14:38:14 +0530 Subject: [PATCH] marvin: fixes for handling multiple phy. networks zones do not qualify for vlans but phy networks should carry the underlying vlan information. moving the vlan down to physical_network in configGenerator.py. also the sandbox example has been corrected to reflect this change and includes an illustration of using traffic types with labels. Signed-off-by: Prasanna Santhanam Reported-By: Marcus Sorenson --- tools/marvin/marvin/configGenerator.py | 3 +-- tools/marvin/marvin/deployDataCenter.py | 2 +- .../marvin/sandbox/advanced/advanced_env.py | 18 +++++++++++++++--- .../marvin/sandbox/advanced/setup.properties | 16 ++++++++-------- 4 files changed, 25 insertions(+), 14 deletions(-) diff --git a/tools/marvin/marvin/configGenerator.py b/tools/marvin/marvin/configGenerator.py index d494beb6444..e2a6a24d69f 100644 --- a/tools/marvin/marvin/configGenerator.py +++ b/tools/marvin/marvin/configGenerator.py @@ -65,8 +65,6 @@ class zone(): self.internaldns2 = None self.securitygroupenabled = None self.localstorageenabled = None - ''' Guest Vlan range - only advanced zone''' - self.vlan = None '''default public network, in advanced mode''' self.ipranges = [] self.physical_networks = [] @@ -80,6 +78,7 @@ class traffictype(): self.xen = labeldict['xen'] if 'xen' in labeldict.keys() else None self.kvm = labeldict['kvm'] if 'kvm' in labeldict.keys() else None self.vmware = labeldict['vmware'] if 'vmware' in labeldict.keys() else None + self.simulator = labeldict['simulator'] if 'simulator' in labeldict.keys() else None #{ # 'xen' : 'cloud-xen', # 'kvm' : 'cloud-kvm', diff --git a/tools/marvin/marvin/deployDataCenter.py b/tools/marvin/marvin/deployDataCenter.py index 0d5f3bdc659..7f8c0295ad8 100644 --- a/tools/marvin/marvin/deployDataCenter.py +++ b/tools/marvin/marvin/deployDataCenter.py @@ -289,7 +289,7 @@ class deployDataCenters(): for pnet in zone.physical_networks: phynetwrk = self.createPhysicalNetwork(pnet, zoneId) self.configureProviders(phynetwrk, pnet.providers) - self.updatePhysicalNetwork(phynetwrk.id, "Enabled", vlan=zone.vlan) + self.updatePhysicalNetwork(phynetwrk.id, "Enabled", vlan=pnet.vlan) if zone.networktype == "Basic": listnetworkoffering = listNetworkOfferings.listNetworkOfferingsCmd() diff --git a/tools/marvin/marvin/sandbox/advanced/advanced_env.py b/tools/marvin/marvin/sandbox/advanced/advanced_env.py index 1873f31d50f..db78a84b33b 100644 --- a/tools/marvin/marvin/sandbox/advanced/advanced_env.py +++ b/tools/marvin/marvin/sandbox/advanced/advanced_env.py @@ -52,10 +52,22 @@ def describeResources(config): pn = physical_network() pn.name = "Sandbox-pnet" - pn.traffictypes = [traffictype("Guest"), traffictype("Management"), traffictype("Public")] + pn.vlan = config.get('cloudstack', 'pnet.vlan') + pn.tags = ["cloud-simulator-public"] + pn.traffictypes = [traffictype("Guest"), + traffictype("Management", {"simulator" : "cloud-simulator-mgmt"}), + traffictype("Public", {"simulator":"cloud-simulator-public"})] pn.providers.append(vpcprovider) + + pn2 = physical_network() + pn2.name = "Sandbox-pnet2" + pn2.vlan = config.get('cloudstack', 'pnet2.vlan') + pn2.tags = ["cloud-simulator-guest"] + pn2.traffictypes = [traffictype('Guest', {'simulator': 'cloud-simulator-guest'})] + pn2.providers.append(vpcprovider) z.physical_networks.append(pn) + z.physical_networks.append(pn2) p = pod() p.name = 'POD0' @@ -118,11 +130,11 @@ def describeResources(config): ''''add loggers''' testClientLogger = logger() testClientLogger.name = 'TestClient' - testClientLogger.file = '/var/log/testclient.log' + testClientLogger.file = 'testclient.log' testCaseLogger = logger() testCaseLogger.name = 'TestCase' - testCaseLogger.file = '/var/log/testcase.log' + testCaseLogger.file = 'testcase.log' zs.logger.append(testClientLogger) zs.logger.append(testCaseLogger) diff --git a/tools/marvin/marvin/sandbox/advanced/setup.properties b/tools/marvin/marvin/sandbox/advanced/setup.properties index ba44d5146b6..73eacc938d4 100644 --- a/tools/marvin/marvin/sandbox/advanced/setup.properties +++ b/tools/marvin/marvin/sandbox/advanced/setup.properties @@ -24,10 +24,9 @@ storage.cleanup.interval=300 account.cleanup.interval=600 expunge.workers=3 workers=10 -use.user.concentrated.pod.allocation=false vm.allocation.algorithm=random vm.op.wait.interval=5 -guest.domain.suffix=sandbox.kvm +guest.domain.suffix=sandbox.simulator instance.name=QA direct.agent.load.size=1000 default.page.size=10000 @@ -35,15 +34,16 @@ check.pod.cidrs=true secstorage.allowed.internal.sites=10.147.28.0/24 [environment] dns=10.147.28.6 -mshost=10.147.29.111 +mshost=localhost mshost.user=root mshost.passwd=password -mysql.host=10.147.29.111 +mysql.host=localhost mysql.cloud.user=cloud mysql.cloud.passwd=cloud [cloudstack] #guest VLAN -zone.vlan=675-679 +pnet.vlan=675-679 +pnet2.vlan=800-1000 #management network private.gateway=10.147.29.1 private.pod.startip=10.147.29.150 @@ -56,9 +56,9 @@ public.vlan.startip=10.147.31.150 public.vlan.endip=10.147.31.159 public.netmask=255.255.255.0 #hypervisor host information -hypervisor=XenServer -host=10.147.29.58 +hypervisor=Simulator +host=simulator0 host.password=password #storage pools -primary.pool=nfs://10.147.28.6:/export/home/sandbox/kamakura +primary.pool=nfs://10.147.28.6:/export/home/sandbox/primary secondary.pool=nfs://10.147.28.6:/export/home/sandbox/sstor