rename configuration variables like from GENI_ to SFA_
[sfa.git] / INSTALL.txt
1 This installation note assumes that you have installed and configured MyPLC in the usual manner, and you have set up your yum repo like for a MyPLC install.
2 -----
3 1) Install the SFA packages:
4
5 # yum install sfa-plc sfa-client
6
7 Note that the above command installs both sfa server (sfa-plc) and sfa client packages along with necessary dependency packages. Depending on the requirements, you may choose 
8 to install the appropriate one (server, client or both) for you. For e.g. to set up your own SFA server on top of your MyPLC, you need sfa-plc. On the other hand, if you plan to use an existing SFA server, you would typically need the sfa-client only.
9 -------
10 2) Note down the PLC_ROOT_USER and PLC_ROOT_PASSWORD of your MyPLC installation:
11
12 # plc-config-tty 
13 Enter command (u for usual changes, w to save, ? for help) s PLC_ROOT_USER
14 PLC_ROOT_USER = root@test.onelab.eu
15 Enter command (u for usual changes, w to save, ? for help) s PLC_ROOT_PASSWORD
16 PLC_ROOT_PASSWORD = test++
17
18 These two configuration parameters are required for SFA server configuration
19 -------
20 3) Configure and start SFA servers: 
21
22 (a) # sfa-config-tty
23
24  set SFA_PLC_USER       to     PLC_ROOT_USER 
25  set SFA_PLC_PASSWORD   to     PLC_ROOT_PASSWORD
26 write and quit
27
28 *NOTE* at this point you get a warning b/c the authorities hierarchy has not been created yet; ignore
29
30 (b) # sfa-import-plc.py 
31
32 (o/p will look like this)
33 Import: creating top level authorities
34 Hierarchy: creating authority: plc
35 plc : 
36 Import: creating table for authority plc
37 NOTICE:  table "geni$plc" does not exist, skipping
38   inserting authority record for plc
39 Import: adding plc to trusted list
40 Import_Site: importing site plc.internet2
41 Hierarchy: creating authority: plc.internet2
42   inserting authority record for plc.internet2
43 Import_Site: importing site plc.pl
44 Hierarchy: creating authority: plc.pl
45   inserting authority record for plc.pl
46 Import: importing person plc.pl.root
47 Import: creating table for authority plc.pl
48 NOTICE:  table "geni$plc$pl" does not exist, skipping
49
50 (c) # cp /etc/sfa/authorities/plc/plc.pkey /usr/lib/python2.5/site-packages/sfa/server.key
51
52 (d) # service sfa start
53
54 This will start Registry, Slice Manager and Aggregate Manager. Your ps command output would like:
55
56 # ps -ef | grep python
57 root     24944     1  0 May11 ?        00:00:00 /usr/bin/python /usr/bin/sfa-server.py -r -d
58 root     24957     1  0 May11 ?        00:00:00 /usr/bin/python /usr/bin/sfa-server.py -a -d
59 root     24970     1  0 May11 ?        00:00:00 /usr/bin/python /usr/bin/sfa-server.py -s -d
60 -------
61 4) Configure SFA client:
62
63  (a) # mkdir ~/.sfi 
64  (b)copy your private key to ~/.sfi/username.pkey Replace username with your actual account name 
65  (c) # cp  /etc/sfa/sfi_config ~/.sfi/
66  (d) edit ~/.sfi/sfi_config. A sample configuration looks like:
67
68         export SFI_AUTH=plc.pl
69         export SFI_USER=plc.pl.root
70         export SFI_REGISTRY=http://vplc25.inria.fr:12345/
71         export SFI_SM=http://vplc25.inria.fr:12347/ 
72
73  (e) # source ~/.sfi/sfi_config 
74 ------
75 5) Testing:
76
77 At this stage you should be able to run sfi command. Some sample outputs are:
78
79  (a) # sfi.py list plc.pl
80      plc.pl.netflow (slice)
81      plc.pl.sirius (slice)
82      plc.pl.root (user)
83      plc.pl.pif (node)
84
85  (b) # sfi.py show plc.pl.pif
86      gid:
87           hrn: plc.pl.pif
88          uuid: 99878316891261700702442883738232624912
89      hrn: plc.pl.pif
90      type: node
91      node_type: regular
92      hostname: pif.inria.fr
93  
94  (c) # sfi.py show plc.pl.root
95        gid:
96           hrn: plc.pl.root
97          uuid: 67306954103472941609600457537601239401
98      hrn: plc.pl.root
99      type: user
100      last_name: Administrator
101      phone: None
102      key: plc.pl.root#user
103      first_name: Default
104      email: root@vplc25.inria.fr
105
106  (d) # sfi.py slices
107      plc.pl.netflow
108      plc.pl.sirius
109
110  (e) # sfi.py resources
111 <?xml version="1.0" ?>
112 <Rspec duration="3600" start_time="1246736949"><networks><NetSpec duration="3600" name="plc" start_time="1246736950"><nodes><NodeSpec cpu_min="" cpu_pct="" cpu_share="" disk_max="" duration="" init_params="" name="pif.inria.fr" start_time="" type=""><net_if><IfSpec addr="138.96.250.224" init_params="" ip_spoof="" max_kbyte="" max_rate="" min_rate="" name="True" type="ipv4"/></net_if></NodeSpec></nodes></NetSpec></networks></Rspec>
113 ------
114
115 6) Federation configuration:
116
117 (a) Follow the same procedure to install and configure second MyPLC with SFA server.
118 (b) On each PLC, edit the /etc/sfa/registries.xml file
119
120     set addr to ip or hostname of federated (remote) peer
121     set port to geni service port on federated (remote) peer
122     set hrn to human readable name of federated (remote) peer interface
123 Sample configuration:
124
125 <registries>
126         <registry addr="vplc26.inria.fr" hrn="ple" port="12345"/>
127 </registries>
128
129 (c) Likewise, edit the /etc/sfa/aggregates.xml
130 Sampel configuration
131
132 <aggregates>
133         <aggregate addr="vplc26.inria.fr" hrn="ple" port="12346"/>
134 </aggregates>
135
136 (d) trade trusted root gid's (seen on /etc/sfa/trusted_roots)
137 we have to copy the gid of first SFA server to the /etc/sfa/trusted_roots directory of second one and vice-versa. 
138