# Copyright (c) 2014 Barnstormer Softworks, Ltd. # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import geni.rspec.pg as PG import geni.aggregate.instageni as IG import nbastin context = nbastin.buildContext() SLICENAME = "test-1" r = PG.Request() vm = PG.XenVM("xen1") r.addResource(vm) m = IG.UtahDDC.createsliver(context, SLICENAME, r) for node in m.nodes: for login in node.logins: print "[%s] %s:%d" % (login.username, login.hostname, login.port)
# Copyright (c) 2016 Barnstormer Softworks, Ltd. # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import geni.rspec.pg as PG DISK_IMAGE = "urn:publicid:IDN+instageni.gpolab.bbn.com+image+emulab-ops:UBUNTU12-64-STD" ndata = [("bbn-ig-ps103-a", "10.42.103.111"), ("bbn-ig-ps103-b", "10.42.103.112")] r = PG.Request() for (name, ip) in ndata: vm = PG.XenVM(name) vm.disk_image = DISK_IMAGE vm.addService(PG.Install(url="http://www.gpolab.bbn.com/~jbs/dingbot-jbs.tar.gz", path="/opt")) vm.addService(PG.Install(url="http://www.gpolab.bbn.com/~jbs/dingbot.tar.gz", path="/opt")) vm.addService(PG.Execute(shell="/bin/bash", command="sudo /opt/dingbot/dingbot /opt/dingbot/dingbot-jbs.json %s" % (vm.name))) intf = vm.addInterface("if0") intf.addAddress(PG.IPv4Address(ip, "255.255.255.0")) lnk = PG.Link() lnk.addInterface(intf) lnk.connectSharedVlan("mesoscale-openflow") r.addResource(vm) r.addResource(lnk) r.write("ps103.xml")
if site in BLACKLIST: continue try: ad = site.listresources(context) except Exception: # Continue past aggregates that are down continue r = PG.Request() intfs = [] # Xen VMs for (idx, node) in enumerate([node for node in ad.nodes if not node.exclusive and "emulab-xen" in node.sliver_types]): vm = PG.XenVM("host%d" % (idx+1)) intf = vm.addInterface("if0") intf.addAddress(PG.IPv4Address(IPS[idx], NETMASK)) r.addResource(vm) intfs.append(intf) vm.component_id = node.component_id vm.component_manager_id = node.component_manager_id # VZNode # Sorry about the stupidity about how to find OpenVZ hosts. I should fix this. vznode = [node for node in ad.nodes if not node.exclusive and "emulab-xen" not in node.sliver_types and node.hardware_types.has_key("pcvm")][0] vzc = PG.VZContainer("host3") intf = vzc.addInterface("if0") intf.addAddress(PG.IPv4Address(IPS[2], NETMASK)) r.addResource(vzc) intfs.append(intf)
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import geni.rspec.pg as PG import geni.aggregate.instageni as IG import nbastin context = nbastin.buildContext() #IG.Utah.deletesliver(context, "xen-test2") r = PG.Request() for x in [1, 2, 3]: vm = PG.XenVM("xen%d" % (x)) intf = vm.addInterface("if0") intf.component_id = "eth%d" % (x) r.addResource(vm) lnk = PG.Link() lnk.addInterface(intf) lnk.connectSharedVlan("mesoscale-openflow") r.addResource(lnk) manifest = IG.Utah.createsliver(context, "xen-test2", r) for node in manifest.nodes: for login in node.logins: print "[%s] %s:%d" % (node.name, login.hostname, login.port)
ad = IG.NYSERNet.listresources(context) pairs = itertools.izip(xrange( 1, 4), [x.name for x in ad.shared_vlans if x.name.startswith("vts")]) r = PG.Request() pc = PG.RawPC("bss-rtr") pc.routeable_control_ip = True for (i, vlan) in pairs: intf = pc.addInterface("if%d" % (i)) intf.component_id = "eth%d" % (i) lnk = PG.Link() lnk.addInterface(intf) lnk.connectSharedVlan(vlan) r.addResource(lnk) vm = PG.XenVM("xen-%d" % (i)) intf = vm.addInterface("if0") lnk = PG.Link() lnk.addInterface(intf) lnk.connectSharedVlan(vlan) r.addResource(vm) r.addResource(lnk) r.addResource(pc) manifest = IG.NYSERNet.createsliver(context, "xen-test2", r)
dp.attachPort(VTS.PGCircuit()) dp.attachPort( VTS.GRECircuit("geni-core", uiucvtsm.findPort(uiuc_wan_port.clientid).local_endpoint)) gpovtsr.addResource(dp) gpovtsr.write("gpo-vts-request.xml") # Make the VTS reservation at GPO print "-- Making GPO VTS reservation" gpovtsm = VTSAM.GPO.createsliver(context, SLICE, gpovtsr) gpovtsm.write("gpo-vts-manifest.xml") # Build the IG Request for Illinois using the circuit information from the VTS manifest uiucpgr = PG.Request() for idx, circuit in enumerate(uiucvtsm.pg_circuits): vm = PG.XenVM("vm%d" % (idx)) intf = vm.addInterface("if0") intf.addAddress(PG.IPv4Address("172.16.5.1", "255.255.255.0")) uiucpgr.addResource(vm) lnk = PG.Link() lnk.addInterface(intf) lnk.connectSharedVlan(circuit) uiucpgr.addResource(lnk) uiucpgr.write("uiuc-ig-request.xml") # Build the IG request for GPO using the VTS circuit info gpopgr = PG.Request() for idx, circuit in enumerate(gpovtsm.pg_circuits): vm = PG.XenVM("vm%d" % (idx)) intf = vm.addInterface("if0")
import nbastin DISK_IMAGE = "urn:publicid:IDN+instageni.gpolab.bbn.com+image+emulab-ops:UBUNTU12-64-STD" context = nbastin.buildContext() xenshared = [] ad = IG.UtahDDC.listresources(context) for node in ad.nodes: if node.available and node.shared: if "emulab-xen" in node.sliver_types: xenshared.append(node) r = PG.Request() n1 = PG.XenVM("xen1", component_id=xenshared[0].component_id) n1.disk_image = DISK_IMAGE n2 = PG.XenVM("xen2", component_id=xenshared[1].component_id) n2.disk_image = DISK_IMAGE r.addResource(n1) r.addResource(n2) for lan in xrange(0, 45): i1 = n1.addInterface("if%d" % (lan)) i2 = n2.addInterface("if%d" % (lan)) i1.bandwidth = 10000 i2.bandwidth = 10000 lnk = PG.LAN("lan-%d" % (lan)) lnk.addInterface(i1)
#!/usr/bin/env python import geni.rspec.pg as rspec import geni.rspec.igext as ig import geni.portal as portal pc = portal.Context() rspec = pc.makeRequestRSpec() tour = ig.Tour() tour.Description(ig.Tour.TEXT, "Test description") tour.Instructions(ig.Tour.TEXT, "Text instructions") node1 = rspec.XenVM("src") node2 = rspec.XenVM("dst") link1 = rspec.Link("thelink", members=[node1, node2]) tour.addStep(ig.Tour.Step(node1, "This is the first node")) tour.steps.append(ig.Tour.Step(node2, "This is the second node")) tour.steps.append(ig.Tour.Step(link1, "This is the link")) rspec.addTour(tour) pc.printRequestRSpec()
print site.name if site in BLACKLIST: continue try: ad = site.listresources(context) except Exception: # Continue past aggregates that are down continue cmid = ad.nodes[0].component_manager_id r = PG.Request() ovs_intfs = [] ovs = PG.XenVM("OVS") ovs.disk_image = "urn:publicid:IDN+utahddc.geniracks.net+image+emulab-ops:Ubuntu12-64-OVS" ovs.addService(PG.Execute(shell="sh", command = "sudo /local/install-script.sh")) ovs.addService(PG.Install(path="/local", url = "http://www.gpolab.bbn.com/experiment-support/OpenFlowOVS/of-ovs.tar.gz")) ovs.component_manager_id = cmid for idx in xrange(0,3): intf = ovs.addInterface("if%d" % (idx)) intf.addAddress(PG.IPv4Address(OVS_IPS[idx], NETMASK)) ovs_intfs.append(intf) r.addResource(ovs) for ct in xrange(0,3): vzc = PG.VZContainer("host%d" % (ct+1)) vzc.component_manager_id = cmid intf = vzc.addInterface("if0") intf.addAddress(PG.IPv4Address(HOST_IPS[ct], NETMASK))