database-create.sql 45.6 KB
Newer Older
1 2 3 4
-- MySQL dump 8.22
--
-- Host: localhost    Database: tbdb
---------------------------------------------------------
5
-- Server version	3.23.52-log
6

7 8 9
--
-- Table structure for table 'cdroms'
--
10 11 12 13 14 15 16 17 18 19 20 21

CREATE TABLE cdroms (
  cdkey varchar(64) NOT NULL default '',
  user_name tinytext NOT NULL,
  user_email tinytext NOT NULL,
  ready tinyint(4) NOT NULL default '0',
  requested datetime NOT NULL default '0000-00-00 00:00:00',
  created datetime NOT NULL default '0000-00-00 00:00:00',
  version int(10) unsigned NOT NULL default '1',
  PRIMARY KEY  (cdkey)
) TYPE=MyISAM;

22 23 24
--
-- Table structure for table 'comments'
--
25

26 27
CREATE TABLE comments (
  table_name varchar(64) NOT NULL default '',
28 29
  column_name varchar(64) NOT NULL default '',
  description text NOT NULL,
30
  UNIQUE KEY table_name (table_name,column_name)
31 32
) TYPE=MyISAM;

33 34 35
--
-- Table structure for table 'current_reloads'
--
36 37 38

CREATE TABLE current_reloads (
  node_id varchar(10) NOT NULL default '',
39
  image_id varchar(45) NOT NULL default '',
40 41 42
  PRIMARY KEY  (node_id)
) TYPE=MyISAM;

43 44 45
--
-- Table structure for table 'delays'
--
46 47 48

CREATE TABLE delays (
  node_id varchar(10) NOT NULL default '',
49 50 51 52
  pipe0 smallint(5) unsigned NOT NULL default '0',
  delay0 float(10,2) NOT NULL default '0.00',
  bandwidth0 int(10) unsigned NOT NULL default '100',
  lossrate0 float(10,3) NOT NULL default '0.000',
53 54 55 56 57 58 59 60 61 62 63 64 65
  q0_limit int(11) default '0',
  q0_maxthresh int(11) default '0',
  q0_minthresh int(11) default '0',
  q0_weight float default '0',
  q0_linterm int(11) default '0',
  q0_qinbytes tinyint(4) default '0',
  q0_bytes tinyint(4) default '0',
  q0_meanpsize int(11) default '0',
  q0_wait int(11) default '0',
  q0_setbit int(11) default '0',
  q0_droptail int(11) default '0',
  q0_red tinyint(4) default '0',
  q0_gentle tinyint(4) default '0',
66 67 68 69
  pipe1 smallint(5) unsigned NOT NULL default '0',
  delay1 float(10,2) NOT NULL default '0.00',
  bandwidth1 int(10) unsigned NOT NULL default '100',
  lossrate1 float(10,3) NOT NULL default '0.000',
70 71 72 73 74 75 76 77 78 79 80 81 82
  q1_limit int(11) default '0',
  q1_maxthresh int(11) default '0',
  q1_minthresh int(11) default '0',
  q1_weight float default '0',
  q1_linterm int(11) default '0',
  q1_qinbytes tinyint(4) default '0',
  q1_bytes tinyint(4) default '0',
  q1_meanpsize int(11) default '0',
  q1_wait int(11) default '0',
  q1_setbit int(11) default '0',
  q1_droptail int(11) default '0',
  q1_red tinyint(4) default '0',
  q1_gentle tinyint(4) default '0',
83 84
  iface0 varchar(8) NOT NULL default '',
  iface1 varchar(8) NOT NULL default '',
85 86 87
  eid varchar(32) default NULL,
  pid varchar(32) default NULL,
  vname varchar(32) default NULL,
88 89
  vnode0 varchar(32) default NULL,
  vnode1 varchar(32) default NULL,
90 91
  card0 tinyint(3) unsigned default NULL,
  card1 tinyint(3) unsigned default NULL,
92 93
  PRIMARY KEY  (node_id,iface0,iface1),
  KEY pid (pid,eid)
94 95
) TYPE=MyISAM;

96 97 98
--
-- Table structure for table 'delta_inst'
--
99 100 101 102 103 104 105 106

CREATE TABLE delta_inst (
  node_id varchar(10) NOT NULL default '',
  partition tinyint(4) NOT NULL default '0',
  delta_id varchar(10) NOT NULL default '',
  PRIMARY KEY  (node_id,partition,delta_id)
) TYPE=MyISAM;

107 108 109
--
-- Table structure for table 'delta_proj'
--
110 111 112 113 114 115 116

CREATE TABLE delta_proj (
  delta_id varchar(10) NOT NULL default '',
  pid varchar(10) NOT NULL default '',
  PRIMARY KEY  (delta_id,pid)
) TYPE=MyISAM;

117 118 119
--
-- Table structure for table 'deltas'
--
120 121 122 123 124 125 126 127 128

CREATE TABLE deltas (
  delta_id varchar(10) NOT NULL default '',
  delta_desc text,
  delta_path text NOT NULL,
  private enum('yes','no') NOT NULL default 'no',
  PRIMARY KEY  (delta_id)
) TYPE=MyISAM;

129 130 131
--
-- Table structure for table 'event_eventtypes'
--
Robert Ricci's avatar
Robert Ricci committed
132 133 134 135 136 137 138

CREATE TABLE event_eventtypes (
  idx smallint(5) unsigned NOT NULL default '0',
  type tinytext NOT NULL,
  PRIMARY KEY  (idx)
) TYPE=MyISAM;

139 140 141
--
-- Table structure for table 'event_objecttypes'
--
Robert Ricci's avatar
Robert Ricci committed
142 143 144 145 146 147 148

CREATE TABLE event_objecttypes (
  idx smallint(5) unsigned NOT NULL default '0',
  type tinytext NOT NULL,
  PRIMARY KEY  (idx)
) TYPE=MyISAM;

149 150 151
--
-- Table structure for table 'eventlist'
--
152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167

CREATE TABLE eventlist (
  pid varchar(12) NOT NULL default '',
  eid varchar(32) NOT NULL default '',
  idx int(10) unsigned NOT NULL auto_increment,
  time float(10,3) NOT NULL default '0.000',
  vnode varchar(32) NOT NULL default '',
  vname varchar(20) NOT NULL default '',
  objecttype smallint(5) unsigned NOT NULL default '0',
  eventtype smallint(5) unsigned NOT NULL default '0',
  arguments tinytext,
  atstring tinytext,
  PRIMARY KEY  (pid,eid,idx),
  KEY vnode (vnode)
) TYPE=MyISAM;

168
--
Chad Barb's avatar
 
Chad Barb committed
169
-- Table structure for table 'experiment_resources'
170 171 172 173 174
--

CREATE TABLE experiment_resources (
  idx int(10) unsigned NOT NULL auto_increment,
  exptidx int(10) unsigned NOT NULL default '0',
175
  lastidx int(10) unsigned default NULL,
176 177 178 179 180 181 182 183 184 185 186 187 188 189 190
  tstamp datetime default NULL,
  vnodes smallint(5) unsigned default '0',
  pnodes smallint(5) unsigned default '0',
  wanodes smallint(5) unsigned default '0',
  simnodes smallint(5) unsigned default '0',
  jailnodes smallint(5) unsigned default '0',
  delaynodes smallint(5) unsigned default '0',
  linkdelays smallint(5) unsigned default '0',
  walinks smallint(5) unsigned default '0',
  links smallint(5) unsigned default '0',
  lans smallint(5) unsigned default '0',
  shapedlinks smallint(5) unsigned default '0',
  shapedlans smallint(5) unsigned default '0',
  minlinks tinyint(3) unsigned default '0',
  maxlinks tinyint(3) unsigned default '0',
191
  thumbnail mediumblob,
192
  PRIMARY KEY  (idx),
193 194
  KEY exptidx (exptidx),
  KEY lastidx (lastidx)
195 196
) TYPE=MyISAM;

197
--
Robert Ricci's avatar
Robert Ricci committed
198
-- Table structure for table 'experiment_stats'
199
--
200

201 202 203 204
CREATE TABLE experiment_stats (
  pid varchar(12) NOT NULL default '',
  eid varchar(32) NOT NULL default '',
  creator varchar(8) NOT NULL default '',
205 206 207
  exptidx int(10) unsigned NOT NULL default '0',
  rsrcidx int(10) unsigned NOT NULL default '0',
  lastrsrc int(10) unsigned default NULL,
208 209 210 211 212 213 214
  gid varchar(16) NOT NULL default '',
  created datetime default NULL,
  destroyed datetime default NULL,
  swapin_count smallint(5) unsigned default '0',
  swapin_last datetime default NULL,
  swapout_count smallint(5) unsigned default '0',
  swapout_last datetime default NULL,
215 216
  swapmod_count smallint(5) unsigned default '0',
  swapmod_last datetime default NULL,
217
  swap_errors smallint(5) unsigned default '0',
Robert Ricci's avatar
Robert Ricci committed
218
  swap_exitcode tinyint(3) unsigned default '0',
219
  idle_swaps smallint(5) unsigned default '0',
220
  swapin_duration int(10) unsigned default '0',
221
  batch tinyint(3) unsigned default '0',
222 223 224
  PRIMARY KEY  (eid,pid,exptidx),
  KEY exptidx (exptidx),
  KEY rsrcidx (rsrcidx)
225 226 227 228 229 230
) TYPE=MyISAM;

--
-- Table structure for table 'experiments'
--

231 232 233
CREATE TABLE experiments (
  eid varchar(32) NOT NULL default '',
  pid varchar(12) NOT NULL default '',
234
  gid varchar(16) NOT NULL default '',
235 236 237 238 239 240 241
  expt_created datetime default NULL,
  expt_expires datetime default NULL,
  expt_name tinytext,
  expt_head_uid varchar(8) NOT NULL default '',
  expt_start datetime default NULL,
  expt_end datetime default NULL,
  expt_terminating datetime default NULL,
242 243
  expt_locked datetime default NULL,
  expt_swapped datetime default NULL,
244
  expt_swap_uid varchar(8) NOT NULL default '',
245 246
  swappable tinyint(4) NOT NULL default '0',
  priority tinyint(4) NOT NULL default '0',
247 248 249 250 251 252
  noswap_reason tinytext,
  idleswap tinyint(4) NOT NULL default '0',
  idleswap_timeout int(4) NOT NULL default '0',
  noidleswap_reason tinytext,
  autoswap tinyint(4) NOT NULL default '0',
  autoswap_timeout int(4) NOT NULL default '0',
253
  batchmode tinyint(4) NOT NULL default '0',
254
  shared tinyint(4) NOT NULL default '0',
255
  state varchar(12) NOT NULL default 'new',
256 257 258 259
  maximum_nodes tinyint(4) default NULL,
  minimum_nodes tinyint(4) default NULL,
  testdb tinytext,
  path tinytext,
260
  logfile tinytext,
261
  logfile_open tinyint(4) NOT NULL default '0',
262 263 264
  attempts smallint(5) unsigned NOT NULL default '0',
  canceled tinyint(4) NOT NULL default '0',
  batchstate varchar(12) default NULL,
Robert Ricci's avatar
Robert Ricci committed
265
  event_sched_pid int(11) default '0',
266
  uselinkdelays tinyint(4) NOT NULL default '0',
267
  forcelinkdelays tinyint(4) NOT NULL default '0',
268
  multiplex_factor smallint(5) default NULL,
269
  uselatestwadata tinyint(4) NOT NULL default '0',
270
  usewatunnels tinyint(4) NOT NULL default '1',
271 272 273
  wa_delay_solverweight float default '0',
  wa_bw_solverweight float default '0',
  wa_plr_solverweight float default '0',
274 275
  swap_requests tinyint(4) NOT NULL default '0',
  last_swap_req datetime default NULL,
276
  idle_ignore tinyint(4) NOT NULL default '0',
277 278
  idx int(10) unsigned NOT NULL auto_increment,
  PRIMARY KEY  (eid,pid),
279 280
  KEY idx (idx),
  KEY batchmode (batchmode)
281 282
) TYPE=MyISAM;

283 284 285
--
-- Table structure for table 'exported_tables'
--
286 287 288 289 290 291

CREATE TABLE exported_tables (
  table_name varchar(64) NOT NULL default '',
  PRIMARY KEY  (table_name)
) TYPE=MyISAM;

292 293 294
--
-- Table structure for table 'exppid_access'
--
295 296 297 298 299 300 301 302

CREATE TABLE exppid_access (
  exp_eid varchar(32) NOT NULL default '',
  exp_pid varchar(12) NOT NULL default '',
  pid varchar(12) NOT NULL default '',
  PRIMARY KEY  (exp_eid,exp_pid,pid)
) TYPE=MyISAM;

303 304 305
--
-- Table structure for table 'foreign_keys'
--
306 307 308 309 310 311 312 313 314

CREATE TABLE foreign_keys (
  table1 varchar(30) NOT NULL default '',
  column1 varchar(30) NOT NULL default '',
  table2 varchar(30) NOT NULL default '',
  column2 varchar(30) NOT NULL default '',
  PRIMARY KEY  (table1,column1)
) TYPE=MyISAM;

315 316 317
--
-- Table structure for table 'group_membership'
--
318 319 320 321 322 323 324 325

CREATE TABLE group_membership (
  uid varchar(8) NOT NULL default '',
  gid varchar(16) NOT NULL default '',
  pid varchar(12) NOT NULL default '',
  trust enum('none','user','local_root','group_root','project_root') default NULL,
  date_applied date default NULL,
  date_approved datetime default NULL,
326 327 328
  PRIMARY KEY  (uid,gid,pid),
  KEY pid (pid),
  KEY gid (gid)
329 330
) TYPE=MyISAM;

331 332 333 334 335 336 337 338 339 340 341 342 343 344 345
--
-- Table structure for table 'group_stats'
--

CREATE TABLE group_stats (
  pid varchar(12) NOT NULL default '',
  gid varchar(12) NOT NULL default '',
  exptstart_count int(11) unsigned default '0',
  exptstart_last datetime default NULL,
  exptpreload_count int(11) unsigned default '0',
  exptpreload_last datetime default NULL,
  exptswapin_count int(11) unsigned default '0',
  exptswapin_last datetime default NULL,
  exptswapout_count int(11) unsigned default '0',
  exptswapout_last datetime default NULL,
346 347
  exptswapmod_count int(11) unsigned default '0',
  exptswapmod_last datetime default NULL,
348 349 350 351 352 353 354 355
  allexpt_duration int(11) unsigned default '0',
  allexpt_vnodes int(11) unsigned default '0',
  allexpt_vnode_duration int(11) unsigned default '0',
  allexpt_pnodes int(11) unsigned default '0',
  allexpt_pnode_duration int(11) unsigned default '0',
  PRIMARY KEY  (pid,gid)
) TYPE=MyISAM;

356 357 358
--
-- Table structure for table 'groups'
--
359 360 361 362 363 364 365 366 367 368 369 370

CREATE TABLE groups (
  pid varchar(12) NOT NULL default '',
  gid varchar(12) NOT NULL default '',
  leader varchar(8) NOT NULL default '',
  created datetime default NULL,
  description tinytext,
  unix_gid smallint(5) unsigned NOT NULL auto_increment,
  unix_name varchar(16) NOT NULL default '',
  expt_count mediumint(8) unsigned default '0',
  expt_last date default NULL,
  PRIMARY KEY  (pid,gid),
371 372 373
  KEY unix_gid (unix_gid),
  KEY gid (gid),
  KEY pid (pid)
374 375
) TYPE=MyISAM;

376 377 378
--
-- Table structure for table 'iface_counters'
--
379 380 381 382

CREATE TABLE iface_counters (
  node_id varchar(10) NOT NULL default '',
  tstamp datetime NOT NULL default '0000-00-00 00:00:00',
383 384 385
  mac varchar(12) NOT NULL default '0',
  ipkts int(11) NOT NULL default '0',
  opkts int(11) NOT NULL default '0',
386 387 388
  PRIMARY KEY  (node_id,tstamp,mac),
  KEY macindex (mac),
  KEY node_idindex (node_id)
389
) TYPE=MyISAM;
390

391 392 393
--
-- Table structure for table 'images'
--
394 395

CREATE TABLE images (
396 397
  imagename varchar(30) NOT NULL default '',
  pid varchar(12) NOT NULL default '',
398
  gid varchar(12) NOT NULL default '',
399 400 401
  imageid varchar(45) NOT NULL default '',
  creator varchar(8) default NULL,
  created datetime default NULL,
402 403 404
  description tinytext NOT NULL,
  loadpart tinyint(4) NOT NULL default '0',
  loadlength tinyint(4) NOT NULL default '0',
405 406 407 408 409
  part1_osid varchar(35) default NULL,
  part2_osid varchar(35) default NULL,
  part3_osid varchar(35) default NULL,
  part4_osid varchar(35) default NULL,
  default_osid varchar(35) NOT NULL default '',
410 411
  path tinytext,
  magic tinytext,
412
  load_address text,
413 414
  load_busy tinyint(4) NOT NULL default '0',
  ezid tinyint(4) NOT NULL default '0',
415
  shared tinyint(4) NOT NULL default '0',
416
  global tinyint(4) NOT NULL default '0',
417
  updated datetime default NULL,
418
  PRIMARY KEY  (imagename,pid),
Chad Barb's avatar
 
Chad Barb committed
419
  KEY imageid (imageid),
420
  KEY gid (gid)
421 422
) TYPE=MyISAM;

423 424 425
--
-- Table structure for table 'interface_types'
--
426 427

CREATE TABLE interface_types (
428
  type varchar(30) NOT NULL default '',
429 430 431 432 433
  max_speed int(11) default NULL,
  full_duplex tinyint(1) default NULL,
  manufacturuer varchar(30) default NULL,
  model varchar(30) default NULL,
  ports tinyint(4) default NULL,
434
  connector varchar(30) default NULL,
435 436 437
  PRIMARY KEY  (type)
) TYPE=MyISAM;

438 439 440
--
-- Table structure for table 'interfaces'
--
441 442 443 444 445

CREATE TABLE interfaces (
  node_id varchar(10) NOT NULL default '',
  card tinyint(3) unsigned NOT NULL default '0',
  port tinyint(3) unsigned NOT NULL default '0',
446
  mac varchar(12) NOT NULL default '000000000000',
447 448
  IP varchar(15) default NULL,
  IPalias varchar(15) default NULL,
Mac Newbold's avatar
Mac Newbold committed
449
  IPaliases text,
450
  interface_type varchar(30) default NULL,
451
  iface text NOT NULL,
452 453
  current_speed enum('100','10','1000') NOT NULL default '100',
  duplex enum('full','half') NOT NULL default 'full',
454
  PRIMARY KEY  (node_id,card,port),
455 456
  KEY mac (mac),
  KEY IP (IP)
457 458
) TYPE=MyISAM;

459 460 461
--
-- Table structure for table 'ipport_ranges'
--
462 463 464 465 466 467 468 469 470

CREATE TABLE ipport_ranges (
  eid varchar(32) NOT NULL default '',
  pid varchar(12) NOT NULL default '',
  low int(11) NOT NULL default '0',
  high int(11) NOT NULL default '0',
  PRIMARY KEY  (eid,pid)
) TYPE=MyISAM;

471 472 473
--
-- Table structure for table 'ipsubnets'
--
474 475 476 477 478

CREATE TABLE ipsubnets (
  pid varchar(12) NOT NULL default '',
  eid varchar(32) NOT NULL default '',
  idx smallint(5) unsigned NOT NULL auto_increment,
479
  PRIMARY KEY  (idx)
480 481
) TYPE=MyISAM;

482 483 484
--
-- Table structure for table 'last_reservation'
--
485 486 487 488 489 490 491

CREATE TABLE last_reservation (
  node_id varchar(10) NOT NULL default '',
  pid varchar(12) NOT NULL default '',
  PRIMARY KEY  (node_id,pid)
) TYPE=MyISAM;

492 493 494 495 496 497 498 499
--
-- Table structure for table 'linkdelays'
--

CREATE TABLE linkdelays (
  node_id varchar(10) NOT NULL default '',
  iface varchar(8) NOT NULL default '',
  ip varchar(15) NOT NULL default '',
500
  netmask varchar(15) NOT NULL default '255.255.255.0',
501
  type enum('simplex','duplex') NOT NULL default 'duplex',
502 503 504 505 506 507 508 509
  eid varchar(32) default NULL,
  pid varchar(32) default NULL,
  vlan varchar(32) NOT NULL default '',
  vnode varchar(32) NOT NULL default '',
  pipe smallint(5) unsigned NOT NULL default '0',
  delay float(10,2) NOT NULL default '0.00',
  bandwidth int(10) unsigned NOT NULL default '100',
  lossrate float(10,3) NOT NULL default '0.000',
510 511 512 513
  rpipe smallint(5) unsigned NOT NULL default '0',
  rdelay float(10,2) NOT NULL default '0.00',
  rbandwidth int(10) unsigned NOT NULL default '100',
  rlossrate float(10,3) NOT NULL default '0.000',
514 515 516 517 518 519 520 521 522 523 524 525 526
  q_limit int(11) default '0',
  q_maxthresh int(11) default '0',
  q_minthresh int(11) default '0',
  q_weight float default '0',
  q_linterm int(11) default '0',
  q_qinbytes tinyint(4) default '0',
  q_bytes tinyint(4) default '0',
  q_meanpsize int(11) default '0',
  q_wait int(11) default '0',
  q_setbit int(11) default '0',
  q_droptail int(11) default '0',
  q_red tinyint(4) default '0',
  q_gentle tinyint(4) default '0',
527
  PRIMARY KEY  (node_id,vlan,vnode)
528 529
) TYPE=MyISAM;

530 531 532
--
-- Table structure for table 'login'
--
533 534 535 536 537 538 539 540

CREATE TABLE login (
  uid varchar(10) NOT NULL default '',
  hashkey tinytext,
  timeout varchar(10) NOT NULL default '',
  PRIMARY KEY  (uid)
) TYPE=MyISAM;

541 542 543
--
-- Table structure for table 'loginmessage'
--
544 545 546 547 548 549 550

CREATE TABLE loginmessage (
  valid tinyint(4) NOT NULL default '1',
  message tinytext NOT NULL,
  PRIMARY KEY  (valid)
) TYPE=MyISAM;

551 552 553
--
-- Table structure for table 'mode_transitions'
--
554 555 556 557 558 559 560 561 562 563 564

CREATE TABLE mode_transitions (
  op_mode1 varchar(20) NOT NULL default '',
  state1 varchar(20) NOT NULL default '',
  op_mode2 varchar(20) NOT NULL default '',
  state2 varchar(20) NOT NULL default '',
  PRIMARY KEY  (op_mode1,state1,op_mode2,state2),
  KEY op_mode1 (op_mode1,state1),
  KEY op_mode2 (op_mode2,state2)
) TYPE=MyISAM;

565 566 567 568 569
--
-- Table structure for table 'new_interfaces'
--

CREATE TABLE new_interfaces (
570
  new_node_id int(11) NOT NULL default '0',
571
  card int(11) NOT NULL default '0',
572 573
  mac varchar(12) NOT NULL default '',
  interface_type varchar(15) default NULL,
574 575 576
  switch_id varchar(10) default NULL,
  switch_card tinyint(3) default NULL,
  switch_port tinyint(3) default NULL,
577
  PRIMARY KEY  (new_node_id,card)
578 579 580 581 582 583 584
) TYPE=MyISAM;

--
-- Table structure for table 'new_nodes'
--

CREATE TABLE new_nodes (
585
  new_node_id int(11) NOT NULL auto_increment,
586 587 588
  node_id varchar(10) NOT NULL default '',
  type varchar(30) default NULL,
  IP varchar(15) default NULL,
589
  temporary_IP varchar(15) default NULL,
590
  dmesg text,
591
  created timestamp(14) NOT NULL,
592
  PRIMARY KEY  (new_node_id)
593 594
) TYPE=MyISAM;

595 596 597
--
-- Table structure for table 'newdelays'
--
598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618

CREATE TABLE newdelays (
  node_id varchar(10) NOT NULL default '',
  pipe0 smallint(5) unsigned NOT NULL default '0',
  delay0 int(10) unsigned NOT NULL default '0',
  bandwidth0 int(10) unsigned NOT NULL default '100',
  lossrate0 float(10,3) NOT NULL default '0.000',
  pipe1 smallint(5) unsigned NOT NULL default '0',
  delay1 int(10) unsigned NOT NULL default '0',
  bandwidth1 int(10) unsigned NOT NULL default '100',
  lossrate1 float(10,3) NOT NULL default '0.000',
  iface0 varchar(8) NOT NULL default '',
  iface1 varchar(8) NOT NULL default '',
  eid varchar(32) default NULL,
  pid varchar(32) default NULL,
  vname varchar(32) default NULL,
  card0 tinyint(3) unsigned default NULL,
  card1 tinyint(3) unsigned default NULL,
  PRIMARY KEY  (node_id,iface0,iface1)
) TYPE=MyISAM;

619 620 621
--
-- Table structure for table 'next_reserve'
--
622 623 624 625 626 627 628 629

CREATE TABLE next_reserve (
  node_id varchar(10) NOT NULL default '',
  pid varchar(12) NOT NULL default '',
  eid varchar(32) NOT NULL default '',
  PRIMARY KEY  (node_id)
) TYPE=MyISAM;

630 631 632
--
-- Table structure for table 'nextfreenode'
--
633 634 635 636 637 638 639 640

CREATE TABLE nextfreenode (
  nodetype varchar(30) NOT NULL default '',
  nextid int(10) unsigned NOT NULL default '1',
  nextpri int(10) unsigned NOT NULL default '1',
  PRIMARY KEY  (nodetype)
) TYPE=MyISAM;

641 642 643 644 645 646 647 648 649 650
--
-- Table structure for table 'node_activity'
--

CREATE TABLE node_activity (
  node_id varchar(10) NOT NULL default '',
  last_tty_act datetime NOT NULL default '0000-00-00 00:00:00',
  last_net_act datetime NOT NULL default '0000-00-00 00:00:00',
  last_cpu_act datetime NOT NULL default '0000-00-00 00:00:00',
  last_ext_act datetime NOT NULL default '0000-00-00 00:00:00',
651
  last_report datetime NOT NULL default '0000-00-00 00:00:00',
652 653 654
  PRIMARY KEY  (node_id)
) TYPE=MyISAM;

655 656 657
--
-- Table structure for table 'node_idlestats'
--
658 659 660 661 662 663 664 665

CREATE TABLE node_idlestats (
  node_id varchar(10) NOT NULL default '',
  tstamp datetime NOT NULL default '0000-00-00 00:00:00',
  last_tty datetime NOT NULL default '0000-00-00 00:00:00',
  load_1min float NOT NULL default '0',
  load_5min float NOT NULL default '0',
  load_15min float NOT NULL default '0',
666 667
  PRIMARY KEY  (node_id,tstamp)
) TYPE=MyISAM;
668

669
--
670
-- Table structure for table 'node_status'
671
--
672

673 674 675 676 677 678 679
CREATE TABLE node_status (
  node_id varchar(10) NOT NULL default '',
  status enum('up','possibly down','down','unpingable') default NULL,
  status_timestamp datetime default NULL,
  PRIMARY KEY  (node_id)
) TYPE=MyISAM;

680 681 682 683 684 685 686 687 688 689 690
--
-- Table structure for table 'node_type_features'
--

CREATE TABLE node_type_features (
  type varchar(30) NOT NULL default '',
  feature varchar(30) NOT NULL default '',
  weight float NOT NULL default '0',
  PRIMARY KEY  (type,feature)
) TYPE=MyISAM;

691 692 693 694
--
-- Table structure for table 'node_types'
--

695
CREATE TABLE node_types (
696
  class varchar(10) default NULL,
697 698
  type varchar(30) NOT NULL default '',
  proc varchar(30) default NULL,
699 700 701 702 703
  speed smallint(5) unsigned default NULL,
  RAM smallint(5) unsigned default NULL,
  HD float(10,2) default NULL,
  max_cards tinyint(3) unsigned default NULL,
  max_ports tinyint(3) unsigned default NULL,
704
  osid varchar(35) NOT NULL default '',
705 706
  control_net tinyint(3) unsigned default NULL,
  power_time smallint(5) unsigned NOT NULL default '60',
707
  imageid varchar(45) NOT NULL default '',
708
  imageable tinyint(4) default '0',
709
  delay_capacity tinyint(4) NOT NULL default '0',
710
  virtnode_capacity tinyint(4) NOT NULL default '0',
711
  control_iface text,
712
  disktype enum('ad','da','ar') default NULL,
713
  delay_osid varchar(35) default NULL,
714
  jail_osid varchar(35) default NULL,
715
  pxe_boot_path text,
716
  isvirtnode tinyint(4) NOT NULL default '0',
717
  isremotenode tinyint(4) NOT NULL default '0',
718 719 720
  PRIMARY KEY  (type)
) TYPE=MyISAM;

721 722 723
--
-- Table structure for table 'nodeipportnum'
--
724 725 726

CREATE TABLE nodeipportnum (
  node_id varchar(10) NOT NULL default '',
727
  port smallint(5) unsigned NOT NULL default '11000',
728 729 730
  PRIMARY KEY  (node_id)
) TYPE=MyISAM;

731 732 733
--
-- Table structure for table 'nodelog'
--
734 735 736 737 738 739 740 741 742 743 744

CREATE TABLE nodelog (
  node_id varchar(10) NOT NULL default '',
  log_id smallint(5) unsigned NOT NULL auto_increment,
  type enum('misc') NOT NULL default 'misc',
  reporting_uid varchar(8) NOT NULL default '',
  entry tinytext NOT NULL,
  reported datetime default NULL,
  PRIMARY KEY  (node_id,log_id)
) TYPE=MyISAM;

745 746 747
--
-- Table structure for table 'nodes'
--
748 749 750

CREATE TABLE nodes (
  node_id varchar(10) NOT NULL default '',
751
  type varchar(30) NOT NULL default '',
752
  phys_nodeid varchar(10) default NULL,
753
  role enum('testnode','virtnode','ctrlnode','testswitch','ctrlswitch','powerctrl','unused') NOT NULL default 'unused',
754
  def_boot_osid varchar(35) NOT NULL default '',
755 756
  def_boot_path text,
  def_boot_cmd_line text,
757
  next_boot_osid varchar(35) NOT NULL default '',
758 759
  next_boot_path text,
  next_boot_cmd_line text,
760
  pxe_boot_path text,
761 762 763 764 765 766
  rpms text,
  deltas text,
  tarballs text,
  startupcmd tinytext,
  startstatus tinytext,
  ready tinyint(4) unsigned NOT NULL default '0',
767
  priority int(11) NOT NULL default '-1',
768
  bootstatus enum('okay','failed','unknown') default 'unknown',
769
  status enum('up','possibly down','down','unpingable') default NULL,
770
  status_timestamp datetime default NULL,
771
  failureaction enum('fatal','nonfatal','ignore') NOT NULL default 'fatal',
772
  routertype enum('none','ospf','static','manual') NOT NULL default 'none',
773 774
  next_pxe_boot_path text,
  bios_version varchar(64) default NULL,
775
  eventstate varchar(20) default NULL,
776
  state_timestamp int(10) unsigned default NULL,
777
  op_mode varchar(20) default NULL,
778
  op_mode_timestamp int(10) unsigned default NULL,
779 780
  allocstate varchar(20) default NULL,
  allocstate_timestamp int(10) unsigned default NULL,
781
  update_accounts smallint(6) default '0',
Mac Newbold's avatar
Mac Newbold committed
782
  next_op_mode varchar(20) NOT NULL default '',
783
  ipodhash varchar(64) default NULL,
784
  osid varchar(35) NOT NULL default '',
785
  ntpdrift float default NULL,
786
  ipport_low int(11) NOT NULL default '11000',
787
  ipport_next int(11) NOT NULL default '11000',
788
  ipport_high int(11) NOT NULL default '20000',
789
  sshdport int(11) NOT NULL default '11000',
790
  jailflag tinyint(3) unsigned NOT NULL default '0',
791
  jailip varchar(15) default NULL,
792
  PRIMARY KEY  (node_id),
793
  KEY phys_nodeid (phys_nodeid),
794 795
  KEY node_id (node_id,phys_nodeid),
  KEY role (role)
796 797
) TYPE=MyISAM;

798 799 800
--
-- Table structure for table 'nodetypeXpid_permissions'
--
801 802 803 804 805 806 807

CREATE TABLE nodetypeXpid_permissions (
  type varchar(30) NOT NULL default '',
  pid varchar(12) NOT NULL default '',
  PRIMARY KEY  (type,pid)
) TYPE=MyISAM;

808 809 810
--
-- Table structure for table 'nodeuidlastlogin'
--
811 812 813 814 815 816

CREATE TABLE nodeuidlastlogin (
  node_id varchar(10) NOT NULL default '',
  uid varchar(10) NOT NULL default '',
  date date default NULL,
  time time default NULL,
817 818 819
  PRIMARY KEY  (node_id)
) TYPE=MyISAM;

820 821 822
--
-- Table structure for table 'nologins'
--
823 824 825 826 827 828

CREATE TABLE nologins (
  nologins tinyint(4) NOT NULL default '0',
  PRIMARY KEY  (nologins)
) TYPE=MyISAM;

829 830 831
--
-- Table structure for table 'nseconfigs'
--
Mac Newbold's avatar
Mac Newbold committed
832 833 834 835 836 837 838 839 840

CREATE TABLE nseconfigs (
  pid varchar(12) NOT NULL default '',
  eid varchar(32) NOT NULL default '',
  vname varchar(32) NOT NULL default '',
  nseconfig text,
  PRIMARY KEY  (pid,eid,vname)
) TYPE=MyISAM;

841 842 843
--
-- Table structure for table 'nsfiles'
--
844 845 846 847 848 849 850 851

CREATE TABLE nsfiles (
  pid varchar(12) NOT NULL default '',
  eid varchar(32) NOT NULL default '',
  nsfile text,
  PRIMARY KEY  (eid,pid)
) TYPE=MyISAM;

852 853 854
--
-- Table structure for table 'ntpinfo'
--
855 856 857

CREATE TABLE ntpinfo (
  node_id varchar(10) NOT NULL default '',
858
  IP varchar(64) NOT NULL default '',
859 860 861 862
  type enum('server','peer') NOT NULL default 'peer',
  PRIMARY KEY  (node_id,IP,type)
) TYPE=MyISAM;

863 864 865
--
-- Table structure for table 'os_info'
--
866 867

CREATE TABLE os_info (
868 869 870 871 872
  osname varchar(20) NOT NULL default '',
  pid varchar(12) NOT NULL default '',
  osid varchar(35) NOT NULL default '',
  creator varchar(8) default NULL,
  created datetime default NULL,
873
  description tinytext NOT NULL,
874
  OS enum('Unknown','Linux','FreeBSD','NetBSD','OSKit','Other') NOT NULL default 'Unknown',
875 876 877
  version varchar(12) default '',
  path tinytext,
  magic tinytext,
878
  machinetype varchar(30) NOT NULL default '',
879
  osfeatures set('ping','ssh','ipod','isup') default NULL,
880
  ezid tinyint(4) NOT NULL default '0',
881
  shared tinyint(4) NOT NULL default '0',
882
  mustclean tinyint(4) NOT NULL default '1',
883
  op_mode varchar(20) NOT NULL default 'MINIMAL',
884
  nextosid varchar(35) default NULL,
885
  max_concurrent int(11) default NULL,
Robert Ricci's avatar
Robert Ricci committed
886
  PRIMARY KEY  (osname,pid),
Robert Ricci's avatar
Robert Ricci committed
887 888
  KEY osid (osid),
  KEY OS (OS)
889 890
) TYPE=MyISAM;

891 892 893
--
-- Table structure for table 'osidtoimageid'
--
894 895

CREATE TABLE osidtoimageid (
896
  osid varchar(35) NOT NULL default '',
897
  type varchar(30) NOT NULL default '',
898
  imageid varchar(45) NOT NULL default '',
899
  PRIMARY KEY  (osid,type)
900 901
) TYPE=MyISAM;

902 903 904
--
-- Table structure for table 'outlets'
--
905 906 907 908 909 910 911 912 913

CREATE TABLE outlets (
  node_id varchar(10) NOT NULL default '',
  power_id varchar(10) NOT NULL default '',
  outlet tinyint(1) unsigned NOT NULL default '0',
  last_power timestamp(14) NOT NULL,
  PRIMARY KEY  (node_id)
) TYPE=MyISAM;

914 915 916
--
-- Table structure for table 'partitions'
--
917 918 919 920

CREATE TABLE partitions (
  node_id varchar(10) NOT NULL default '',
  partition tinyint(4) NOT NULL default '0',
921
  osid varchar(35) default NULL,
922 923 924
  PRIMARY KEY  (node_id,partition)
) TYPE=MyISAM;

925 926 927
--
-- Table structure for table 'port_counters'
--
928 929

CREATE TABLE port_counters (
930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945
  node_id char(10) NOT NULL default '',
  card tinyint(3) unsigned NOT NULL default '0',
  port tinyint(3) unsigned NOT NULL default '0',
  ifInOctets int(10) unsigned NOT NULL default '0',
  ifInUcastPkts int(10) unsigned NOT NULL default '0',
  ifInNUcastPkts int(10) unsigned NOT NULL default '0',
  ifInDiscards int(10) unsigned NOT NULL default '0',
  ifInErrors int(10) unsigned NOT NULL default '0',
  ifInUnknownProtos int(10) unsigned NOT NULL default '0',
  ifOutOctets int(10) unsigned NOT NULL default '0',
  ifOutUcastPkts int(10) unsigned NOT NULL default '0',
  ifOutNUcastPkts int(10) unsigned NOT NULL default '0',
  ifOutDiscards int(10) unsigned NOT NULL default '0',
  ifOutErrors int(10) unsigned NOT NULL default '0',
  ifOutQLen int(10) unsigned NOT NULL default '0',
  PRIMARY KEY  (node_id,card,port)
946 947
) TYPE=MyISAM;

948 949 950
--
-- Table structure for table 'portmap'
--
951 952 953 954 955 956 957 958 959

CREATE TABLE portmap (
  pid varchar(12) NOT NULL default '',
  eid varchar(32) NOT NULL default '',
  vnode varchar(32) NOT NULL default '',
  vport tinyint(4) NOT NULL default '0',
  pport varchar(32) NOT NULL default ''
) TYPE=MyISAM;

960 961 962
--
-- Table structure for table 'proj_memb'
--
963 964 965 966 967

CREATE TABLE proj_memb (
  uid varchar(8) NOT NULL default '',
  pid varchar(12) NOT NULL default '',
  trust enum('none','user','local_root','group_root') default NULL,
968 969
  date_applied date default NULL,
  date_approved date default NULL,
970 971 972
  PRIMARY KEY  (uid,pid)
) TYPE=MyISAM;

973 974 975 976 977 978 979 980 981 982 983 984 985 986
--
-- Table structure for table 'project_stats'
--

CREATE TABLE project_stats (
  pid varchar(12) NOT NULL default '',
  exptstart_count int(11) unsigned default '0',
  exptstart_last datetime default NULL,
  exptpreload_count int(11) unsigned default '0',
  exptpreload_last datetime default NULL,
  exptswapin_count int(11) unsigned default '0',
  exptswapin_last datetime default NULL,
  exptswapout_count int(11) unsigned default '0',
  exptswapout_last datetime default NULL,
987 988
  exptswapmod_count int(11) unsigned default '0',
  exptswapmod_last datetime default NULL,
989 990 991 992 993 994 995 996
  allexpt_duration int(11) unsigned default '0',
  allexpt_vnodes int(11) unsigned default '0',
  allexpt_vnode_duration int(11) unsigned default '0',
  allexpt_pnodes int(11) unsigned default '0',
  allexpt_pnode_duration int(11) unsigned default '0',
  PRIMARY KEY  (pid)
) TYPE=MyISAM;

997 998 999
--
-- Table structure for table 'projects'
--
1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012

CREATE TABLE projects (
  pid varchar(12) NOT NULL default '',
  created datetime default NULL,
  expires date default NULL,
  name tinytext,
  URL tinytext,
  funders tinytext,
  addr tinytext,
  head_uid varchar(8) NOT NULL default '',
  num_members int(11) default '0',
  num_pcs int(11) default '0',
  num_sharks int(11) default '0',
1013 1014
  num_pcplab int(11) default '0',
  num_ron int(11) default '0',
1015 1016 1017 1018 1019
  why text,
  control_node varchar(10) default NULL,
  unix_gid smallint(5) unsigned NOT NULL auto_increment,
  approved tinyint(4) default '0',
  public tinyint(4) NOT NULL default '0',
1020 1021 1022
  public_whynot tinytext,
  expt_count mediumint(8) unsigned default '0',
  expt_last date default NULL,
1023
  pcremote_ok set('pcplab','pcron','pcwa') default NULL,
1024
  PRIMARY KEY  (pid),
1025
  KEY unix_gid (unix_gid),
Robert Ricci's avatar
Robert Ricci committed
1026 1027 1028
  KEY approved (approved),
  KEY approved_2 (approved),
  KEY pcremote_ok (pcremote_ok)
1029 1030
) TYPE=MyISAM;

1031 1032 1033
--
-- Table structure for table 'reserved'
--
1034 1035 1036 1037 1038 1039 1040

CREATE TABLE reserved (
  node_id varchar(10) NOT NULL default '',
  pid varchar(12) NOT NULL default '',
  eid varchar(32) NOT NULL default '',
  rsrv_time timestamp(14) NOT NULL,
  vname varchar(32) default NULL,