Commit babd8395 authored by Leigh Stoller's avatar Leigh Stoller

Add a uuid slot to the nodes table; protogeni needs it.

Note that I did not change the plab code; needs to be done.
parent 58ccda8d
......@@ -1153,6 +1153,12 @@ sub CreateVnodes($$)
return -1;
}
my $uuid = NewUUID();
if (!defined($uuid)) {
print "Could not generate a UUID!\n";
next NODE;
}
#
# Assign however many we are told to (typically by assign). Locally
# this is not a problem since nodes are not shared; assign always
......@@ -1238,6 +1244,7 @@ sub CreateVnodes($$)
my $statement =
"insert into nodes set ".
" node_id='$vnodeid', " .
" uuid='$uuid', " .
" type='$vtype', ".
" phys_nodeid='$pnode', ".
" role='virtnode', " .
......
......@@ -2172,6 +2172,7 @@ CREATE TABLE `nodes` (
`destination_y` float default NULL,
`destination_orientation` float default NULL,
`reserved_pid` varchar(12) default NULL,
`uuid` varchar(40) NOT NULL default '',
PRIMARY KEY (`node_id`),
KEY `phys_nodeid` (`phys_nodeid`),
KEY `node_id` (`node_id`,`phys_nodeid`),
......
......@@ -4500,3 +4500,8 @@ last_net_act,last_cpu_act,last_ext_act);
add `password` tinytext,
add KEY `uid` (`uid`),
add KEY `uid_idx` (`uid_idx`);
4.151: Add a uuid slot to the nodes table, for protogeni.
alter table nodes add `uuid` varchar(40) NOT NULL default '';
update nodes set uuid=UUID();
......@@ -2,7 +2,7 @@
#
# EMULAB-COPYRIGHT
# Copyright (c) 2003-2007 University of Utah and the Flux Group.
# Copyright (c) 2003-2008 University of Utah and the Flux Group.
# All rights reserved.
#
......@@ -13,6 +13,7 @@
use lib '@prefix@/lib';
use libdb;
use libtestbed;
use libxmlrpc;
use NodeType;
use English;
......@@ -361,10 +362,15 @@ NODE: foreach my $node_id (@node_ids) {
#
# Okay, time to actually add the node!
#
my $uuid = NewUUID();
if (!defined($uuid)) {
print "Could not generate a UUID!\n";
next NODE;
}
DBQueryFatal("INSERT INTO nodes SET node_id='$node_id', type='$type', " .
"phys_nodeid='$node_id', role='$role', priority=$priority, " .
"eventstate='$state', op_mode='$opmode', " .
"eventstate='$state', op_mode='$opmode', uuid='$uuid', " .
"def_boot_osid='$osid', " .
"inception=now(), ".
"state_timestamp=unix_timestamp(NOW()), " .
......
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