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