Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
babd8395
Commit
babd8395
authored
May 19, 2008
by
Leigh B. Stoller
Browse files
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
Changes
4
Hide whitespace changes
Inline
Side-by-side
db/Node.pm.in
View file @
babd8395
...
...
@@ -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
', " .
...
...
sql/database-create.sql
View file @
babd8395
...
...
@@ -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`
),
...
...
sql/database-migrate.txt
View file @
babd8395
...
...
@@ -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();
utils/newnode.in
View file @
babd8395
...
...
@@ -2,7 +2,7 @@
#
# EMULAB-COPYRIGHT
# Copyright (c) 2003-200
7
University of Utah and the Flux Group.
# Copyright (c) 2003-200
8
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()),
"
.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment