RedDrum-Redfish-Project / RedDrum-Simulator

A Complete Redfish API Service "Simulator" that uses the RedDrum Frontend.
MIT License
4 stars 1 forks source link

RedDrum-Simulator

A "high-fidelity" Redfish Service Simulation with https and authentication for various feature profiles and server configurations.

About RedDrum-Simulator

RedDrum-Simulator is a python app that leverages the RedDrum-Frontend and implements a full feature Simulation of a Redfish Service for various SPMF Feature profiles and and server configurations.

As a RedDrum Redfish Service implementation, the Frontend is implemented by RedDrum-Frontend.

The Simulator Backend is implemented as a package from this repo -- named reddrum_Simulator

The RedDrum-Simulator/RedDrumMain.py startup script (also in scripts dir) implements the calls to the frontend and backend to start-up the service.

Currently Supported Simulator "Profiles" or "configurations":

The initial release includes the following Configurations:

About the RedDrum Redfish Project

The RedDrum Redfish Project includes several github repos for implementing python Redfish servers.

Architecture

RedDrum Redfish Service Architecture breaks the Redfish service into three parts:

Conformance Testing

Re-running of SPMF conformance tests is currently in progress. (earlier versions of the Simulator and conformance tests passed--but did not include the Profile Conformance Test)


How to Install and run the RedDrum-Simulator

Install Centos and httpd (for https reverse proxy)

 1. Install Centos 7.1 or later linux OS
      -- a minimum install works, but you probably want the knome desktop
      -- then yum install python3.4 or python3.5

 2. Install httpd, generate ssl cert, and configure to create a reverse proxy
     yum install httpd
     cd  <your_path_to_Directory_Holding_RedDrumSimulator_code>
     git clone https://github.com RedDrum-Redfish-Project/RedDrum-Httpd-Configs    # creates ./RedDrum-Httpd-Configs
     cd RedDrum-Httpd-Configs/Apache-ReverseProxy
     ./subSystem_config.sh # creates a httpd.conf file in etc/httpd and creates self-signed ssl certificates

 3. Start httpd:
     systemctl enable httpd   # httpd will auto-start now any time the server reboots
     systemctl restart httpd  # start it up now

Manual Install of RedDrum-Frontend and RedDrum-Simulator using git clone

     # create a directory to install editable RedDRum repos
     mkdir  <your_path_to_Directory_Holding_RedDrumSimulator_code>
     cd  <your_path_to_Directory_Holding_RedDrumSimulator_code>

     # git clone the RedDrum-Frontend code and install
     git clone https://github.com/RedDrum-Redfish-Project/RedDrum-Frontend  #creates ./RedDrum-Frontend
     # install to site-packages as editable package
     pip install -e ./RedDrum-Frontend

     # git clone the RedDrum-Simulator code and install
     git clone https://github.com/RedDrum-Redfish-Project/RedDrum-Simulator  #creates ./RedDrum-Simulator
     pip install -e ./RedDrum-Simulator

Normal install pip install from github

     # create a directory to install editable RedDRum repos
     mkdir  <your_path_to_Directory_Holding_RedDrumSimulator_code>
     cd  <your_path_to_Directory_Holding_RedDrumSimulator_code>

     # pip install Frontend into site-packages
     pip install git+https://github.com/RedDrum-Redfish-Project/RedDrum-Frontend.git   # gets latest code in master

     # pip install RedDrum-Simulator into site-packages
     pip install git+https://github.com/RedDrum-Redfish-Project/RedDrum-Simulator.git  # gets latest code in master

Install using pip install from pypi (not working yet)

STARTING the RedDrum-Simulator

Starting RedDrum-Simulator --if you cloned editable RedDrum repos

     cd  <your_path_to_Directory_Holding_RedDrumSimulator_code>
     cd RedDrum-Simulator/scripts
     su root     # the simulator will try to store files in /var/www/... so it needs to run as root
     <enter password>

     # start the simulator using runSimulator script
     # ./runSimulator <profile>  where <profile>= oneOf: BaseServer1, Dss9000-4nodes
     ./runSimulator BaseServer1  # to run the Ocp Base Server Profile for a simple monalythic server
       --or--
     ./runSimulator Dss9000-4nodes  # to run the simulation of  a Dell ESS9000 rack-level redfish service w/ 4 nodes present

     # to stop the simulator, hit control-C

     # to clear data caches so that any changes you made to the resources (like users) is deleted:
     ./clearCaches

Starting RedDrum-Simulator --if you installed with pip install from github or pypi

     su root     # the simulator will try to store files in /var/www/... so it needs to run as root
     <enter password>

     # from any directory
     #redDrumSimulatorMain [--Target=<target>]  $ where <target> = oneof: BaseServer1(default) or Dss9000-4nodes
     redDrumSimulatorMain  # default is BaseServer1

     # to stop the simulator, hit control-C

     # to clear data caches so that any changes you made to the resources (like users) is deleted:
     cd /var/www
     rm -R -f rf

How to Clear Data Caches

The Simulator Frontend keeps resource data for non-volatile resource models cached in files, so if you add/delete users, change passwords, set AssetTags, etc, the changes will persist stopping and re-starting the simulator

     su root     # the simulator will try to store files in /var/www/... so it needs to run as root
     cd  <your_path_to_Directory_Holding_RedDrumSimulator_code>/RedDrum-Simulator/scripts
     ./clearCaches
     su root     
     cd /var/www