Commit 940b5538 authored by Mike Hibler's avatar Mike Hibler

Add hack support for booting nodes coming out of PXEWAIT when they have

an alternate pxe_boot_path: when bootinfo is invoked for a node for which
pxe_boot_path is non-NULL and doesn't look like the RE: '.*pxeboot.*'
then we tell the node to reboot so that it will come back up in the
proper PXE boot program.
parent 02305526
/*
* EMULAB-COPYRIGHT
* Copyright (c) 2000-2004 University of Utah and the Flux Group.
* Copyright (c) 2000-2004, 2006 University of Utah and the Flux Group.
* All rights reserved.
*/
......@@ -199,6 +199,12 @@ main(int argc, char **argv)
bievent_send(client.sin_addr,
TBDB_NODESTATE_PXEWAIT);
break;
case BIBOOTWHAT_TYPE_REBOOT:
bievent_send(client.sin_addr,
TBDB_NODESTATE_REBOOTING);
break;
default:
error("%s: invalid boot directive: %d\n",
inet_ntoa(client.sin_addr),
......@@ -348,6 +354,9 @@ log_bootwhat(struct in_addr ipaddr, boot_what_t *bootinfo)
case BIBOOTWHAT_TYPE_MFS:
info("%s: REPLY: boot from mfs %s\n", ipstr, bootinfo->what.mfs);
break;
case BIBOOTWHAT_TYPE_REBOOT:
info("%s: REPLY: reboot (alternate PXE boot)\n", ipstr);
break;
}
if (bootinfo->cmdline[0]) {
info("%s: REPLY: command line: %s\n", ipstr, bootinfo->cmdline);
......
/*
* EMULAB-COPYRIGHT
* Copyright (c) 2000-2004 University of Utah and the Flux Group.
* Copyright (c) 2000-2004, 2006 University of Utah and the Flux Group.
* All rights reserved.
*/
......@@ -72,6 +72,7 @@ query_bootinfo_db(struct in_addr ipaddr, int version, boot_what_t *info)
#define NEXT_BOOT_MFS 12
#define NEXT_BOOT_PARTITION 13
#define PID 14
#define PXE_BOOT_PATH 15
#define DEFINED(x) (row[(x)] != NULL && row[(x)][0] != '\0')
#define TOINT(x) (atoi(row[(x)]))
......@@ -81,7 +82,7 @@ query_bootinfo_db(struct in_addr ipaddr, int version, boot_what_t *info)
" otemp.path, otemp.mfs, ptemp.partition, "
" n.next_boot_osid, n.next_boot_cmd_line, "
" onext.path, onext.mfs, pnext.partition, "
" r.pid "
" r.pid,n.pxe_boot_path "
" from interfaces as i "
"left join nodes as n on i.node_id=n.node_id "
"left join reserved as r on i.node_id=r.node_id "
......@@ -100,7 +101,7 @@ query_bootinfo_db(struct in_addr ipaddr, int version, boot_what_t *info)
" n.next_boot_osid=pnext.osid "
"left join os_info as onext on "
" onext.osid=n.next_boot_osid "
"where i.IP='%s'", 15, inet_ntoa(ipaddr));
"where i.IP='%s'", 16, inet_ntoa(ipaddr));
if (!res) {
error("Query failed for host %s\n", ipstr);
......@@ -130,6 +131,20 @@ query_bootinfo_db(struct in_addr ipaddr, int version, boot_what_t *info)
goto done;
}
/*
* If we received a query from a node whose PXE boot program is
* not pxeboot, then it must be coming out of PXEWAIT and we need
* to tell it to reboot again to pick up the new PXE boot program.
*
* XXX if "pxeboot" occurs in the string anywhere we assume it is
* a varient of our pxeboot and we don't do the reboot.
*/
if (DEFINED(PXE_BOOT_PATH) &&
strstr(row[PXE_BOOT_PATH], "pxeboot") == NULL) {
info->type = BIBOOTWHAT_TYPE_REBOOT;
goto done;
}
/*
* Check next_boot_osid. It overrides the others. It should be
* the case that partition and path/mfs are mutually exclusive.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment