Changes between Initial Version and Version 1 of Installation/DatabaseSetup


Ignore:
Timestamp:
Jul 25, 2011 7:03:05 AM (13 years ago)
Author:
jhickey
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Installation/DatabaseSetup

    v1 v1  
     1= Adding information about your switch, power controller, and serial lines to the database =
     2
     3== Setting up your Switch ==
     4
     5=== Creating switch node and interface types ===
     6
     7In order to add our switch to the database, we need to setup node and interface types for them.
     8
     9We provide some SQL to make this easy.  The script switch-types-create defines the following:
     10
     11 * Node types for hp5412 (which included hp5406), hp2810, and nortel5510 switch types.
     12 * Interfaces for generic inter-switch trunks (if your site has more than one switch) named "trunk_100MbE", "trunk_1GbE", and "trunk_10GbE".
     13
     14For other switch types, please refer to the [https://users.emulab.net/trac/emulab/wiki/install/switches-db.html Emulab Documentation].
     15
     16These are now loaded by the boss-install script, but if you need to load them by hand:
     17
     18{{{
     19mysql tbdb < ~<builduser>/testbed/sql/interface-types-create.sql
     20mysql tbdb < ~<builduser>/testbed/sql/switch-types-create.sql
     21}}}
     22
     23=== Adding your switch to DNS ===
     24
     25Your switch needs a name that resolves.  You must add it either to /etc/hosts or to the name server running on boss.
     26
     27To add it to the name server, add it into /etc/namedb/<yoursitename>.internal.db.head. 
     28You then refresh the DNS server by running /usr/testbed/sbin/named_setup. 
     29
     30For example, on mini-isi.deterlab.net we have our switch that we will name hp1 at 192.168.254.1 on the HARDWARE_CONTROL network.  So we add it to DNS as follows:
     31
     32{{{
     33[jhickey@boss ~]$ sudo su -
     34boss# echo "hp1    IN A 192.168.254.1" >> /etc/namedb/mini-isi.deterlab.net.internal.db.head
     35boss# logout
     36[jhickey@boss ~]$ /usr/testbed/sbin/named_setup
     37[jhickey@boss ~]$ ping -c 1 hp1
     38PING hp1.mini-isi.deterlab.net (192.168.254.1): 56 data bytes
     3964 bytes from 192.168.254.1: icmp_seq=0 ttl=63 time=3.496 ms
     40
     41--- hp1.mini-isi.deterlab.net ping statistics ---
     421 packets transmitted, 1 packets received, 0.0% packet loss
     43round-trip min/avg/max/stddev = 3.496/3.496/3.496/0.000 ms
     44[jhickey@boss ~]$
     45}}}
     46
     47
     48=== Adding in your switches to the database ===
     49
     50Using the hostname you have given your switch, insert a line in the the nodes table in the database.  If you are adding a dedicated control network switch, use '''ctrlswitch''' as the role.  Otherwise, the role is '''testswitch'''.
     51
     52{{{
     53insert into nodes set node_id='hp1',phys_nodeid='hp1',type='hp2180',role='testswitch';
     54}}}
     55
     56=== Switch Interconnects ===
     57
     58If your installation has more than one switch, we need to tell the database about it so that vlan trunking can be enabled and so that it doesn't try to oversubscribe the link.  We created interface types earlier in this document.  Let's say we have hp1 and hp2 which are connected by a single 1GbE link.  hp2 module A, port 5 is connected to hp1 module B, port 23.  We need to add two lines to the interfaces table (note that current_speed is in Mbits now):
     59
     60{{{
     61insert into interfaces set
     62          node_id='hp1',card=2,port=23,mac='000000000000',iface='B/23',role='other',
     63          current_speed='1000',interface_type='trunk_1GbE',uuid=UUID();
     64insert into interfaces set
     65          node_id='hp2',card=1,port=5,mac='000000000000',iface='A/5',role='other',
     66          current_speed='1000',interface_type='trunk_1GbE',uuid=UUID();
     67}}}
     68
     69We also need to add an entry to the wires table for these two switches:
     70
     71{{{
     72insert into wires set
     73          node_id1='hp1',card1=2,port1=23,
     74          node_id2='hp2',card2=1,port2=5,
     75          type='Trunk';
     76}}}
     77
     78'''Note:''' For switches that are not modular, set card to 1.  For Ethernet interfaces, card starts at (and typically is) 0.
     79
     80=== Setting up Switch Stacks ===
     81
     82The idea of switch stacks comes from sites that run separate control and experimental networks.  In this scenario, it does not make sense to create experimental vlans on switches that function only as control network switches and vice versa.  The typical DETER deployment scenario will be a switch that handles both.  In this case, we add the same switch to the two different stacks ('Experiment' and 'Control' which we also have to setup in switch_stack_types).  We also make sure that is_primary is set to 1 for the Experimental stack line and 0 for the Control stack line (I assume so that we only try creating vlans once per switch).
     83
     84First, create our switch_stack_types.  For our mini-isi setup, we have the two types:
     85
     86{{{
     87insert into switch_stack_types (stack_id, stack_type, snmp_community, leader) values ('Control', 'generic', 'private', 'hp1');
     88insert into switch_stack_types (stack_id, stack_type, snmp_community, leader) values ('Experiment', 'generic', 'private', 'hp1');
     89}}}
     90
     91So in our mini-isi example, we need to add in two entries for our switch hp1:
     92
     93{{{
     94insert into switch_stacks (node_id,stack_id,is_primary)
     95values
     96('hp1','Experiment',1),
     97('hp1','Control',0);
     98}}}
     99
     100=== Testing your switch stack ===
     101
     102On boss, run '''wap snmpit -l -l''' to list all vlans.  For example, your output should look something like this (right now there might be some MIB warnings):
     103
     104{{{
     105
     106[jhickey@boss ~]$ wap snmpit -l -l
     107VLAN     Project/Experiment VName     Members
     108--------------------------------------------------------------------------------
     109CONTROLH                    CONTROLHW hp1.1/3 hp1.1/4 hp1.1/5
     110CONTROL                     CONTROL   hp1.1/3 hp1.1/6 hp1.1/7 hp1.1/8 hp1.1/9
     111                                      hp1.1/10 hp1.1/11 hp1.1/12
     112INTERNET                    INTERNET  hp1.1/1 hp1.1/2 hp1.1/3
     113BOSS                        BOSS      hp1.1/3
     114[jhickey@boss ~]$
     115}}}
     116
     117
     118== Setting up your power controller ==
     119
     120=== Adding the power controller to DNS ===
     121
     122This is pretty much the same as with the switch above.  Technically, you can get away without this step since the IP address will also be in the database, but it is good housekeeping.
     123
     124For example, on mini-isi.deterlab.net we have our switch that we will name apc23 at 192.168.254.23 on the HARDWARE_CONTROL network.  So we add it to DNS as follows:
     125
     126{{{
     127[jhickey@boss ~]$ sudo su -
     128boss# echo "apc23    IN A 192.168.254.23" >> /etc/namedb/mini-isi.deterlab.net.internal.db.head
     129boss# logout
     130[jhickey@boss ~]$ /usr/testbed/sbin/named_setup
     131[jhickey@boss ~]$ ping -c 1 apc23
     132PING apc23.mini-isi.deterlab.net (192.168.254.23): 56 data bytes
     13364 bytes from 192.168.254.23: icmp_seq=0 ttl=254 time=3.476 ms
     134
     135--- apc23.mini-isi.deterlab.net ping statistics ---
     1361 packets transmitted, 1 packets received, 0.0% packet loss
     137round-trip min/avg/max/stddev = 3.476/3.476/3.476/0.000 ms
     138}}}
     139
     140=== Adding the power controller to the database ===
     141
     142We assume you are using an APC 7902 networked power controller.  The default node_type for this is 'APC'.
     143
     144Now add in a node entry for the power controller.  For mini-isi, our power controller is named apc23:
     145
     146{{{
     147insert into nodes set node_id='apc23', phys_nodeid='apc23', type='APC', role='powerctrl';
     148}}}
     149
     150Now add a line to the interfaces table.  For mini-isi, the power controller is at 192.168.254.23:
     151
     152{{{
     153insert into interfaces set node_id='apc23',
     154                           IP='192.168.254.23', mask='255.255.255.0',
     155                           interface_type='fxp', iface='eth0', role='other';
     156}}}
     157
     158Now, finally we need a wires table entry:
     159
     160{{{
     161insert into wires set node_id1='apc23', card1=0, port1=1,
     162                      node_id2='hp1', card2=1, port2=4,
     163                      type='Control';
     164}}}
     165
     166=== Telling the database about the power controller ports ===
     167
     168This is jumping the gun since we have not gotten to the point of adding PC type nodes to the testbed yet, but when we do, they will go in the '''outlets''' table.
     169
     170{{{
     171mysql> describe outlets;
     172+------------+---------------------+------+-----+-------------------+-------+
     173| Field      | Type                | Null | Key | Default           | Extra |
     174+------------+---------------------+------+-----+-------------------+-------+
     175| node_id    | varchar(32)         | NO   | PRI |                   |       |
     176| power_id   | varchar(32)         | NO   |     |                   |       |
     177| outlet     | tinyint(1) unsigned | NO   |     | 0                 |       |
     178| last_power | timestamp           | NO   |     | CURRENT_TIMESTAMP |       |
     179+------------+---------------------+------+-----+-------------------+-------+
     1804 rows in set (0.00 sec)
     181}}}
     182
     183So to add, say pc001 which is on apc23 port 1, we would do:
     184
     185{{{
     186insert into outlets set node_id='pc001', power_id='apc23', outlet=1;
     187}}}
     188
     189You can add in a dummy entry and test if you like.
     190
     191== Setting up your serial server ==
     192
     193TBD.  We hope to have a VMWare image with the necessary software for DigiEtherlite devices soon.