OPNFV LAB-AS-A-SERVICE This project automatically provisions, installs, configures, and provides access to OPNFV community resources. REQUIREMENTS: This will only install the LaaS software needed to control the lab you are hosting. It is expected that you already have the community servers, FOG, dhcp, dns etc etc running. A more comprehensive installer may be created in the future, but for now you need too stand up infrastructure yourself. Some specific details: - You will need to have already created all disk images FOG will use - the root user on the stackstorm machine should have ssh keys in every FOG image you plan to use - The stackstorm machine needs to be able to reach all machines it will interact with (the community resources) TO INSTALL: clone this repo in a clean ubuntu or centos machine. Stackstorm expects to be the only process running for the automated install to work. If you want something more complicated, do it yourself. This does not require much resources, and works well in a dedicated vm. run: ./install.sh to install stackstorm and the pharos laas addon. Now there are two files you must fill out for configuration to be complete. edit /opt/stackstorm/configs/pharoslaas.yaml and /opt/stackstorm/packs/pharoslaas/hosts.json according to the guide below. Once done, you can run ./setup.sh to stand up and start the stackstorm service. CONFIGURATION: hosts.json: This file contains common host configuration and will be loaded into the stackstorm datastore. It is important to understand the structure of this file. It must be valid JSON. It is a list of objects with two attribute, name and value. These objects are put directly into the datastore of stackstorm. The "name" will be the key, and the "value" is the corresponding value put in the datastore. Note that the value of each key value pair is itself valid json, encoded as a string (hence the escaped quotes). This is needed because the stackstorm exclusively stores strings. Lets look at one host entry: "name": "pod1", # This is an arbitrary name, must be in the "hosts" list "value": "{\"pharos_id\": 999, # this the resource id from the dashboard that corresponds to this host \"fog_name\": \"vm-1.1\", # this is the name FOG knows the host by \"hostname\": \"pod1\", # hostname (or ip) that resolves to this host \"ubuntu_image\": 17, # the FOG image ID for this host that has ubuntu installed \"centos_image\": 22, # the FOG image ID for this host that has centos installed \"suse_image\": 21 # the FOG image ID for this host that has open-suse installed }" The name of each host ("pod1" in this case) must be in the list of hosts found at the bottom of the file. The hosts list is what stackstorm uses to tell if you have been assigned a booking. pharoslaas.json: This is the configuration file for the pharoslaas pack. Looking at each line: fog: address: # the url of the fog server root api_key: # the api key for FOG (fog configuration -> fog settings -> api system) user_key: # the user key for FOG api (user management -> user -> api settings) vpn: server: # hostname of ldap server authentication: pass: # password for user used to control ldap server user: # dn of user directory: root: # directory that contains the user directory user: # the directory that contains all user entries user: objects: # list of object classes to add new users to - top # example STACKSTORM You can read about stackstorm here: https://docs.stackstorm.com/overview.html Stackstorm is an automation server that the LaaS project uses. We have created a "pack", which is essentially a plugin for stackstorm. When configured, this pack will automatically detect, start, and clean up bookings. The stackstorm web interface also allows you to manually run any of the defined actions or workflows. FOG You can read about FOG here: https://fogproject.org/ FOG - the Free Opensource Ghost, is the tool LaaS uses to capture and deploy disk images to hosts. This allows us to install a selected operating system in seconds, and always have a clean known state to revert to.