@@ -35,10 +35,11 @@ Next start the virtual machine:
2. The username, and password are both: mocci
## Step-by-step example scenarios
To test MOCCI, we provide step-by-step instructions for two example scenarios.
To get the ropes of MOCCI, we provide step-by-step instructions for three example scenarios, which are based on the same initial deployment model.
1.[Vertical Scaling](doc/vertical.md): This scenario scales a VM up and down according to its CPU utilization.
2.[Horizontal Scaling](doc/horizontal.md): This scenario dynamically adds and releases worker nodes in a hadoop cluster.
1. [Initial Deployment] (doc/intial.md): This tutorial demonstrates how to deploy an initial cloud application getting monitored by MOCCI.
1.[Vertical Scaling](doc/vertical.md): This scenario scales a VM in the initial deployment up and down according to its CPU utilization.
2.[Horizontal Scaling](doc/horizontal.md): This scenario dynamically adds and releases worker nodes in the hadoop cluster of the initial deployment.
3.[Sensor Creation](doc/own.md): This scenario shows how to add sensors to an OCCI model.
*Note:* Please note that the execution of the example scenarios in an distributed environment, e.g., requires access to it as well as connectors implementing how the differen requests should be handled.
In this scenario a hadoop cluster with one worker node getting monitored is deployed.
This deployment serves as entry point for the other provided scenarios: [Vertical Scaling](./vertical.md), [Horizontal Scaling](./horizontal.md), and [Sensor Creation](./own.md).
## Starting the MartServer
To execute the scenario a MartServer has to be started including these [plugins](../src/test/resources/martserver-plugins).
If the getting started VM is used everything is preconfigured only requiring to start the following script.
Start a terminal and navigate to the desktop. The script can be started using the following command:
```
./startMART.sh
```
*Note:* If this scenario is not performed in a running cloud environment consider executing the resetMart.sh script first.
## Deploying the Cluster
Now the hadoop cluster can be deployed. Therefore, start the InitialDeployment.java file as an Java Application. This application performs requests to deploy the model shown below.
If the VM is used: Open a terminal and navigate to the VM's desktop and execute the initialDeployment.jar.
```
java -jar initialDeployment.jar
```
After the deployment has been performed. The console running the MartServer puts out the simulated monitoring data in the following form:
```
INFO MonProp: CPU, set to: High(ba16f4ee-1601-4192-a259-eae4274aed72)
```
Moreover, you can investigate the deployed OCCI model by opening your browser and query for OCCI entitites:
```
http://localhost:8080/compute
http://localhost:8080/sensor
http://localhost:8080/monitorableproperty
```
The following figure visualized the initially deployed model:
In this scenario the hadoop cluster model gets enhanced to monitor Memory utilization in addition to CPU utilization of worker nodes.
## Enhancing the Model for Simulation Purposes
The following description shows how to adapt the initial deployment ot also monitor memory utilization of the hadoop worker node:
The following description shows how to adapt the initial deployment using an editor within OCCIWare Studio:
1. Start OCCIWare-Studio.
1. Start OCCIWareStudio.
2. Create a new Sirius Modeling Project
3. Copy the src/main/resources/hadoopClusterCPU.occic file from the MOCCI project into the new project
4. Open the file with the OCCI Model Editor
5. Expand the first item, as well as the Configuration it contains
6. Right click on Configuration->New Child->Resource
1. Set the kind of the new resource to Sensor
2. Right click on the Sensor to add a new link
1. Set the kind of the link to monitorableproperty
2. Set the target of the link to the compute node it should monitor
3. Add a new Attribute to the monitorableproperty link
1. Name it monitoring.property with value Mem
7. Create a ResultProvider in the same way
8. Create a ComponentLink linking the Sensor to the ResultProvider
9. Save the model
Even though the model currently does not consist of all monitoring instruments, and placementlinks, required for an actual deployment, it is sufficient to execute first tests. To test the enhanced model follow the enumerated instructions:
1. Set the kind of the new resource to Sensor
2. Right click on the Sensor to add a new link
1. Set the kind of the link to monitorableproperty
2. Set the target of the link to the compute node it should monitor
3. Add a new Attribute to the monitorableproperty link
1. Name it monitoring.property with value Mem
7. Create a ResultProvider and a DataGatherer in the same way
8. Create a ComponentLink linking the Sensor to the ResultProvider and DataGatherer
9. Save your changed
Even though the model currently does not consist of all monitoring instruments, and placementlinks, which are required for an actual deployment, it is sufficient to execute first tests. To test the enhanced model follow the enumerated instructions:
To start the script execute the vertical.sh script.
In the VM it is located on the desktop, otherwise you can find it [here](https://gitlab.gwdg.de/rwm/de.ugoe.cs.rwm.mocci/blob/master/src/main/resources/vertical.sh).