From 9e81366e945b81103f95d0520e73ff67f8e28910 Mon Sep 17 00:00:00 2001 From: Mike Hibler <mike@flux.utah.edu> Date: Wed, 11 May 2005 02:11:28 +0000 Subject: [PATCH] Update to reflect schema changes --- install/images/README | 71 +++++++++++++++++++------------ install/images/setup-mfsosids.sql | 9 ++-- install/images/setup-o2i.sql | 3 +- install/images/setup-osids.sql | 15 ++++--- 4 files changed, 58 insertions(+), 40 deletions(-) diff --git a/install/images/README b/install/images/README index 63a7550a3f..0c00dab872 100644 --- a/install/images/README +++ b/install/images/README @@ -1,3 +1,8 @@ +# +# EMULAB-COPYRIGHT +# Copyright (c) 2004, 2005 University of Utah and the Flux Group. +# All rights reserved. +# Instructions for creating a site-customized image from a "generic" image provided by Utah. The basic procedure is: @@ -33,6 +38,10 @@ where you can tell it to boot from the admin MFS: loader:/tftpboot/freebsd +Another option is to use this command on your boss node: + node_admin on pc1 +(Where pc1 is replaced with the name of the actual testbed pc...) + Now on with the show. @@ -78,15 +87,15 @@ We will assume the machine is called "pc1" in the following directions. from boss: sudo ssh pc1 imageunzip - /dev/$DSK \ - < /usr/testbed/images/FBSD410+RHL90-GENERIC.ndz + < /usr/testbed/images/FBSD410-RHL90-GENERIC.ndz Image loading should take anywhere from 45 seconds, to several minutes. If the ssh returns with "Killed" then imageunzip ran out of memory. By default, imageunzip will consume memory without bound for buffering - of pending disk writes. If it grow too big, the system will kill it. - In this case, retry the imageunzip with "-W <num-MB>" where <num-MB> - is a number of MB maximum to use for disk buffering. If the node you + of pending disk writes. If imageunzip grows too big, the system will + kill it. In this case, retry the imageunzip with "-W <num-MB>" where + <num-MB> is a number of MB maximum to use for disk buffering. Using about half of the available physical memory should be safe (e.g., if the machine are loading has 512MB of memory, try "-W 256"). @@ -112,7 +121,7 @@ The MFS has a much scaled-down set of binaries. To get access to a more full-featured system, you can run binaries from the disk image itself: ldconfig /mnt/usr/lib /mnt/usr/X11R6/lib /mnt/usr/local/lib - set path=($path /mnt/sbin /mnt/bin /mnt/usr/sbin /mnt/usr/bin) + set path=($path /mnt/sbin /mnt/bin /mnt/usr/sbin /mnt/usr/bin /mnt/usr/local/bin) Now update the following files: @@ -192,9 +201,13 @@ Now you can update the necessary files as follows. * /mnt2/etc/shadow - Copy in the password hash for root from the FreeBSD password file - (/mnt/etc/master.passwd) to /mnt2/etc/shadow. Then copy that file to - the emulab subdirectory: + Using your favorite editor, copy in the password hash for root from + the FreeBSD password file (/mnt/etc/master.passwd) to /mnt2/etc/shadow. + The password hash is the second colon-separated field in the "root" + password file line. Note that these two files are not the same format + just the password hash field of the file, so do NOT just copy the FreeBSD + password file to /mnt2/etc/shadow. Finally copy the newly modified file + to the emulab subdirectory: cp -p /mnt2/etc/shadow /mnt2/etc/emulab/ @@ -227,10 +240,13 @@ the time stamp that forces a periodic fsck: D. Saving the customized image The "whole disk" image is the one used most frequently, but we also - create single partition images of FreeBSD and Linux as well. + create single partition images of FreeBSD and Linux as well. Put the + images onto a test area at first, and install them permanently later + (in step G.) + From boss do: - cd /usr/testbed/images + cd /proj/emulab-ops/images sudo ssh pc1 imagezip /dev/$DSK - > FBSD410+RHL90-STD.ndz sudo ssh pc1 imagezip -s 1 /dev/$DSK - > FBSD410-STD.ndz sudo ssh pc1 imagezip -s 2 /dev/$DSK - > RHL90-STD.ndz @@ -296,25 +312,24 @@ G. Installing the images mv /proj/emulab-ops/images/*.ndz /usr/testbed/images/ - and record these initial images in the Emulab database using the - SQL INSERT commands in setup-images.sql and setup-osids.sql. - As the database schema occasionally changes, it is important to - ensure that your DB matches the INSERT commands before doing them. - The table formats are listed at the beginning of those files. + and record these initial images in the Emulab database. + + The image tarball includes sample SQL INSERT commands in the + setup-images.sql, setup-osids.sql and setup-o2i.sql files to make this + easier. Note however, that the database schema occasionally changes, + so it is important to ensure that your DB matches the INSERT commands in + those files before doing them. The table formats for the file commands + are listed at the beginning of the files. Compare those formats to the + current schema in your database by doing: - You also need to create mappings from the OSIDs to the imageids - for every node type that supports booting these OSes (e.g., PCs - but not switches). You can either modify setup-o2i.sql in this - directory, modifying it as appropriate for your node_types or - you can use the web interface. + mysql tbdb + describe images; + describe osids; + describe osidtoimageid; - To use the web, login as the admin user and click the green dot - next to the "My Emulab.net" header. The dot should change to - red and you will be in admin mode. On the left menu bar there - should be a line "List ImageIDs or OSIDs". Click on the ImageIDs. - For both "RHL90-STD" and "FBSD410-STD", click on their names and - then choose "Edit this Image Descriptor" from the menu. Now - select the appropriate boxes in the "Node Types" line. + setup-o2i.sql is just a template and will have to be modified to use. + Tweak the other .sql files as necessary for schema changes, and apply + the commands. Dealing with SCSI disks (or RAID). @@ -354,4 +369,4 @@ Dealing with SCSI disks (or RAID). If you don't have a Linux machine to do this with, contact us. [ This file is a copy of doc/customize-image.txt in the Emulab source tree. ] -[ Last updated 11/11/04 ] +[ Last updated 05/10/05 ] diff --git a/install/images/setup-mfsosids.sql b/install/images/setup-mfsosids.sql index 42b3490761..48135e61eb 100644 --- a/install/images/setup-mfsosids.sql +++ b/install/images/setup-mfsosids.sql @@ -15,7 +15,7 @@ CREATE TABLE os_info ( creator varchar(8) default NULL, created datetime default NULL, description tinytext NOT NULL, - OS enum('Unknown','Linux','FreeBSD','NetBSD','OSKit','Other') NOT NULL default 'Unknown', + OS enum('Unknown','Linux','FreeBSD','NetBSD','OSKit','Windows','TinyOS','Other') default 'Unknown', version varchar(12) default '', path tinytext, magic tinytext, @@ -28,6 +28,7 @@ CREATE TABLE os_info ( nextosid varchar(35) default NULL, max_concurrent int(11) default NULL, mfs tinyint(4) NOT NULL default '0', + reboot_waittime int(10) unsigned default NULL, PRIMARY KEY (osname,pid), KEY osid (osid), KEY OS (OS), @@ -40,6 +41,6 @@ CREATE TABLE os_info ( -- WHERE: osid like "%MFS%" -INSERT INTO os_info VALUES ('FREEBSD-MFS','emulab-ops','FREEBSD-MFS','root',NULL,'FreeBSD in an MFS','FreeBSD','4.10','boss:/tftpboot/freebsd',NULL,'','ping,ssh,ipod,isup',0,1,0,'PXEFBSD',NULL,NULL,1); -INSERT INTO os_info VALUES ('FRISBEE-MFS','emulab-ops','FRISBEE-MFS','root',NULL,'Frisbee (FreeBSD) in an MFS','FreeBSD','4.10','boss:/tftpboot/frisbee',NULL,'','ping,ssh,ipod,isup',0,1,0,'RELOAD',NULL,NULL,1); -INSERT INTO os_info VALUES ('NEWNODE-MFS','emulab-ops','NEWNODE-MFS','root',NULL,'NewNode (FreeBSD) in an MFS','FreeBSD','4.10','boss:/tftpboot/freebsd.newnode',NULL,'','ping,ssh,ipod,isup',0,1,0,'PXEFBSD',NULL,NULL,1); +INSERT INTO os_info VALUES ('FREEBSD-MFS','emulab-ops','FREEBSD-MFS','root',NULL,'FreeBSD in an MFS','FreeBSD','4.10','boss:/tftpboot/freebsd',NULL,'','ping,ssh,ipod,isup',0,1,0,'PXEFBSD',NULL,NULL,1,150); +INSERT INTO os_info VALUES ('FRISBEE-MFS','emulab-ops','FRISBEE-MFS','root',NULL,'Frisbee (FreeBSD) in an MFS','FreeBSD','4.10','boss:/tftpboot/frisbee',NULL,'','ping,ssh,ipod,isup',0,1,0,'RELOAD',NULL,NULL,1,150); +INSERT INTO os_info VALUES ('NEWNODE-MFS','emulab-ops','NEWNODE-MFS','root',NULL,'NewNode (FreeBSD) in an MFS','FreeBSD','4.10','boss:/tftpboot/freebsd.newnode',NULL,'','ping,ssh,ipod,isup',0,1,0,'PXEFBSD',NULL,NULL,1,150); diff --git a/install/images/setup-o2i.sql b/install/images/setup-o2i.sql index 0d4c6acf13..c49e1ee033 100644 --- a/install/images/setup-o2i.sql +++ b/install/images/setup-o2i.sql @@ -22,7 +22,8 @@ CREATE TABLE osidtoimageid ( -- -- Change PCTYPE to an actual node_type in your database (e.g., "pc2800"). --- You will need a set of these lines for every node_type that can run BSD or Linux. +-- You will need a set of these lines for every node_type that can run +-- BSD or Linux. -- INSERT INTO osidtoimageid VALUES ('emulab-ops-FBSD410-STD','PCTYPE','emulab-ops-FBSD410-STD'); INSERT INTO osidtoimageid VALUES ('emulab-ops-RHL90-STD','PCTYPE','emulab-ops-RHL90-STD'); diff --git a/install/images/setup-osids.sql b/install/images/setup-osids.sql index 87406a7ca9..3bba5de23d 100644 --- a/install/images/setup-osids.sql +++ b/install/images/setup-osids.sql @@ -15,7 +15,7 @@ CREATE TABLE os_info ( creator varchar(8) default NULL, created datetime default NULL, description tinytext NOT NULL, - OS enum('Unknown','Linux','FreeBSD','NetBSD','OSKit','Other') NOT NULL default 'Unknown', + OS enum('Unknown','Linux','FreeBSD','NetBSD','OSKit','Windows','TinyOS','Other') default 'Unknown', version varchar(12) default '', path tinytext, magic tinytext, @@ -28,6 +28,7 @@ CREATE TABLE os_info ( nextosid varchar(35) default NULL, max_concurrent int(11) default NULL, mfs tinyint(4) NOT NULL default '0', + reboot_waittime int(10) unsigned default NULL, PRIMARY KEY (osname,pid), KEY osid (osid), KEY OS (OS), @@ -37,12 +38,12 @@ CREATE TABLE os_info ( -- -- Dumping data for table `os_info` -- --- WHERE: osid like '%-STD%' +-- WHERE: osid like '%-STD%' or osid like '%-JAIL%' -INSERT INTO os_info VALUES ('RHL-STD','emulab-ops','emulab-ops-RHL-STD','root',NULL,'Default version of RedHat Linux','Linux','',NULL,'','','ping,ssh,ipod,isup',0,1,1,'NORMALv1','emulab-ops-RHL90-STD',NULL,0); -INSERT INTO os_info VALUES ('FBSD-STD','emulab-ops','emulab-ops-FBSD-STD','root',NULL,'Default version of FreeBSD','FreeBSD','',NULL,'','','ping,ssh,ipod,isup',0,1,1,'NORMALv1','emulab-ops-FBSD410-STD',NULL,0); -INSERT INTO os_info VALUES ('FBSD-JAIL','emulab-ops','emulab-ops-FBSD-JAIL','root',NULL,'Generic OSID for jailed nodes','FreeBSD','',NULL,'','','ping,ssh,isup',0,1,0,'PCVM','emulab-ops-FBSD-STD',NULL,0); -INSERT INTO os_info VALUES ('FBSD410-STD','emulab-ops','emulab-ops-FBSD410-STD','root','2004-11-09 00:00:00','Testbed version of FreeBSD 4.10','FreeBSD','4.10',NULL,'','','ping,ssh,ipod,isup',0,1,1,'NORMALv1',NULL,NULL,0); -INSERT INTO os_info VALUES ('RHL90-STD','emulab-ops','emulab-ops-RHL90-STD','root','2004-11-09 00:00:00','Testbed Version of RedHat Linux 9.0','Linux','9.0',NULL,'','','ping,ssh,ipod,isup',0,1,1,'NORMALv1',NULL,NULL,0); +INSERT INTO os_info VALUES ('RHL-STD','emulab-ops','emulab-ops-RHL-STD','root',NULL,'Default version of RedHat Linux','Linux','',NULL,'','','ping,ssh,ipod,isup',0,1,1,'NORMALv2','emulab-ops-RHL90-STD',NULL,0,150); +INSERT INTO os_info VALUES ('FBSD-STD','emulab-ops','emulab-ops-FBSD-STD','root',NULL,'Default version of FreeBSD','FreeBSD','',NULL,'','','ping,ssh,ipod,isup,veths',0,1,1,'NORMALv2','emulab-ops-FBSD410-STD',NULL,0,150); +INSERT INTO os_info VALUES ('FBSD-JAIL','emulab-ops','emulab-ops-FBSD-JAIL','root',NULL,'Generic OSID for jailed nodes','FreeBSD','',NULL,'','','ping,ssh,isup',0,1,0,'PCVM','emulab-ops-FBSD-STD',NULL,0,150); +INSERT INTO os_info VALUES ('FBSD410-STD','emulab-ops','emulab-ops-FBSD410-STD','root','2004-11-09 00:00:00','Testbed version of FreeBSD 4.10','FreeBSD','4.10',NULL,'','','ping,ssh,ipod,isup,veths',0,1,1,'NORMALv2',NULL,NULL,0,150); +INSERT INTO os_info VALUES ('RHL90-STD','emulab-ops','emulab-ops-RHL90-STD','root','2004-11-09 00:00:00','Testbed version of RedHat Linux 9.0','Linux','9.0',NULL,'','','ping,ssh,ipod,isup',0,1,1,'NORMALv2',NULL,NULL,0,150); -- GitLab