Beispiel #1
0
def update_rack(building, rackid, newnetid, aqservice, aqhost, aqport):
    aq = AQRunner(aqservice=aqservice, aqhost=aqhost, aqport=aqport)
    rack = TestRack(building, rackid)
    rc = aq.wait(["ping"])
    for half in [0, 1]:
        newnetwork = TestNetwork(newnetid, half)
        tor_switch = rack.get_tor_switch(half)
        print "Updating tor_switch %s" % tor_switch
        rc = aq.wait([
            "update", "interface", "--machine", tor_switch, "--interface",
            "xge49", "--mac",
            newnetwork.get_mac(0), "--ip",
            newnetwork.get_ip(0)
        ])
        for offset in range(1, 49):
            machine = rack.get_machine(half, offset)
            print "Updating machine %s" % machine
            rc = aq.wait([
                "update", "interface", "--machine", machine, "--interface",
                "eth0", "--mac",
                newnetwork.get_mac(offset), "--ip",
                newnetwork.get_ip(offset)
            ])
            host = rack.get_host(half, offset)
            print "reconfiguring host %s" % host
            rc = aq.wait(["reconfigure", "--hostname", host])
Beispiel #2
0
def transition_rack(building, rackid, status, aqservice, aqhost, aqport):
    aq = AQRunner(aqservice=aqservice, aqhost=aqhost, aqport=aqport)
    rack = TestRack(building, rackid)
    rc = aq.wait(["ping"])
    for half in [0, 1]:
        for offset in range(1, 49):
            host = rack.get_host(half, offset)
            print "Transitioning host %s to status %s" % (host, status)
            rc = aq.wait(
                ["reconfigure", "--hostname", host, "--buildstatus", status])
Beispiel #3
0
def transition_rack(building, rackid, status, aqservice, aqhost, aqport):
    aq = AQRunner(aqservice=aqservice, aqhost=aqhost, aqport=aqport)
    rack = TestRack(building, rackid)
    rc = aq.wait(["ping"])
    for half in [0, 1]:
        for offset in range(1, 49):
            host = rack.get_host(half, offset)
            print "Transitioning host %s to status %s" % (host, status)
            rc = aq.wait(["reconfigure", "--hostname", host,
                          "--buildstatus", status])
Beispiel #4
0
def setup():
    broker = AQBroker()
    broker.stop()
    broker.initialize()
    rc = broker.start()
    if rc:
        print >>sys.stderr, "Broker start had return code %d" % rc
    aq = AQRunner(aqservice=broker.get_aqservice())
    rc = aq.wait(["add", "domain", "--domain", "testdom_odd"])
    rc = aq.wait(["add", "domain", "--domain", "testdom_even"])
    rc = aq.wait(["add", "aurora", "host", "--hostname", "nyaqd1"])
    services = [["afs", "q.ny.ms.com"],
                ["ntp", "pa.ny.na"],
                ["bootserver", "np.test"],
                ["dns", "nyinfratest"],
                ["syslogng", "nyb6.np.1"],
                ["lemon", "lemon.ny"],
                ["aqd", "ny-prod"],
                ["perfdata", "ny.a"]]
    for (service, instance) in services:
        rc = aq.wait(["add", "service", "--service", service])
        rc = aq.wait(["add", "required", "service", "--service", service,
            "--archetype", "aquilon"])
        rc = aq.wait(["add", "service", "--service", service,
            "--instance", instance])
        rc = aq.wait(["map", "service", "--service", service,
            "--instance", instance, "--building", "np"])
        rc = aq.wait(["bind", "server", "--service", service,
            "--instance", instance, "--hostname", "nyaqd1.ms.com"])
Beispiel #5
0
def setup():
    broker = AQBroker()
    broker.stop()
    broker.initialize()
    rc = broker.start()
    if rc:
        print >> sys.stderr, "Broker start had return code %d" % rc
    aq = AQRunner(aqservice=broker.get_aqservice())
    rc = aq.wait(["add", "domain", "--domain", "testdom_odd"])
    rc = aq.wait(["add", "domain", "--domain", "testdom_even"])
    rc = aq.wait(["add", "aurora", "host", "--hostname", "nyaqd1"])
    services = [["afs", "q.ny.ms.com"], ["ntp", "pa.ny.na"],
                ["bootserver", "np.test"], ["dns", "nyinfratest"],
                ["syslogng", "nyb6.np.1"], ["lemon", "lemon.ny"],
                ["aqd", "ny-prod"], ["perfdata", "ny.a"]]
    for (service, instance) in services:
        rc = aq.wait(["add", "service", "--service", service])
        rc = aq.wait([
            "add", "required", "service", "--service", service, "--archetype",
            "aquilon"
        ])
        rc = aq.wait(
            ["add", "service", "--service", service, "--instance", instance])
        rc = aq.wait([
            "map", "service", "--service", service, "--instance", instance,
            "--building", "np"
        ])
        rc = aq.wait([
            "bind", "server", "--service", service, "--instance", instance,
            "--hostname", "nyaqd1.ms.com"
        ])
Beispiel #6
0
def del_rack(building, rackid, aqservice, aqhost, aqport):
    aq = AQRunner(aqservice=aqservice, aqhost=aqhost, aqport=aqport)
    rack = TestRack(building, rackid)
    rc = aq.wait(["ping"])
    for half in [0, 1]:
        for offset in range(1, 49):
            host = rack.get_host(half, offset)
            print "Checking that host exists before deleting."
            rc = aq.wait(["show", "host", "--hostname", host])
            if rc == 0:
                print "Deleting host %s" % host
                rc = aq.wait(["del", "host", "--hostname", host])
            machine = rack.get_machine(half, offset)
            print "Deleting machine %s" % machine
            rc = aq.wait(["del", "machine", "--machine", machine])
        tor_switch = rack.get_tor_switch(half)
        "Deleting tor_switch %s" % tor_switch
        rc = aq.wait(["del", "tor_switch", "--tor_switch", tor_switch])
Beispiel #7
0
def del_rack(building, rackid, aqservice, aqhost, aqport):
    aq = AQRunner(aqservice=aqservice, aqhost=aqhost, aqport=aqport)
    rack = TestRack(building, rackid)
    rc = aq.wait(["ping"])
    for half in [0, 1]:
        for offset in range(1, 49):
            host = rack.get_host(half, offset)
            print "Checking that host exists before deleting."
            rc = aq.wait(["show", "host", "--hostname", host])
            if rc == 0:
                print "Deleting host %s" % host
                rc = aq.wait(["del", "host", "--hostname", host])
            machine = rack.get_machine(half, offset)
            print "Deleting machine %s" % machine
            rc = aq.wait(["del", "machine", "--machine", machine])
        tor_switch = rack.get_tor_switch(half)
        "Deleting tor_switch %s" % tor_switch
        rc = aq.wait(["del", "tor_switch", "--tor_switch", tor_switch])
Beispiel #8
0
def update_rack(building, rackid, newnetid, aqservice, aqhost, aqport):
    aq = AQRunner(aqservice=aqservice, aqhost=aqhost, aqport=aqport)
    rack = TestRack(building, rackid)
    rc = aq.wait(["ping"])
    for half in [0, 1]:
        newnetwork = TestNetwork(newnetid, half)
        tor_switch = rack.get_tor_switch(half)
        print "Updating tor_switch %s" % tor_switch
        rc = aq.wait(
            [
                "update",
                "interface",
                "--machine",
                tor_switch,
                "--interface",
                "xge49",
                "--mac",
                newnetwork.get_mac(0),
                "--ip",
                newnetwork.get_ip(0),
            ]
        )
        for offset in range(1, 49):
            machine = rack.get_machine(half, offset)
            print "Updating machine %s" % machine
            rc = aq.wait(
                [
                    "update",
                    "interface",
                    "--machine",
                    machine,
                    "--interface",
                    "eth0",
                    "--mac",
                    newnetwork.get_mac(offset),
                    "--ip",
                    newnetwork.get_ip(offset),
                ]
            )
            host = rack.get_host(half, offset)
            print "reconfiguring host %s" % host
            rc = aq.wait(["reconfigure", "--hostname", host])
Beispiel #9
0
def add_rack(building, rackid, netid, aqservice, aqhost, aqport):
    aq = AQRunner(aqservice=aqservice, aqhost=aqhost, aqport=aqport)
    rack = TestRack(building, rackid)
    rc = aq.wait(["ping"])
    for half in [0, 1]:
        network = TestNetwork(netid, half)
        tor_switch = rack.get_tor_switch(half)
        "Adding a tor_switch"
        rc = aq.wait(["add", "tor_switch", "--tor_switch", tor_switch,
            "--building", building, "--rackid", rack.rackid,
            "--model", "rs g8000", "--interface", "xge49",
            "--rackrow", rack.row, "--rackcolumn", rack.column,
            "--mac", network.get_mac(0), "--ip", network.get_ip(0)])
        domain = "testdom_odd" if rackid % 2 else "testdom_even"
        for offset in range(1, 49):
            machine = rack.get_machine(half, offset)
            print "Adding machine %s" % machine
            rc = aq.wait(["add", "machine", "--machine", machine,
                "--model", "vb1205xm", "--rack", rack.get_rack()])
            print "Adding an interface with %s" % network.get_mac(offset)
            rc = aq.wait(["add", "interface", "--machine", machine,
                          "--interface", "eth0",
                          "--mac", network.get_mac(offset)])
            host = rack.get_host(half, offset)
            print "Adding host %s with %s" % (host, network.get_ip(offset))
            rc = aq.wait(["add", "host", "--machine", machine,
                          "--hostname", host, "--archetype", "aquilon",
                          "--domain", domain, "--buildstatus", "blind",
                          "--ip", network.get_ip(offset)])
            print "make aquilon for host %s" % host
            rc = aq.wait(["make", "aquilon", "--hostname", host,
                          "--os", "linux/5.0.1-x86_64",
                          "--personality", "compileserver"])
Beispiel #10
0
def add_rack(building, rackid, netid, aqservice, aqhost, aqport):
    aq = AQRunner(aqservice=aqservice, aqhost=aqhost, aqport=aqport)
    rack = TestRack(building, rackid)
    rc = aq.wait(["ping"])
    for half in [0, 1]:
        network = TestNetwork(netid, half)
        tor_switch = rack.get_tor_switch(half)
        "Adding a tor_switch"
        rc = aq.wait(["add", "tor_switch", "--tor_switch", tor_switch,
            "--building", building, "--rackid", rack.rackid,
            "--model", "rs g8000", "--interface", "xge49",
            "--rackrow", rack.row, "--rackcolumn", rack.column,
            "--mac", network.get_mac(0), "--ip", network.get_ip(0)])
        domain = "testdom_odd" if rackid % 2 else "testdom_even"
        for offset in range(1, 49):
            machine = rack.get_machine(half, offset)
            print "Adding machine %s" % machine
            rc = aq.wait(["add", "machine", "--machine", machine,
                "--model", "vb1205xm", "--rack", rack.get_rack()])
            print "Adding an interface with %s" % network.get_mac(offset)
            rc = aq.wait(["add", "interface", "--machine", machine,
                          "--interface", "eth0",
                          "--mac", network.get_mac(offset)])
            host = rack.get_host(half, offset)
            print "Adding host %s with %s" % (host, network.get_ip(offset))
            rc = aq.wait(["add", "host", "--machine", machine,
                          "--hostname", host, "--archetype", "aquilon",
                          "--domain", domain, "--buildstatus", "blind",
                          "--ip", network.get_ip(offset)])
            print "make aquilon for host %s" % host
            rc = aq.wait(["make", "aquilon", "--hostname", host,
                          "--os", "linux/5.0.1-x86_64",
                          "--personality", "compileserver"])
Beispiel #11
0
def compile(domain, aqservice, aqhost, aqport):
    aq = AQRunner(aqservice=aqservice, aqhost=aqhost, aqport=aqport)
    print "Compiling domain %s" % domain
    rc = aq.wait(["compile", "--domain=%s" % domain])
Beispiel #12
0
def show_info(aqservice, aqhost, aqport):
    aq = AQRunner(aqservice=aqservice, aqhost=aqhost, aqport=aqport)
    rc = aq.wait(["ping"])
    rc = aq.wait(["show", "host", "--all"])
    rc = aq.wait(["show", "domain", "--all"])
    rc = aq.wait(["show", "hostiplist"])
    rc = aq.wait(["show", "hostmachinelist"])
    rc = aq.wait(["show", "cpu", "--all"])
    rc = aq.wait(["show", "model", "--type", "blade"])
    rc = aq.wait(["show", "service", "--all"])
    rc = aq.wait(["show", "archetype", "--all"])
    rc = aq.wait(["show", "map", "--building", "np"])
    rc = aq.wait(["show", "chassis", "--all"])
    rc = aq.wait(["show", "rack", "--all"])
    rc = aq.wait(["show", "building", "--all"])
    rc = aq.wait(["show", "city", "--all"])
    rc = aq.wait(["show", "country", "--all"])
    rc = aq.wait(["show", "continent", "--all"])
    rc = aq.wait(["show", "hub", "--all"])
    rc = aq.wait(["show", "machine", "--all"])
    rc = aq.wait(["show", "tor_switch", "--model", "rs g8000"])
    rc = aq.wait(["show", "principal", "--all"])
Beispiel #13
0
def show_info(aqservice, aqhost, aqport):
    aq = AQRunner(aqservice=aqservice, aqhost=aqhost, aqport=aqport)
    rc = aq.wait(["ping"])
    rc = aq.wait(["show", "host", "--all"])
    rc = aq.wait(["show", "domain", "--all"])
    rc = aq.wait(["show", "hostiplist"])
    rc = aq.wait(["show", "hostmachinelist"])
    rc = aq.wait(["show", "cpu", "--all"])
    rc = aq.wait(["show", "model", "--type", "blade"])
    rc = aq.wait(["show", "service", "--all"])
    rc = aq.wait(["show", "archetype", "--all"])
    rc = aq.wait(["show", "map", "--building", "np"])
    rc = aq.wait(["show", "chassis", "--all"])
    rc = aq.wait(["show", "rack", "--all"])
    rc = aq.wait(["show", "building", "--all"])
    rc = aq.wait(["show", "city", "--all"])
    rc = aq.wait(["show", "country", "--all"])
    rc = aq.wait(["show", "continent", "--all"])
    rc = aq.wait(["show", "hub", "--all"])
    rc = aq.wait(["show", "machine", "--all"])
    rc = aq.wait(["show", "tor_switch", "--model", "rs g8000"])
    rc = aq.wait(["show", "principal", "--all"])
Beispiel #14
0
def compile(domain, aqservice, aqhost, aqport):
    aq = AQRunner(aqservice=aqservice, aqhost=aqhost, aqport=aqport)
    print "Compiling domain %s" % domain
    rc = aq.wait(["compile", "--domain=%s" % domain])