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