Adds workflows to deploy and clean hosts
[pharos-tools.git] / laas-fog / README
1 OPNFV LAB-AS-A-SERVICE
2
3 This project automatically provisions, installs, configures, and provides
4 access to OPNFV community resources.
5
6 REQUIREMENTS:
7     This will only install the LaaS software needed to control the lab you are hosting.
8 It is expected that you already have the community servers, FOG, dhcp, dns etc etc running.
9 A more comprehensive installer may be created in the future, but for now you need too
10 stand up infrastructure yourself. Some specific details:
11  - You will need to have already created all disk images FOG will use
12  - the root user on the stackstorm machine should have ssh keys in every FOG image you plan to use
13  - The stackstorm machine needs to be able to reach all machines it will interact with (the community resources)
14
15 TO INSTALL:
16     clone this repo in a clean ubuntu or centos machine. Stackstorm expects to be the
17 only process running for the automated install to work. If you want something more complicated,
18 do it yourself. This does not require much resources, and works well in a dedicated vm.
19     
20     run:
21         ./install.sh
22     to install stackstorm and the pharos laas addon.
23     
24 Now there are two files you must fill out for configuration to be complete.
25     edit /opt/stackstorm/configs/pharoslaas.yaml and /opt/stackstorm/packs/pharoslaas/hosts.json
26 according to the guide below. Once done, you can run
27     ./setup.sh
28 to stand up and start the stackstorm service.
29
30 CONFIGURATION:
31     hosts.json:
32         This file contains common host configuration and will be loaded into the stackstorm datastore.
33     It is important to understand the structure of this file. It must be valid JSON. It is a list of objects
34     with two attribute, name and value. These objects are put directly into the datastore of stackstorm.
35     The "name" will be the key, and the "value" is the corresponding value put in the datastore. Note that
36     the value of each key value pair is itself valid json, encoded as a string (hence the escaped quotes).
37     This is needed because the stackstorm exclusively stores strings.
38         Lets look at one host entry:
39             "name": "pod1", # This is an arbitrary name, must be in the "hosts" list
40             "value": "{\"pharos_id\": 999,  # this the resource id from the dashboard that corresponds to this host
41                 \"fog_name\": \"vm-1.1\",   # this is the name FOG knows the host by
42                 \"hostname\": \"pod1\",     # hostname (or ip) that resolves to this host
43                 \"ubuntu_image\": 17,       # the FOG image ID for this host that has ubuntu installed
44                 \"centos_image\": 22,       # the FOG image ID for this host that has centos installed
45                 \"suse_image\": 21          # the FOG image ID for this host that has open-suse installed
46                 }"
47         The name of each host ("pod1" in this case) must be in the list of hosts found at the bottom of the file.
48         The hosts list is what stackstorm uses to tell if you have been assigned a booking.
49
50     pharoslaas.json:
51         This is the configuration file for the pharoslaas pack. Looking at each line:
52             fog:
53                 address:    # the url of the fog server root
54                 api_key:    # the api key for FOG (fog configuration -> fog settings -> api system)
55                 user_key:   # the user key for FOG api (user management -> user -> api settings)
56             vpn:
57                 server:     # hostname of ldap server
58                 authentication:
59                     pass:   # password for user used to control ldap server
60                     user:   # dn of user
61                 directory:
62                     root:   # directory that contains the user directory
63                     user:   # the directory that contains all user entries
64                 user:
65                     objects:    # list of object classes to add new users to
66                         - top   # example
67
68 STACKSTORM
69     You can read about stackstorm here: https://docs.stackstorm.com/overview.html
70     Stackstorm is an automation server that the LaaS project uses. We have created
71 a "pack", which is essentially a plugin for stackstorm. When configured, this pack
72 will automatically detect, start, and clean up bookings. The stackstorm web interface
73 also allows you to manually run any of the defined actions or workflows.
74
75 FOG
76     You can read about FOG here: https://fogproject.org/
77     FOG - the Free Opensource Ghost, is the tool LaaS uses to capture and deploy disk images to hosts.
78 This allows us to install a selected operating system in seconds, and always have a clean known state to
79 revert to.