コード例 #1
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"
        ])
コード例 #2
0
ファイル: transition_rack.py プロジェクト: piojo/aquilon
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])
コード例 #3
0
ファイル: transition_rack.py プロジェクト: ned21/aquilon
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])
コード例 #4
0
ファイル: setup.py プロジェクト: piojo/aquilon
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"])
コード例 #5
0
ファイル: add_rack.py プロジェクト: ned21/aquilon
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"])
コード例 #6
0
ファイル: add_rack.py プロジェクト: piojo/aquilon
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"])
コード例 #7
0
ファイル: update_rack.py プロジェクト: piojo/aquilon
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])
コード例 #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])
コード例 #9
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])
コード例 #10
0
ファイル: del_rack.py プロジェクト: jrha/aquilon
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])
コード例 #11
0
ファイル: compile.py プロジェクト: ned21/aquilon
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])
コード例 #12
0
ファイル: show_info.py プロジェクト: piojo/aquilon
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"])
コード例 #13
0
ファイル: show_info.py プロジェクト: ned21/aquilon
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"])
コード例 #14
0
ファイル: compile.py プロジェクト: jrha/aquilon
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])