return False
if forced_action == "reboot":
- conn.restart_node('rins')
+ conn.restart_node('reinstall')
return True
boot_state = conn.get_boot_state()
]:
sequences.update({n : "restart_bootmanager_boot"})
- # conn.restart_bootmanager('rins')
+ # conn.restart_bootmanager('reinstall')
for n in [ "bminit-cfg-auth-getplc-installinit-validate-exception-modulefail-update-debug-done",
"bminit-cfg-auth-getplc-update-installinit-validate-exception-modulefail-update-debug-done",
"bminit-cfg-auth-getplc-installinit-validate-bmexceptmount-exception-noinstall-update-debug-done",
"bminit-cfg-auth-getplc-update-installinit-validate-rebuildinitrd-netcfg-disk-update4-update3-update3-implementerror-update-debug-done",
"bminit-cfg-auth-getplc-installinit-validate-exception-bmexceptmount-exception-noinstall-update-debug-done",
"bminit-cfg-auth-getplc-update-installinit-validate-exception-bmexceptmount-exception-noinstall-update-debug-done",
+ "bminit-cfg-auth-getplc-update-installinit-validate-bmexceptvgscan-exception-noinstall-update-debug-validate-bmexceptvgscan-done",
+ "bminit-cfg-auth-getplc-update-installinit-validate-exception-noinstall-update-debug-validate-done",
]:
sequences.update({n : "restart_bootmanager_rins"})
# repair_node_keys
sequences.update({"bminit-cfg-auth-bootcheckfail-authfail-exception-update-bootupdatefail-authfail-debug-done": "repair_node_keys"})
- # conn.restart_node('rins')
+ # conn.restart_node('reinstall')
for n in ["bminit-cfg-auth-getplc-update-installinit-validate-rebuildinitrd-exception-chrootfail-update-debug-done",
"bminit-cfg-auth-getplc-update-installinit-validate-rebuildinitrd-netcfg-update3-disk-update4-exception-chrootfail-update-debug-done",
"bminit-cfg-auth-getplc-hardware-installinit-installdisk-installbootfs-installcfg-exception-chrootfail-update-debug-done",
conn.restart_bootmanager('boot')
elif sequences[s] == "restart_bootmanager_rins":
if config and not config.quiet: print "...Restarting BootManager.py on %s "% node
- conn.restart_bootmanager('rins')
+ conn.restart_bootmanager('reinstall')
elif sequences[s] == "restart_node_rins":
- conn.restart_node('rins')
+ conn.restart_node('reinstall')
elif sequences[s] == "restart_node_boot":
conn.restart_node('boot')
elif sequences[s] == "repair_node_keys":
if conn.compare_and_repair_nodekeys():
# the keys either are in sync or were forced in sync.
# so try to reboot the node again.
- conn.restart_bootmanager('rins')
+ conn.restart_bootmanager('reinstall')
pass
else:
# there was some failure to synchronize the keys.
args = {}
try:
node = api.GetNodes(hostname)[0]
- net = api.GetNodeNetworks(node['nodenetwork_ids'])[0]
+ net = api.GetInterfaces(node['interface_ids'])[0]
except:
from nodecommon import email_exception
email_exception()
args['hostname'] = hostname
args['network_config'] = nodenet_str
- args['nodenetwork_id'] = net['nodenetwork_id']
+ args['interface_id'] = net['interface_id']
m = PersistMessage(hostname, mailtxt.baddns[0] % args,
mailtxt.baddns[1] % args, True, db='baddns_persistmessages')
for h in d_nodes:
host = d_nodes[h]
- for nw_id in host['nodenetwork_ids']:
- l_nw = plc.getNodeNetworks({'nodenetwork_id': host['nodenetwork_ids']})
+ for nw_id in host['interface_ids']:
+ l_nw = plc.getNodeNetworks({'interface_id': host['interface_ids']})
bwlimit[h] = []
for nw in l_nw:
if nw['bwlimit'] != None and nw['bwlimit'] < 500000:
You may update the node's network information at the link below:
- https://www.planet-lab.org/db/nodes/node_networks.php?id=%(nodenetwork_id)s
+ https://www.planet-lab.org/db/nodes/node_networks.php?id=%(interface_id)s
If you have any questions, please feel free to contact us at PlanetLab Support (support@planet-lab.org).
echo ' "bmlog":"'`ls /tmp/bm.log`'",'
echo ' "bootcd":"'`cat /mnt/cdrom/bootme/ID`'",'
echo ' "nm":"'`ps ax | grep nm.py | grep -v grep`'",'
- echo ' "readonlyfs":"'`touch /var/log/monitor 2>&1`'",'
+ echo ' "readonlyfs":"'`touch /var/log/monitor 2>&1 ; touch /vservers/monitor.log 2>&1`'",'
echo ' "dns":"'`host boot.planet-lab.org 2>&1`'",'
echo ' "princeton_comon":"'`ls -d /vservers/princeton_comon`'",'
values['pcu'] = "NOPCU"
site_id = d_node[0]['site_id']
last_contact = d_node[0]['last_contact']
- nodegroups = [ i['name'] for i in api.GetNodeGroups(d_node[0]['nodegroup_ids']) ]
+ nodegroups = [ i['groupname'] for i in api.GetNodeGroups(d_node[0]['nodegroup_ids']) ]
values['plcnode'] = {'status' : 'SUCCESS',
'pcu_ids': pcu,
'boot_state' : d_node[0]['boot_state'],
f_nodes = [config.node]
l_nodes = filter(lambda x: x['hostname'] in f_nodes, l_nodes)
elif config.nodegroup:
- ng = api.GetNodeGroups({'name' : config.nodegroup})
+ ng = api.GetNodeGroups({'groupname' : config.nodegroup})
l_nodes = api.GetNodes(ng[0]['node_ids'])
elif config.site:
site = api.GetSites(config.site)
if type(host) == type(""): host = [host]
# get the node(s) info
- nodes = self.api.GetNodes(self.auth,host,["hostname","ssh_rsa_key","nodenetwork_ids"])
+ nodes = self.api.GetNodes(self.auth,host,["hostname","ssh_rsa_key","interface_ids"])
# for each node's node network, update the self.nodenetworks cache
nodenetworks = []
for node in nodes:
- for net in node["nodenetwork_ids"]:
+ for net in node["interface_ids"]:
nodenetworks.append(net)
- plcnodenetworks = self.api.GetNodeNetworks(self.auth,nodenetworks,["nodenetwork_id","ip"])
+ plcnodenetworks = self.api.GetInterfaces(self.auth,nodenetworks,["interface_id","ip"])
for n in plcnodenetworks:
- self.nodenetworks[n["nodenetwork_id"]]=n
+ self.nodenetworks[n["interface_id"]]=n
return nodes
def _record_from_node(self, node, nokey_list=None):
host = node['hostname']
key = node['ssh_rsa_key']
- nodenetworks = node['nodenetwork_ids']
+ nodenetworks = node['interface_ids']
if len(nodenetworks)==0: return (host, None, None, None)
- # the [0] subscript to node['nodenetwork_ids'] means
+ # the [0] subscript to node['interface_ids'] means
# that this function wont work with multihomed nodes
l_nw = self.nodenetworks.get(nodenetworks[0],None)
if l_nw is None: return (host, None, None, None)
# set node to 'rins' boot state.
print "CALLING REBOOT +++ RINS"
- plc.nodeBootState(host, 'rins')
+ plc.nodeBootState(host, 'reinstall')
ret = reboot.reboot(host)
pflags.setRecentFlag('pcu_rins_tried')
node = api.GetNodes(host, ['boot_state', 'last_contact', 'last_updated', 'date_created'])
record = {'observation' : node[0],
'model' : 'USER_REQUEST',
- 'action' : 'api.UpdateNode(%s, {"boot_state" : "rins"})' % host,
+ 'action' : 'api.UpdateNode(%s, {"boot_state" : "reinstall"})' % host,
'time' : time.time()}
l = Log(host, record)
- ret = api.UpdateNode(host, {'boot_state' : 'rins'})
+ ret = api.UpdateNode(host, {'boot_state' : 'reinstall'})
if ret:
# it's nice to see the current status rather than the previous status on the console
node = api.GetNodes(host)[0]
# COLLECT nodegroups, nodes and node lists
if config.nodegroup:
- ng = api.GetNodeGroups({'name' : config.nodegroup})
+ ng = api.GetNodeGroups({'groupname' : config.nodegroup})
nodelist = api.GetNodes(ng[0]['node_ids'])
hostnames = [ n['hostname'] for n in nodelist ]
if config.rins:
print "Setting %s to rins" % node
- api.UpdateNode(node, {'boot_state' : 'rins'})
+ api.UpdateNode(node, {'boot_state' : 'reinstall'})
if config.backoff:
print "Enabling Slices & Slice Creation for %s" % node
elif l == "down": return red(l)
elif l == "boot": return green(l)
elif l == "rins": return blue(l)
+ elif l == "reinstall": return blue(l)
else:
return l
f_nodes = [config.node]
l_nodes = filter(lambda x: x['hostname'] in f_nodes, l_nodes)
elif config.nodegroup:
- ng = api.GetNodeGroups({'name' : config.nodegroup})
+ ng = api.GetNodeGroups({'groupname' : config.nodegroup})
l_nodes = api.GetNodes(ng[0]['node_ids'], ['hostname'])
elif config.site:
site = api.GetSites(config.site)
try:
n = api.GetNodes(node)[0]
#print n
- net = api.GetNodeNetworks(n['nodenetwork_ids'])[0]
+ net = api.GetInterfaces(n['interface_ids'])[0]
#print net
node_keys = ['boot_state', 'key', 'last_updated', 'last_contact']
group_str = "selection"
else:
- ng = api.GetNodeGroups({'name' : config.nodegroup})
+ ng = api.GetNodeGroups({'grouname' : config.nodegroup})
nodelist = api.GetNodes(ng[0]['node_ids'])
group_str = config.nodegroup
if len(sys.argv[1:]) > 0:
for host in sys.argv[1:]:
n = api.GetNodes(host)[0]
- nn = api.GetNodeNetworks(n['nodenetwork_ids'])
+ nn = api.GetInterfaces(n['interface_ids'])
for nodenet in nn:
- nnet2 = api.GetNodeNetworks({'ip': nodenet['ip']})
+ nnet2 = api.GetInterfaces({'ip': nodenet['ip']})
print "len of nn entries with ip: %s == %s " % ( nodenet['ip'], len(nnet2) )
for nn2 in nnet2:
n2 = api.GetNodes(nn2['node_id'])
- print "\t%d node is attached to nodenetwork %s" % ( len(n2), nn2['nodenetwork_id'] )
+ print "\t%d node is attached to nodenetwork %s" % ( len(n2), nn2['interface_id'] )
if len(n2) != 0 :
n2 = n2[0]
print
#print "host %s : %s" % (n2['hostname'], n2['node_id'])
else:
pass
- #print nn2['nodenetwork_id']
- #api.DeleteNodeNetwork(nn2['nodenetwork_id'])
+ #print nn2['interface_id']
+ #api.DeleteNodeNetwork(nn2['interface_id'])
else:
nnids = util.file.getListFromFile('nnids.txt')
nnids = [ int(i) for i in nnids]
for id in nnids:
- nnet2 = api.GetNodeNetworks(id)
+ nnet2 = api.GetInterfaces(id)
for nn2 in nnet2:
n2 = api.GetNodes(nn2['node_id'])
if len(n2) == 0 :
- print "\t%d node is attached to nodenetwork %s %s" % ( len(n2), nn2['nodenetwork_id'] , nn2['ip']),
+ print "\t%d node is attached to nodenetwork %s %s" % ( len(n2), nn2['interface_id'] , nn2['ip']),
- netlist = api.GetNodeNetworks({'ip' : nn2['ip']})
+ netlist = api.GetInterfaces({'ip' : nn2['ip']})
if len(netlist) != 1:
node_len = len([ n['node_id'] for n in netlist])
print "\t but, ip %s is used by %s nodenetwork entries" % (nn2['ip'], node_len)
def getNodeNetworks(filter=None):
api = xmlrpclib.Server(auth.server, verbose=False, allow_none=True)
- nodenetworks = api.GetNodeNetworks(auth.auth, filter, None)
+ nodenetworks = api.GetInterfaces(auth.auth, filter, None)
return nodenetworks
def getNodes(filter=None, fields=None):
api = xmlrpclib.Server(auth.server, verbose=False, allow_none=True)
nodes = api.GetNodes(auth.auth, filter, fields)
#['boot_state', 'hostname',
- #'site_id', 'date_created', 'node_id', 'version', 'nodenetwork_ids',
+ #'site_id', 'date_created', 'node_id', 'version', 'interface_ids',
#'last_updated', 'peer_node_id', 'ssh_rsa_key' ])
return nodes
self.actions['suspendslices'] = lambda args: plc.suspendSlices(args['hostname'])
self.actions['nocreate'] = lambda args: plc.removeSliceCreation(args['hostname'])
self.actions['close_rt'] = lambda args: close_rt_backoff(args)
- self.actions['rins'] = lambda args: plc.nodeBootState(args['hostname'], "rins")
+ self.actions['rins'] = lambda args: plc.nodeBootState(args['hostname'], "reinstall")
self.actions['noop'] = lambda args: args
self.actions['reboot_node'] = lambda args: reboot_node(args)
self.actions['reset_nodemanager'] = lambda args: args # reset_nodemanager(args)
print "%s" % act_record['log'],
print "%15s" % (['reboot_node'],)
# Set node to re-install
- plc.nodeBootState(act_record['nodename'], "rins")
+ plc.nodeBootState(act_record['nodename'], "reinstall")
try:
ret = reboot_node({'hostname': act_record['nodename']})
except Exception, exc:
return "BAD" # "cpu_slow",
if cstat['memsize'] != "null" and float(cstat['memsize']) < 2.8:
return "BAD" # "mem_small",
- if cstat['disksize'] != "null" and float(cstat['disksize']) < 300.0:
+ if cstat['disksize'] != "null" and float(cstat['disksize']) < 250.0:
return "BAD" # "disk_small",
if cstat['disksize'] == "null" and \
try:
if float(cstat['cpuspeed']) >= 2.2 and \
float(cstat['memsize']) >= 2.8 and \
- (cstat['disksize'] == "null" or float(cstat['disksize']) >= 300.0):
+ (cstat['disksize'] == "null" or float(cstat['disksize']) >= 250.0):
return "A-OK"
except:
print cstat
def create_netid2ip(l_nodes, l_nodenetworks):
netid2ip = {}
for node in l_nodes:
- for netid in node['nodenetwork_ids']:
+ for netid in node['interface_ids']:
found = False
for nn in l_nodenetworks:
- if nn['nodenetwork_id'] == netid:
+ if nn['interface_id'] == netid:
found = True
netid2ip[netid] = nn['ip']
if not found:
# get nodes at each site, and
l_nodes = plc.getNodes({'peer_id':None}, ['hostname', 'node_id', 'ports', 'site_id', 'version',
- 'last_updated', 'date_created', 'last_contact', 'pcu_ids', 'nodenetwork_ids'])
+ 'last_updated', 'date_created', 'last_contact', 'pcu_ids', 'interface_ids'])
l_nodenetworks = plc.getNodeNetworks()
(plcdb, hn2lb, lb2hn) = dsn_from_dsln(d_sites, id2lb, l_nodes)
site_nodes = api.GetNodes(site['node_ids'])
site_people = api.GetPersons(site['person_ids'])
for node in site_nodes:
- network = api.GetNodeNetworks(node['nodenetwork_ids'])
+ network = api.GetInterfaces(node['interface_ids'])
print "ok"
except:
sys.stderr.write(traceback.format_exc())