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"])
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])
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])