Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision

Target

Select target project
  • lennart.thiesen/de.ugoe.cs.rwm.mocci
  • rwm/de.ugoe.cs.rwm.mocci
2 results
Select Git revision
Show changes
Showing
with 1645 additions and 19 deletions
doc/adjustedTree.jpg

128 KiB

# Setting up the MartServer
The MART Server implements the OCCI API used to orchestrate the Cloud deployments.
This is major component serving as entry point for our application.
In the following a description of how a Docker container for the MART Server can be created, stored, loaded, and started.
## Creating a Docker Container
In order to provide an easy use of the MART Server, a docker container embedding the server and all required plugins is provided.
However, to use specialized plugins currently the docker image has to be recreated. Thus, a brief explanation of the single steps are given in the following:
1. Install [docker](https://docs.docker.com/install/)
2. Clone the [MOCCI repository](https://gitlab.gwdg.de/rwm/de.ugoe.cs.rwm.mocci)
3. Optional: Add martserver-plugins and roles to be used by the server. Adjust the authorized_keys file for ssh access.
4. Navigate to src/test/resources/
5. Create docker image: sudo docker build -t mart-server .
6. Test the docker image: sudo docker run -p 8080:8080 -p 22:22 mart-server
7. Store the docker image: sudo docker save mart-server $>$ mart-server.tar
8. To access the container you can use an ssh connection: ssh -i \$key root@localhost
To build this container a fatjar of the MartServer is used. To use newer versions please refer to the [documentation of the MartServer](https://github.com/occiware/MartServer/blob/master/doc/server.md) in how to create a docker container.
## Loading a Docker Container
To initialize the proposed OCCI extensions, the following plugins need to be added to the OCCI-Studio.
These allow to correctly depict OCCI models in the textual and graphical editor. To Install plugins the following steps have
to be performed:
1. Download/Navigate to the archive containing the docker image
2. Load the docker image: docker load $<$ mart-server.tar
3. Start the image: sudo docker run -p 8080:8080 -p 22:22 mart-server
4. Start with bash: sudo docker run -p 8080:8080 -p 22:22 -i -t mart-server /bin/bash
5. To access the container you can use an ssh connection: ssh -i \$key root@localhost
## Configuring the MartServer to be used in OpenStack
[Documentation on how to setup and configure the MartServer for an OpenStack Cloud](doc/openstack.md)
\ No newline at end of file
doc/browser.png

1.88 MiB

# Horizontal Scaling Scenario
Prerequisite for this scenario is the [initial deployment](./initial.md) of the hadoop cluster.
In this scenario a hadoop cluster with one worker node is deployed and scaled according to gathered CPU utilization.
Therefore, a MAPE-k loop is initialized that periodically checks the CPU utilization of all worker nodes.
Thereafter, it is decided whether additional worker nodes are required (scaleUp) or not (scaleDown).
When a scaleUp is performed, a compute node hosting a hadoop-worker component is added to the model,
which gets executed over [DOCCI](https://gitlab.gwdg.de/rwm/de.ugoe.cs.rwm.docci) a models at runtime engine.
## Starting the MAPE-K loop
Before the MAPE-K loop is started make sure that the MartServer is running and the hadoop cluster has been deployed.
In this scenario, a Java application is started that utilizes the schematized data format of the OCCI metamodel and its extensions.
This scenario serves as an example on how to work with the OCCI ecosystem, including the monitoring extension and the models at runtime engine.
To start the MAPE-K loop execute MAPE.java as a Java Application.
In the VM it is located on the desktop. Open a new terminal (Ctrl-Alt-T) and navigate to the desktop (cd Desktop). You can start the loop by executing the following command:
```
java -jar MAPE.jar
```
### Mape-k loop - Output
The output of the script is separated into the individual steps of the MAPE loop: Monitor, Analyze, Plan, and Execute.
Thus, the output looks depending on the adaptive action to be performed similar to:
```
Starting MAPE loop
--------------------Waiting for new MAPE-K Cycle: Sleeping 10000--------------------
Monitor: Monitored CPUs: 1| Critical CPUs: 1| None CPUs: 0
Analyze: Critical State Detected
Plan: upScale!
Adding Compute Node to Model
Ip in Hadoop Network: 10.254.1.12
Adding Worker Component to Model
Adding Sensor to Model
Adding Datagatherer to Model
Adding Dataprocessor to Model
Adding Resultprovider to Model
Execute: Deploying adjusted Model
```
In this case we queried for VMs with Critical and None CPU utilization. We detected only one being Critical. Thus, a critical state is detected for which an upscaling of the cluster is planned. Hereby, a compute node is added to the hadoop cluster with the ip 10.254.1.12, as well as the worker component hosted on this VM. Moreover, a Sensor including its monitoring devices are added to the model. These are responsible to monitor the newly added worker in the cluster. Before the changes get executed by putting the adjusted model into DOCCI, a model transformation is performed on it to add provider specific information to the model, e.g., an attachment of the new VM to the management network.
If more than one worker node is currently active in the cluster and a minimum of one has a CPU utilization of None the downscaling removes the VM with None utilization from the cluster. To investigate the expected behavior of this self-adaptive control loop you can check an example log [here](./horizontalLog.md). This log also includes all REST requests performed against the OCCI interface.
*Note*: If you want to get the same information as in the full log, including requests performed against the OCCI interface, you can alternatively start the MAPE_Exec_Info.jar.
### MartServer - Output
During the execution of the MAPE-K loop sensors are added and released to the running cloud deployment. Thus, different amounts of monitorableproperties are filled with values by the dummy connector. An excerpt can be found beneath. Moreover, it logs output about how each single request adjusting the runtime model are handled.
```
INFO MonProp: CPU, set to: Low(ba16f4ee-1601-4192-a259-eae4274aed72)
INFO MonProp: CPU, set to: High(e0053a21-7349-4918-bb1d-ecfffb2d4efb)
INFO MonProp: CPU, set to: None(ba16f4ee-1601-4192-a259-eae4274aed72)
```
*Note*: The sometimes occurring MartServer error message regarding saving the model can be ignored as it has no effects on the cloud deployment nor is it related to the MOCCI extension artifact.
### Browser - Output
Again you can check the amount of deployed resources by using your browser. When a critical behavior is detected and an upscale is performed, the amount of compute nodes in the model is increased by one. This compute node hosts a hadoop worker component and has a sensor attached. When no critical behavior is detected, a downscale is planned, and execute the amount of provisioned compute nodes shrinks by one.
The amount of currently deployed sensors, applications, components, compute nodes, as well as their monitorableproperty can be accessed by the following example queries. Hereby, the information depicted can be updated by **refreshing the browser**.
```
http://localhost:8080/compute/
http://localhost:8080/sensor/
http://localhost:8080/monitorableproperty/
http://localhost:8080/application/
http://localhost:8080/component/
```
## Tuning the Scenario
Again the simulated monitoring results can be adjusted. Therefore, follow the steps defined the documentation of the [dummy connector](https://gitlab.gwdg.de/rwm/de.ugoe.cs.rwm.mocci/tree/master/de.ugoe.cs.rwm.mocci.connector.dummy).
Moreover, the behaviour of the models at runtime engine can be investigated in more detail by adjusting specific Logger settings in the RegistryAndLoggerSetup.java file. Therefore, open the OCCI-Studio and execute the scenario from here.
The class is located at:
```
de.ugoe.cs.rwm.mocci/src/main/java/MAPE.java
```
*Note:* To perform this scenario in a running cloud multiple adjustments have to be performed. In the code itself only the kind of connector has to be adjusted from LocalhostConnector to MartConnector. Moreover, an MartServer without actual connectors has to be created. We used the connectors located [here](../src/test/resources/martserver-plugins/live) and the ansible roles located [here](../src/test/resources/roles). Please refer to this [documentation](doc/openstack) to get started with actual cloud deployments.
# Vertical Scaling Log
This file shows a short excerpt form the standard output of the horizontal scaling application.
Depending on the Monitoring results, an analyzis is performed checking whether the new worker nodes have to be added or removed from the cluster.
```
Starting MAPE loop
--------------------Waiting for new MAPE-K Cycle: Sleeping 10000--------------------
2019-01-26 09:50:57 INFO Executor:378 - GET http://localhost:8080/monitorableproperty?attribute=monitoring.result&value=Critical
2019-01-26 09:50:57 INFO Executor:378 - GET http://localhost:8080/monitorableproperty?attribute=monitoring.result&value=None
2019-01-26 09:50:57 INFO Executor:378 - GET http://localhost:8080/monitorableproperty?attribute=monitoring.property&value=CPU
Monitor: Monitored CPUs: 1| Critical CPUs: 0| None CPUs: 0
Analyze: Non Critical State Detected
Plan: downScale!
Every Compute busy/Only one worker! Skipping downScale!
Execute: Deploying adjusted Model
--------------------Waiting for new MAPE-K Cycle: Sleeping 10000--------------------
2019-01-26 09:51:09 INFO Executor:378 - GET http://localhost:8080/monitorableproperty?attribute=monitoring.result&value=Critical
2019-01-26 09:51:09 INFO Executor:378 - GET http://localhost:8080/monitorableproperty?attribute=monitoring.result&value=None
2019-01-26 09:51:09 INFO Executor:378 - GET http://localhost:8080/monitorableproperty?attribute=monitoring.property&value=CPU
Monitor: Monitored CPUs: 1| Critical CPUs: 0| None CPUs: 0
Analyze: Non Critical State Detected
Plan: downScale!
Every Compute busy/Only one worker! Skipping downScale!
Execute: Deploying adjusted Model
--------------------Waiting for new MAPE-K Cycle: Sleeping 10000--------------------
2019-01-26 09:51:20 INFO Executor:378 - GET http://localhost:8080/monitorableproperty?attribute=monitoring.result&value=Critical
2019-01-26 09:51:20 INFO Executor:378 - GET http://localhost:8080/monitorableproperty?attribute=monitoring.result&value=None
2019-01-26 09:51:20 INFO Executor:378 - GET http://localhost:8080/monitorableproperty?attribute=monitoring.property&value=CPU
Monitor: Monitored CPUs: 1| Critical CPUs: 1| None CPUs: 0
Analyze: Critical State Detected
Plan: upScale!
Adding Compute Node to Model
Ip in Hadoop Network: 10.254.1.12
Adding Worker Component to Model
Adding Sensor to Model
Adding Datagatherer to Model
Adding Dataprocessor to Model
Adding Resultprovider to Model
Execute: Deploying adjusted Model
2019-01-26 09:51:20 INFO Executor:329 - PUT http://localhost:8080/resultprovider/urn:uuid:b3bd44ae-2e5f-4ffe-949f-0e4124fb71a3/ -H 'Content-Type: text/occi' -H 'Category: resultprovider; scheme="http://schemas.ugoe.cs.rwm/monitoring#"; class="kind", occiresultprovider; scheme="http://schemas.ugoe.cs.rwm/monitoring#"; class="mixin", cpupublisher; scheme="http://schemas.modmacao.org/usermixins#"; class="mixin"' -H 'X-OCCI-Attribute:occi.core.title="CPUProvider", result.provider.endpoint="192.168.35.45:8080", occi.core.id="urn:uuid:b3bd44ae-2e5f-4ffe-949f-0e4124fb71a3"'
2019-01-26 09:51:20 INFO Executor:329 - PUT http://localhost:8080/dataprocessor/urn:uuid:461dbb7f-baa6-46e3-811e-a9afde4e2d09/ -H 'Content-Type: text/occi' -H 'Category: dataprocessor; scheme="http://schemas.ugoe.cs.rwm/monitoring#"; class="kind", cpuprocessorlocal; scheme="http://schemas.modmacao.org/usermixins#"; class="mixin"' -H 'X-OCCI-Attribute:occi.core.title="CPUProcessor", occi.core.id="urn:uuid:461dbb7f-baa6-46e3-811e-a9afde4e2d09"'
2019-01-26 09:51:20 INFO Executor:329 - PUT http://localhost:8080/sensor/urn:uuid:491299ac-2940-4d00-a995-ef0c7a5de6b9/ -H 'Content-Type: text/occi' -H 'Category: sensor; scheme="http://schemas.ugoe.cs.rwm/monitoring#"; class="kind"' -H 'X-OCCI-Attribute:occi.core.title="CPUSensor", occi.core.id="urn:uuid:491299ac-2940-4d00-a995-ef0c7a5de6b9"'
2019-01-26 09:51:20 INFO Executor:329 - PUT http://localhost:8080/datagatherer/urn:uuid:68395305-0464-45f2-be4a-fa2c9e40e89d/ -H 'Content-Type: text/occi' -H 'Category: datagatherer; scheme="http://schemas.ugoe.cs.rwm/monitoring#"; class="kind", cpugatherer; scheme="http://schemas.modmacao.org/usermixins#"; class="mixin"' -H 'X-OCCI-Attribute:occi.core.title="CPUGatherer", occi.core.id="urn:uuid:68395305-0464-45f2-be4a-fa2c9e40e89d"'
2019-01-26 09:51:20 INFO Executor:329 - PUT http://localhost:8080/component/urn:uuid:d931f4e4-b11f-4a0e-a581-e817616baaa1/ -H 'Content-Type: text/occi' -H 'Category: component; scheme="http://schemas.modmacao.org/occi/platform#"; class="kind", hworker; scheme="http://schemas.modmacao.org/usermixins#"; class="mixin"' -H 'X-OCCI-Attribute:occi.core.title="worker-component", occi.core.id="urn:uuid:d931f4e4-b11f-4a0e-a581-e817616baaa1"'
2019-01-26 09:51:20 INFO Executor:329 - PUT http://localhost:8080/compute/urn:uuid:22d0da9c-d31f-455a-bca0-44db27dbad22/ -H 'Content-Type: text/occi' -H 'Category: compute; scheme="http://schemas.ogf.org/occi/infrastructure#"; class="kind", user_data; scheme="http://schemas.ogf.org/occi/infrastructure/compute#"; class="mixin", ssh_key; scheme="http://schemas.ogf.org/occi/infrastructure/credentials#"; class="mixin", ubuntu_xenialxerus; scheme="http://schemas.modmacao.org/openstack/swe#"; class="mixin"' -H 'X-OCCI-Attribute:occi.core.id="urn:uuid:22d0da9c-d31f-455a-bca0-44db27dbad22", occi.compute.state="active", occi.core.title="hadoop-worker-additional-10-254-1-12", occi.compute.hostname="hadoop-worker-additional-10-254-1-12", occi.credentials.ssh.publickey="ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC6H7Ydi45BTHid4qNppGAi5mzjbnZgt7bi6xLGmZG9CiLmhMsxOuk3Z05Nn+pmoN98qS0eY8S240PPk5VOlYqBY0vdRAwrZSHHaLdMp6I7ARNrI2KraYduweqz7ZQxPXQfwIeYx2HKQxEF2r+4//Fo4WfgdBkLuulvl/Gw3TUzJNQHvgpaiNo9+PI5CZydHnZbjUkRikS12pT+CbNKj+0QKeQztbCd41aKxDv5H0DjltVRcpPppv4dmiU/zoCAIngWLO1PPgfYWyze8Z9IoyBT7Qdg30U91TYZBuxzXR5lq7Fh64y/IZ/SjdOdSIvIuDjtmJDULRdLJzrvubrKY+YH Generated-by-Nova", occi.compute.userdata="I2Nsb3VkLWNvbmZpZwoKIyBVcGdyYWRlIHRoZSBpbnN0YW5jZSBvbiBmaXJzdCBib290CiMgKGllIHJ1biBhcHQtZ2V0IHVwZ3JhZGUpCiMKIyBEZWZhdWx0OiBmYWxzZQojIEFsaWFzZXM6IGFwdF91cGdyYWRlCnBhY2thZ2VfdXBncmFkZTogdHJ1ZQoKcGFja2FnZXM6CiAtIHB5dGhvbgoKd3JpdGVfZmlsZXM6CiAgLSBwYXRoOiAvZXRjL25ldHdvcmsvaW50ZXJmYWNlcy5kLzUwLWNsb3VkLWluaXQuY2ZnCiAgICBjb250ZW50OiB8CiAgICAgIGF1dG8gbG8KICAgICAgaWZhY2UgbG8gaW5ldCBsb29wYmFjawogICAgICAKICAgICAgYXV0byBlbnMwCiAgICAgIGFsbG93LWhvdHBsdWcgZW5zMAogICAgICBpZmFjZSBlbnMwIGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnMxCiAgICAgIGFsbG93LWhvdHBsdWcgZW5zMQogICAgICBpZmFjZSBlbnMxIGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnMyCiAgICAgIGFsbG93LWhvdHBsdWcgZW5zMgogICAgICBpZmFjZSBlbnMyIGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnMzCiAgICAgIGFsbG93LWhvdHBsdWcgZW5zMwogICAgICBpZmFjZSBlbnMzIGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM0CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zNAogICAgICBpZmFjZSBlbnM0IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM1CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zNQogICAgICBpZmFjZSBlbnM1IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM2CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zNgogICAgICBpZmFjZSBlbnM2IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM3CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zNwogICAgICBpZmFjZSBlbnM3IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM4CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zOAogICAgICBpZmFjZSBlbnM4IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM5CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zOQogICAgICBpZmFjZSBlbnM5IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnMxMAogICAgICBhbGxvdy1ob3RwbHVnIGVuczEwCiAgICAgIGlmYWNlIGVuczEwIGluZXQgZGhjcAoKIyMj"'
2019-01-26 09:51:20 INFO Executor:329 - PUT http://localhost:8080/componentlink/urn:uuid:89325de5-3aeb-42c6-8f68-c65af6880c7a/ -H 'Content-Type: text/occi' -H 'Category: componentlink; scheme="http://schemas.modmacao.org/occi/platform#"; class="kind"' -H 'X-OCCI-Attribute:occi.core.source="/application/urn:uuid:a4888ba9-a0ea-48f2-a29e-901c876ab42d/",occi.core.target="/component/urn:uuid:d931f4e4-b11f-4a0e-a581-e817616baaa1/",occi.core.id="urn:uuid:89325de5-3aeb-42c6-8f68-c65af6880c7a"'
2019-01-26 09:51:21 INFO Executor:329 - PUT http://localhost:8080/componentlink/urn:uuid:79b68716-1849-49c1-8003-6476f9371e96/ -H 'Content-Type: text/occi' -H 'Category: componentlink; scheme="http://schemas.modmacao.org/occi/platform#"; class="kind"' -H 'X-OCCI-Attribute:occi.core.source="/resultprovider/urn:uuid:b3bd44ae-2e5f-4ffe-949f-0e4124fb71a3/",occi.core.target="/dataprocessor/urn:uuid:461dbb7f-baa6-46e3-811e-a9afde4e2d09/",occi.core.id="urn:uuid:79b68716-1849-49c1-8003-6476f9371e96"'
2019-01-26 09:51:21 INFO Executor:329 - PUT http://localhost:8080/componentlink/urn:uuid:c62b2f1c-5b36-4071-be29-fbd9f1af0654/ -H 'Content-Type: text/occi' -H 'Category: componentlink; scheme="http://schemas.modmacao.org/occi/platform#"; class="kind"' -H 'X-OCCI-Attribute:occi.core.source="/dataprocessor/urn:uuid:461dbb7f-baa6-46e3-811e-a9afde4e2d09/",occi.core.target="/datagatherer/urn:uuid:68395305-0464-45f2-be4a-fa2c9e40e89d/",occi.core.id="urn:uuid:c62b2f1c-5b36-4071-be29-fbd9f1af0654"'
2019-01-26 09:51:21 INFO Executor:329 - PUT http://localhost:8080/componentlink/urn:uuid:d55a30ae-401c-45f5-b021-ee760b04413d/ -H 'Content-Type: text/occi' -H 'Category: componentlink; scheme="http://schemas.modmacao.org/occi/platform#"; class="kind"' -H 'X-OCCI-Attribute:occi.core.source="/sensor/urn:uuid:491299ac-2940-4d00-a995-ef0c7a5de6b9/",occi.core.target="/dataprocessor/urn:uuid:461dbb7f-baa6-46e3-811e-a9afde4e2d09/",occi.core.id="urn:uuid:d55a30ae-401c-45f5-b021-ee760b04413d"'
2019-01-26 09:51:21 INFO Executor:329 - PUT http://localhost:8080/componentlink/urn:uuid:7a9b3046-ed5f-41ae-a359-5bbdf15c851b/ -H 'Content-Type: text/occi' -H 'Category: componentlink; scheme="http://schemas.modmacao.org/occi/platform#"; class="kind"' -H 'X-OCCI-Attribute:occi.core.source="/sensor/urn:uuid:491299ac-2940-4d00-a995-ef0c7a5de6b9/",occi.core.target="/datagatherer/urn:uuid:68395305-0464-45f2-be4a-fa2c9e40e89d/",occi.core.id="urn:uuid:7a9b3046-ed5f-41ae-a359-5bbdf15c851b"'
2019-01-26 09:51:21 INFO Executor:329 - PUT http://localhost:8080/componentlink/urn:uuid:c8ce4ff8-7e25-4213-90eb-9eac4d64ddb7/ -H 'Content-Type: text/occi' -H 'Category: componentlink; scheme="http://schemas.modmacao.org/occi/platform#"; class="kind"' -H 'X-OCCI-Attribute:occi.core.source="/sensor/urn:uuid:491299ac-2940-4d00-a995-ef0c7a5de6b9/",occi.core.target="/resultprovider/urn:uuid:b3bd44ae-2e5f-4ffe-949f-0e4124fb71a3/",occi.core.id="urn:uuid:c8ce4ff8-7e25-4213-90eb-9eac4d64ddb7"'
2019-01-26 09:51:30 INFO Executor:154 - GET http://localhost:8080/compute/urn:uuid:22d0da9c-d31f-455a-bca0-44db27dbad22/
2019-01-26 09:51:31 INFO Executor:329 - PUT http://localhost:8080/networkinterface/urn:uuid:dab3243f-f1c0-42a2-b9c9-a0211b1867ec/ -H 'Content-Type: text/occi' -H 'Category: networkinterface; scheme="http://schemas.ogf.org/occi/infrastructure#"; class="kind"' -H 'X-OCCI-Attribute:occi.core.source="/compute/urn:uuid:22d0da9c-d31f-455a-bca0-44db27dbad22/",occi.core.target="/network/urn:uuid:7a9fca2c-24fb-473c-aa9c-8dc9e68a432a/",occi.core.id="urn:uuid:dab3243f-f1c0-42a2-b9c9-a0211b1867ec"'
2019-01-26 09:51:31 INFO Executor:329 - PUT http://localhost:8080/placementlink/urn:uuid:dd16dfc1-ecf6-4389-a2bb-0c9987309d3d/ -H 'Content-Type: text/occi' -H 'Category: placementlink; scheme="http://schemas.modmacao.org/placement#"; class="kind"' -H 'X-OCCI-Attribute:occi.core.source="/component/urn:uuid:d931f4e4-b11f-4a0e-a581-e817616baaa1/",occi.core.target="/compute/urn:uuid:22d0da9c-d31f-455a-bca0-44db27dbad22/",occi.core.id="urn:uuid:dd16dfc1-ecf6-4389-a2bb-0c9987309d3d"'
2019-01-26 09:51:31 INFO Executor:329 - PUT http://localhost:8080/placementlink/urn:uuid:7b330c3d-b85b-4cb6-b6e5-023fbd8bdd81/ -H 'Content-Type: text/occi' -H 'Category: placementlink; scheme="http://schemas.modmacao.org/placement#"; class="kind"' -H 'X-OCCI-Attribute:occi.core.source="/dataprocessor/urn:uuid:461dbb7f-baa6-46e3-811e-a9afde4e2d09/",occi.core.target="/compute/urn:uuid:22d0da9c-d31f-455a-bca0-44db27dbad22/",occi.core.id="urn:uuid:7b330c3d-b85b-4cb6-b6e5-023fbd8bdd81"'
2019-01-26 09:51:31 INFO Executor:329 - PUT http://localhost:8080/placementlink/urn:uuid:6591447b-5e7b-4596-94a8-59e421cf5957/ -H 'Content-Type: text/occi' -H 'Category: placementlink; scheme="http://schemas.modmacao.org/placement#"; class="kind"' -H 'X-OCCI-Attribute:occi.core.source="/resultprovider/urn:uuid:b3bd44ae-2e5f-4ffe-949f-0e4124fb71a3/",occi.core.target="/compute/urn:uuid:22d0da9c-d31f-455a-bca0-44db27dbad22/",occi.core.id="urn:uuid:6591447b-5e7b-4596-94a8-59e421cf5957"'
2019-01-26 09:51:31 INFO Executor:329 - PUT http://localhost:8080/networkinterface/urn:uuid:d61cdc1c-bc82-407f-9db9-fffbf2fa0d79/ -H 'Content-Type: text/occi' -H 'Category: networkinterface; scheme="http://schemas.ogf.org/occi/infrastructure#"; class="kind", ipnetworkinterface; scheme="http://schemas.ogf.org/occi/infrastructure/networkinterface#"; class="mixin"' -H 'X-OCCI-Attribute:occi.core.source="/compute/urn:uuid:22d0da9c-d31f-455a-bca0-44db27dbad22/",occi.core.target="/network/urn:uuid:29d78078-fb4c-47aa-a9af-b8aaf3339591/",occi.core.id="urn:uuid:d61cdc1c-bc82-407f-9db9-fffbf2fa0d79", occi.networkinterface.address="10.254.1.12"'
2019-01-26 09:51:31 INFO Executor:329 - PUT http://localhost:8080/monitorableproperty/urn:uuid:e3dc8254-bd48-42c8-a824-0d86075aba67/ -H 'Content-Type: text/occi' -H 'Category: monitorableproperty; scheme="http://schemas.ugoe.cs.rwm/monitoring#"; class="kind"' -H 'X-OCCI-Attribute:occi.core.source="/sensor/urn:uuid:491299ac-2940-4d00-a995-ef0c7a5de6b9/",occi.core.target="/compute/urn:uuid:22d0da9c-d31f-455a-bca0-44db27dbad22/",occi.core.id="urn:uuid:e3dc8254-bd48-42c8-a824-0d86075aba67", occi.core.title="monProp", monitoring.property="CPU"'
2019-01-26 09:51:31 INFO Executor:329 - PUT http://localhost:8080/placementlink/urn:uuid:9ad58554-214e-49a8-8334-8cbdcf2bb6ab/ -H 'Content-Type: text/occi' -H 'Category: placementlink; scheme="http://schemas.modmacao.org/placement#"; class="kind"' -H 'X-OCCI-Attribute:occi.core.source="/datagatherer/urn:uuid:68395305-0464-45f2-be4a-fa2c9e40e89d/",occi.core.target="/compute/urn:uuid:22d0da9c-d31f-455a-bca0-44db27dbad22/",occi.core.id="urn:uuid:9ad58554-214e-49a8-8334-8cbdcf2bb6ab"'
2019-01-26 09:51:31 INFO Executor:329 - PUT http://localhost:8080/networkinterface/urn:uuid:d936921f-d806-4a13-8938-6676df0b342f/ -H 'Content-Type: text/occi' -H 'Category: networkinterface; scheme="http://schemas.ogf.org/occi/infrastructure#"; class="kind", ipnetworkinterface; scheme="http://schemas.ogf.org/occi/infrastructure/networkinterface#"; class="mixin", ansibleendpoint; scheme="http://schemas.modmacao.org/occi/ansible#"; class="mixin"' -H 'X-OCCI-Attribute:occi.core.source="/compute/urn:uuid:22d0da9c-d31f-455a-bca0-44db27dbad22/",occi.core.target="/network/urn:uuid:29d78078-fb4c-47aa-a9af-b8aaf3339590/",occi.core.id="urn:uuid:d936921f-d806-4a13-8938-6676df0b342f", occi.core.title="hadoop-worker-additional-10-254-1-12 -> Management Network"'
2019-01-26 09:51:31 INFO Executor:105 - POST http://localhost:8080/application/urn:uuid:a4888ba9-a0ea-48f2-a29e-901c876ab42d/?action=deploy -H 'Content-Type: text/occi' -H 'Category: deploy; scheme="http://schemas.modmacao.org/occi/platform/application/action#"; class="action"'
2019-01-26 09:51:31 INFO Executor:105 - POST http://localhost:8080/application/urn:uuid:a4888ba9-a0ea-48f2-a29e-901c876ab42d/?action=configure -H 'Content-Type: text/occi' -H 'Category: configure; scheme="http://schemas.modmacao.org/occi/platform/application/action#"; class="action"'
2019-01-26 09:51:31 INFO Executor:105 - POST http://localhost:8080/application/urn:uuid:a4888ba9-a0ea-48f2-a29e-901c876ab42d/?action=start -H 'Content-Type: text/occi' -H 'Category: start; scheme="http://schemas.modmacao.org/occi/platform/application/action#"; class="action"'
2019-01-26 09:51:31 INFO Executor:105 - POST http://localhost:8080/sensor/urn:uuid:efb0f50a-7a7c-4153-b939-4846d6554dbb/?action=deploy -H 'Content-Type: text/occi' -H 'Category: deploy; scheme="http://schemas.modmacao.org/occi/platform/application/action#"; class="action"'
2019-01-26 09:51:31 INFO Executor:105 - POST http://localhost:8080/sensor/urn:uuid:efb0f50a-7a7c-4153-b939-4846d6554dbb/?action=configure -H 'Content-Type: text/occi' -H 'Category: configure; scheme="http://schemas.modmacao.org/occi/platform/application/action#"; class="action"'
2019-01-26 09:51:31 INFO Executor:105 - POST http://localhost:8080/sensor/urn:uuid:efb0f50a-7a7c-4153-b939-4846d6554dbb/?action=start -H 'Content-Type: text/occi' -H 'Category: start; scheme="http://schemas.modmacao.org/occi/platform/application/action#"; class="action"'
2019-01-26 09:51:31 INFO Executor:105 - POST http://localhost:8080/sensor/urn:uuid:491299ac-2940-4d00-a995-ef0c7a5de6b9/?action=deploy -H 'Content-Type: text/occi' -H 'Category: deploy; scheme="http://schemas.modmacao.org/occi/platform/application/action#"; class="action"'
2019-01-26 09:51:31 INFO Executor:105 - POST http://localhost:8080/sensor/urn:uuid:491299ac-2940-4d00-a995-ef0c7a5de6b9/?action=configure -H 'Content-Type: text/occi' -H 'Category: configure; scheme="http://schemas.modmacao.org/occi/platform/application/action#"; class="action"'
2019-01-26 09:51:31 INFO Executor:105 - POST http://localhost:8080/sensor/urn:uuid:491299ac-2940-4d00-a995-ef0c7a5de6b9/?action=start -H 'Content-Type: text/occi' -H 'Category: start; scheme="http://schemas.modmacao.org/occi/platform/application/action#"; class="action"'
2019-01-26 09:51:31 INFO Executor:105 - POST http://localhost:8080/component/urn:uuid:d931f4e4-b11f-4a0e-a581-e817616baaa1/?action=start -H 'Content-Type: text/occi' -H 'Category: start; scheme="http://schemas.modmacao.org/occi/platform/component/action#"; class="action"'
--------------------Waiting for new MAPE-K Cycle: Sleeping 10000--------------------
2019-01-26 09:51:41 INFO Executor:378 - GET http://localhost:8080/monitorableproperty?attribute=monitoring.result&value=Critical
2019-01-26 09:51:41 INFO Executor:378 - GET http://localhost:8080/monitorableproperty?attribute=monitoring.result&value=None
2019-01-26 09:51:41 INFO Executor:378 - GET http://localhost:8080/monitorableproperty?attribute=monitoring.property&value=CPU
Monitor: Monitored CPUs: 2| Critical CPUs: 1| None CPUs: 0
Analyze: Non Critical State Detected
Plan: downScale!
Every Compute busy/Only one worker! Skipping downScale!
Execute: Deploying adjusted Model
--------------------Waiting for new MAPE-K Cycle: Sleeping 10000--------------------
2019-01-26 09:51:51 INFO Executor:378 - GET http://localhost:8080/monitorableproperty?attribute=monitoring.result&value=Critical
2019-01-26 09:51:51 INFO Executor:378 - GET http://localhost:8080/monitorableproperty?attribute=monitoring.result&value=None
2019-01-26 09:51:51 INFO Executor:378 - GET http://localhost:8080/monitorableproperty?attribute=monitoring.property&value=CPU
Monitor: Monitored CPUs: 2| Critical CPUs: 0| None CPUs: 0
Analyze: Non Critical State Detected
Plan: downScale!
Every Compute busy/Only one worker! Skipping downScale!
Execute: Deploying adjusted Model
--------------------Waiting for new MAPE-K Cycle: Sleeping 10000--------------------
2019-01-26 09:52:02 INFO Executor:378 - GET http://localhost:8080/monitorableproperty?attribute=monitoring.result&value=Critical
2019-01-26 09:52:02 INFO Executor:378 - GET http://localhost:8080/monitorableproperty?attribute=monitoring.result&value=None
2019-01-26 09:52:02 INFO Executor:378 - GET http://localhost:8080/monitorableproperty?attribute=monitoring.property&value=CPU
Monitor: Monitored CPUs: 2| Critical CPUs: 0| None CPUs: 0
Analyze: Non Critical State Detected
Plan: downScale!
Every Compute busy/Only one worker! Skipping downScale!
Execute: Deploying adjusted Model
--------------------Waiting for new MAPE-K Cycle: Sleeping 10000--------------------
2019-01-26 09:52:12 INFO Executor:378 - GET http://localhost:8080/monitorableproperty?attribute=monitoring.result&value=Critical
2019-01-26 09:52:12 INFO Executor:378 - GET http://localhost:8080/monitorableproperty?attribute=monitoring.result&value=None
2019-01-26 09:52:12 INFO Executor:378 - GET http://localhost:8080/monitorableproperty?attribute=monitoring.property&value=CPU
Monitor: Monitored CPUs: 2| Critical CPUs: 0| None CPUs: 0
Analyze: Non Critical State Detected
Plan: downScale!
Every Compute busy/Only one worker! Skipping downScale!
Execute: Deploying adjusted Model
--------------------Waiting for new MAPE-K Cycle: Sleeping 10000--------------------
2019-01-26 09:52:23 INFO Executor:378 - GET http://localhost:8080/monitorableproperty?attribute=monitoring.result&value=Critical
2019-01-26 09:52:23 INFO Executor:378 - GET http://localhost:8080/monitorableproperty?attribute=monitoring.result&value=None
2019-01-26 09:52:23 INFO Executor:378 - GET http://localhost:8080/monitorableproperty?attribute=monitoring.property&value=CPU
Monitor: Monitored CPUs: 2| Critical CPUs: 0| None CPUs: 1
Analyze: Non Critical State Detected
Plan: downScale!
Every Compute busy/Only one worker! Skipping downScale!
Execute: Deploying adjusted Model
--------------------Waiting for new MAPE-K Cycle: Sleeping 10000--------------------
2019-01-26 09:52:33 INFO Executor:378 - GET http://localhost:8080/monitorableproperty?attribute=monitoring.result&value=Critical
2019-01-26 09:52:33 INFO Executor:378 - GET http://localhost:8080/monitorableproperty?attribute=monitoring.result&value=None
2019-01-26 09:52:33 INFO Executor:378 - GET http://localhost:8080/monitorableproperty?attribute=monitoring.property&value=CPU
Monitor: Monitored CPUs: 2| Critical CPUs: 0| None CPUs: 0
Analyze: Non Critical State Detected
Plan: downScale!
Every Compute busy/Only one worker! Skipping downScale!
Execute: Deploying adjusted Model
--------------------Waiting for new MAPE-K Cycle: Sleeping 10000--------------------
2019-01-26 09:52:44 INFO Executor:378 - GET http://localhost:8080/monitorableproperty?attribute=monitoring.result&value=Critical
2019-01-26 09:52:44 INFO Executor:378 - GET http://localhost:8080/monitorableproperty?attribute=monitoring.result&value=None
2019-01-26 09:52:44 INFO Executor:378 - GET http://localhost:8080/monitorableproperty?attribute=monitoring.property&value=CPU
Monitor: Monitored CPUs: 2| Critical CPUs: 0| None CPUs: 1
Analyze: Non Critical State Detected
Plan: downScale!
Every Compute busy/Only one worker! Skipping downScale!
Execute: Deploying adjusted Model
--------------------Waiting for new MAPE-K Cycle: Sleeping 10000--------------------
2019-01-26 09:52:54 INFO Executor:378 - GET http://localhost:8080/monitorableproperty?attribute=monitoring.result&value=Critical
2019-01-26 09:52:54 INFO Executor:378 - GET http://localhost:8080/monitorableproperty?attribute=monitoring.result&value=None
2019-01-26 09:52:54 INFO Executor:378 - GET http://localhost:8080/monitorableproperty?attribute=monitoring.property&value=CPU
Monitor: Monitored CPUs: 2| Critical CPUs: 1| None CPUs: 0
Analyze: Non Critical State Detected
Plan: downScale!
Every Compute busy/Only one worker! Skipping downScale!
Execute: Deploying adjusted Model
--------------------Waiting for new MAPE-K Cycle: Sleeping 10000--------------------
2019-01-26 09:53:04 INFO Executor:378 - GET http://localhost:8080/monitorableproperty?attribute=monitoring.result&value=Critical
2019-01-26 09:53:04 INFO Executor:378 - GET http://localhost:8080/monitorableproperty?attribute=monitoring.result&value=None
2019-01-26 09:53:04 INFO Executor:378 - GET http://localhost:8080/monitorableproperty?attribute=monitoring.property&value=CPU
Monitor: Monitored CPUs: 2| Critical CPUs: 0| None CPUs: 0
Analyze: Non Critical State Detected
Plan: downScale!
Every Compute busy/Only one worker! Skipping downScale!
Execute: Deploying adjusted Model
--------------------Waiting for new MAPE-K Cycle: Sleeping 10000--------------------
2019-01-26 09:53:15 INFO Executor:378 - GET http://localhost:8080/monitorableproperty?attribute=monitoring.result&value=Critical
2019-01-26 09:53:15 INFO Executor:378 - GET http://localhost:8080/monitorableproperty?attribute=monitoring.result&value=None
2019-01-26 09:53:15 INFO Executor:378 - GET http://localhost:8080/monitorableproperty?attribute=monitoring.property&value=CPU
Monitor: Monitored CPUs: 2| Critical CPUs: 0| None CPUs: 1
Analyze: Non Critical State Detected
Plan: downScale!
VM with None CPU utilization found: urn:uuid:22d0da9c-d31f-455a-bca0-44db27dbad22
Deleting Entities Around: hadoop-worker-additional-10-254-1-12 (urn:uuid:22d0da9c-d31f-455a-bca0-44db27dbad22)
Execute: Deploying adjusted Model
2019-01-26 09:53:15 INFO Executor:251 - DELETE http://localhost:8080/componentlink/urn:uuid:89325de5-3aeb-42c6-8f68-c65af6880c7a/
2019-01-26 09:53:15 INFO Executor:251 - DELETE http://localhost:8080/componentlink/urn:uuid:c62b2f1c-5b36-4071-be29-fbd9f1af0654/
2019-01-26 09:53:15 INFO Executor:251 - DELETE http://localhost:8080/componentlink/urn:uuid:7a9b3046-ed5f-41ae-a359-5bbdf15c851b/
2019-01-26 09:53:15 INFO Executor:251 - DELETE http://localhost:8080/componentlink/urn:uuid:c8ce4ff8-7e25-4213-90eb-9eac4d64ddb7/
2019-01-26 09:53:15 INFO Executor:251 - DELETE http://localhost:8080/componentlink/urn:uuid:d55a30ae-401c-45f5-b021-ee760b04413d/
2019-01-26 09:53:15 INFO Executor:251 - DELETE http://localhost:8080/monitorableproperty/urn:uuid:e3dc8254-bd48-42c8-a824-0d86075aba67/
2019-01-26 09:53:15 INFO Executor:251 - DELETE http://localhost:8080/componentlink/urn:uuid:79b68716-1849-49c1-8003-6476f9371e96/
2019-01-26 09:53:15 INFO Executor:251 - DELETE http://localhost:8080/networkinterface/urn:uuid:d61cdc1c-bc82-407f-9db9-fffbf2fa0d79/
2019-01-26 09:53:15 INFO Executor:251 - DELETE http://localhost:8080/networkinterface/urn:uuid:dab3243f-f1c0-42a2-b9c9-a0211b1867ec/
2019-01-26 09:53:15 INFO Executor:251 - DELETE http://localhost:8080/networkinterface/urn:uuid:d936921f-d806-4a13-8938-6676df0b342f/
2019-01-26 09:53:15 INFO Executor:251 - DELETE http://localhost:8080/compute/urn:uuid:22d0da9c-d31f-455a-bca0-44db27dbad22/
2019-01-26 09:53:15 INFO Executor:251 - DELETE http://localhost:8080/dataprocessor/urn:uuid:461dbb7f-baa6-46e3-811e-a9afde4e2d09/
2019-01-26 09:53:15 INFO Executor:251 - DELETE http://localhost:8080/sensor/urn:uuid:491299ac-2940-4d00-a995-ef0c7a5de6b9/
2019-01-26 09:53:15 INFO Executor:251 - DELETE http://localhost:8080/resultprovider/urn:uuid:b3bd44ae-2e5f-4ffe-949f-0e4124fb71a3/
2019-01-26 09:53:15 INFO Executor:251 - DELETE http://localhost:8080/component/urn:uuid:d931f4e4-b11f-4a0e-a581-e817616baaa1/
2019-01-26 09:53:15 INFO Executor:251 - DELETE http://localhost:8080/datagatherer/urn:uuid:68395305-0464-45f2-be4a-fa2c9e40e89d/
--------------------Waiting for new MAPE-K Cycle: Sleeping 10000--------------------
2019-01-26 09:53:25 INFO Executor:378 - GET http://localhost:8080/monitorableproperty?attribute=monitoring.result&value=Critical
2019-01-26 09:53:25 INFO Executor:378 - GET http://localhost:8080/monitorableproperty?attribute=monitoring.result&value=None
2019-01-26 09:53:25 INFO Executor:378 - GET http://localhost:8080/monitorableproperty?attribute=monitoring.property&value=CPU
Monitor: Monitored CPUs: 1| Critical CPUs: 0| None CPUs: 0
Analyze: Non Critical State Detected
Plan: downScale!
Every Compute busy/Only one worker! Skipping downScale!
Execute: Deploying adjusted Model
--------------------Waiting for new MAPE-K Cycle: Sleeping 10000--------------------
```
\ No newline at end of file
# Initial Deployment Tutorial
In this tutorial a hadoop cluster with one worker node getting monitored is deployed. Therefore, the [MartServer](https://github.com/occiware/MartServer) is used in combination with [DOCCI](https://gitlab.gwdg.de/rwm/de.ugoe.cs.rwm.docci) an engine automatically deploying OCCI models.
This deployment serves as entry point for the other provided scenarios: [Vertical Scaling](./vertical.md), [Horizontal Scaling](./horizontal.md), and [Sensor Creation](./own.md) showing how the monitored information can be used in self-adaptive control loops.
## Starting the MartServer
If the getting started VM is used everything is preconfigured only requiring to start the following script.
Start a terminal (Ctrl-Alt-T) and navigate to the desktop (cd Desktop). The script can be started using the following command:
```
./startMART.sh
```
If the preconfigured VM is not used: Start the MartServer with these [plugins](../src/test/resources/martserver-plugins) for the test environemt.
For an actual deployment in an OpenStack cloud we used the following [live connectors](../src/test/resources/martserver-plugins/live) including these [ansible roles](../src/test/resources/roles).
## Deploying the Hadoop Cluster
Now that the MartServer is started 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 (Ctrl-Alt-T) and navigate to the VM's desktop (cd Desktop) and execute the initialDeployment.jar using the following command.
```
java -jar initialDeployment.jar
```
### Initial Deployment Application - Output
During execution of the initialDeployment.jar the Executor of the deployment engine is logged. This log shows all OCCI requests that are executed to deploy the hadoop cluster model shown beneath.
For example the network connecting the nodes in the hadoop cluster is created as shown in the following log output. The full log can be found [here](./initialLog.md):
```
2019-01-29 14:56:47 INFO Executor:329 - PUT http://localhost:8080/network/urn:uuid:29d78078-fb4c-47aa-a9af-b8aaf3339591/ -H 'Content-Type: text/occi' -H 'Category: network; scheme="http://schemas.ogf.org/occi/infrastructure#"; class="kind", ipnetwork; scheme="http://schemas.ogf.org/occi/infrastructure/network#"; class="mixin"' -H 'X-OCCI-Attribute:occi.core.id="urn:uuid:29d78078-fb4c-47aa-a9af-b8aaf3339591", occi.core.title="HNetwork", occi.core.summary="", occi.network.vlan="0", occi.network.label="", occi.network.state="active", occi.network.state.message="", occi.network.address="10.254.1.1/24"'
```
### MartServer - Output
After the deployment has been performed. The sensors are started updating attached monitoring properties according to the interval specified in the dummy connector. 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)
INFO MonProp: CPU, set to: Low(ba16f4ee-1601-4192-a259-eae4274aed72)
INFO MonProp: CPU, set to: Critical(ba16f4ee-1601-4192-a259-eae4274aed72)
```
### Browser - Output
Now that everything has been deployed you can investigate the OCCI runtime model by opening your browser and query for OCCI entitites. In the following you find some example queries for the runtime model to query all compute, sensor, and monitorableproperties, as well as a query for the concrete monitored hadoop-worker compute node, and a filter for each monitorableproperty set to Critical. Additional query and filters can be found in the [documentation of the MartServer](https://github.com/occiware/MartServer/blob/master/doc/userdoc.md). It should be noted, that the updated MonitorableProperties can be investigated by **refreshing the browser**.
```
http://localhost:8080/compute
http://localhost:8080/sensor
http://localhost:8080/monitorableproperty
http://localhost:8080/compute/urn:uuid:2e6a73d0-faaa-476a-bd25-ca461dd166cf
http://localhost:8080/monitorableproperty?attribute=monitoring.result&value=Critical
```
Now that the deployed model shown below is running, the other tutorials can be executed. The following figure visualized the initially deployed model:
![Init](./src/main/resources/de/ugoe/cs/rwm/mocci/occi/initial.jpg "Init")
## Resetting the MartServer
If you plan to execute the other scenarios ([Vertical Scaling](./vertical.md), [Horizontal Scaling](./horizontal.md), and [Sensor Creation](./own.md)) do not reset the MartServer.
Otherwise first stop the MartServer it by pressing Ctrl-C in the terminal running it. Thereafter, either start the resetMart.sh script or go to the folder holding the occi model of the MartServer(~/models) and delete the file model-anonymous.occic. This file represents the concrete runtime model stored by the MartServer when he is stopped and started.
\ No newline at end of file
# Initial Deployment Log
This file shows the logging of DOCCI for the initial deployment tutorial.
Hereby, first the User Mixins are deployed (required by MoDMaCAO).
Thereafter, all Resources in the model are deployed followed by Links connecting them.
At the end each application, including sensors are started by performing the deploy, configure and start actions on them.
Sometimes a request fails. When that is the case the request is reperformed up to three times.
```
Choosing default initial deployment model
2019-01-23 14:56:45 INFO Executor:199 - POST http://localhost:8080/-/ -H 'Content-Type: text/occi' -H 'Category: hjob; scheme="http://schemas.modmacao.org/usermixins#"; class="mixin"; location="/usermixins/"'
2019-01-23 14:56:45 INFO Executor:199 - POST http://localhost:8080/-/ -H 'Content-Type: text/occi' -H 'Category: hmaster; scheme="http://schemas.modmacao.org/usermixins#"; class="mixin"; location="/usermixins/"'
2019-01-23 14:56:45 INFO Executor:199 - POST http://localhost:8080/-/ -H 'Content-Type: text/occi' -H 'Category: hworker; scheme="http://schemas.modmacao.org/usermixins#"; class="mixin"; location="/usermixins/"'
2019-01-23 14:56:45 INFO Executor:199 - POST http://localhost:8080/-/ -H 'Content-Type: text/occi' -H 'Category: cpugatherer; scheme="http://schemas.modmacao.org/usermixins#"; class="mixin"; location="/usermixins/"'
2019-01-23 14:56:45 INFO Executor:199 - POST http://localhost:8080/-/ -H 'Content-Type: text/occi' -H 'Category: cpuprocessor; scheme="http://schemas.modmacao.org/usermixins#"; class="mixin"; location="/usermixins/"'
2019-01-23 14:56:45 INFO Executor:199 - POST http://localhost:8080/-/ -H 'Content-Type: text/occi' -H 'Category: cpupublisher; scheme="http://schemas.modmacao.org/usermixins#"; class="mixin"; location="/usermixins/"'
2019-01-23 14:56:45 INFO Executor:199 - POST http://localhost:8080/-/ -H 'Content-Type: text/occi' -H 'Category: cpuprocessorlocal; scheme="http://schemas.modmacao.org/usermixins#"; class="mixin"; location="/usermixins/"'
2019-01-23 14:56:47 INFO Executor:329 - PUT http://localhost:8080/network/urn:uuid:29d78078-fb4c-47aa-a9af-b8aaf3339591/ -H 'Content-Type: text/occi' -H 'Category: network; scheme="http://schemas.ogf.org/occi/infrastructure#"; class="kind", ipnetwork; scheme="http://schemas.ogf.org/occi/infrastructure/network#"; class="mixin"' -H 'X-OCCI-Attribute:occi.core.id="urn:uuid:29d78078-fb4c-47aa-a9af-b8aaf3339591", occi.core.title="HNetwork", occi.core.summary="", occi.network.vlan="0", occi.network.label="", occi.network.state="active", occi.network.state.message="", occi.network.address="10.254.1.1/24"'
2019-01-23 14:56:47 INFO Executor:329 - PUT http://localhost:8080/component/urn:uuid:f934d445-d0c8-4f2f-8086-d9f1a8255898/ -H 'Content-Type: text/occi' -H 'Category: component; scheme="http://schemas.modmacao.org/occi/platform#"; class="kind", hworker; scheme="http://schemas.modmacao.org/usermixins#"; class="mixin"' -H 'X-OCCI-Attribute:occi.core.id="urn:uuid:f934d445-d0c8-4f2f-8086-d9f1a8255898", occi.core.title="HWorker", occi.core.summary="", occi.component.state="undeployed", occi.component.state.message=""'
2019-01-23 14:56:47 INFO Executor:329 - PUT http://localhost:8080/network/urn:uuid:7a9fca2c-24fb-473c-aa9c-8dc9e68a432a/ -H 'Content-Type: text/occi' -H 'Category: network; scheme="http://schemas.ogf.org/occi/infrastructure#"; class="kind", ipnetwork; scheme="http://schemas.ogf.org/occi/infrastructure/network#"; class="mixin"' -H 'X-OCCI-Attribute:occi.core.id="urn:uuid:7a9fca2c-24fb-473c-aa9c-8dc9e68a432a", occi.core.title="MonitoringNetwork", occi.core.summary="", occi.network.vlan="0", occi.network.label="", occi.network.state="active", occi.network.state.message="", occi.network.address="100.254.1.1/24"'
2019-01-23 14:56:47 INFO Executor:329 - PUT http://localhost:8080/compute/urn:uuid:2e6a73d0-faaa-476a-bd25-ca461dd166ce/ -H 'Content-Type: text/occi' -H 'Category: compute; scheme="http://schemas.ogf.org/occi/infrastructure#"; class="kind", ssh_key; scheme="http://schemas.ogf.org/occi/infrastructure/credentials#"; class="mixin", user_data; scheme="http://schemas.ogf.org/occi/infrastructure/compute#"; class="mixin", ubuntu_xenialxerus; scheme="http://schemas.modmacao.org/openstack/swe#"; class="mixin"' -H 'X-OCCI-Attribute:occi.core.id="urn:uuid:2e6a73d0-faaa-476a-bd25-ca461dd166ce", occi.core.title="Hadoop-master", occi.core.summary="", occi.compute.architecture="x86", occi.compute.cores="2", occi.compute.hostname="hadoop-master", occi.compute.share="0", occi.compute.speed="0", occi.compute.memory="4096", occi.compute.state="active", occi.compute.state.message="", occi.credentials.ssh.publickey="ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC6H7Ydi45BTHid4qNppGAi5mzjbnZgt7bi6xLGmZG9CiLmhMsxOuk3Z05Nn+pmoN98qS0eY8S240PPk5VOlYqBY0vdRAwrZSHHaLdMp6I7ARNrI2KraYduweqz7ZQxPXQfwIeYx2HKQxEF2r+4//Fo4WfgdBkLuulvl/Gw3TUzJNQHvgpaiNo9+PI5CZydHnZbjUkRikS12pT+CbNKj+0QKeQztbCd41aKxDv5H0DjltVRcpPppv4dmiU/zoCAIngWLO1PPgfYWyze8Z9IoyBT7Qdg30U91TYZBuxzXR5lq7Fh64y/IZ/SjdOdSIvIuDjtmJDULRdLJzrvubrKY+YH Generated-by-Nova", occi.compute.userdata="I2Nsb3VkLWNvbmZpZwoKIyBVcGdyYWRlIHRoZSBpbnN0YW5jZSBvbiBmaXJzdCBib290CiMgKGllIHJ1biBhcHQtZ2V0IHVwZ3JhZGUpCiMKIyBEZWZhdWx0OiBmYWxzZQojIEFsaWFzZXM6IGFwdF91cGdyYWRlCnBhY2thZ2VfdXBncmFkZTogdHJ1ZQoKcGFja2FnZXM6CiAtIHB5dGhvbgoKd3JpdGVfZmlsZXM6CiAgLSBwYXRoOiAvZXRjL25ldHdvcmsvaW50ZXJmYWNlcy5kLzUwLWNsb3VkLWluaXQuY2ZnCiAgICBjb250ZW50OiB8CiAgICAgIGF1dG8gbG8KICAgICAgaWZhY2UgbG8gaW5ldCBsb29wYmFjawogICAgICAKICAgICAgYXV0byBlbnMwCiAgICAgIGFsbG93LWhvdHBsdWcgZW5zMAogICAgICBpZmFjZSBlbnMwIGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnMxCiAgICAgIGFsbG93LWhvdHBsdWcgZW5zMQogICAgICBpZmFjZSBlbnMxIGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnMyCiAgICAgIGFsbG93LWhvdHBsdWcgZW5zMgogICAgICBpZmFjZSBlbnMyIGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnMzCiAgICAgIGFsbG93LWhvdHBsdWcgZW5zMwogICAgICBpZmFjZSBlbnMzIGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM0CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zNAogICAgICBpZmFjZSBlbnM0IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM1CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zNQogICAgICBpZmFjZSBlbnM1IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM2CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zNgogICAgICBpZmFjZSBlbnM2IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM3CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zNwogICAgICBpZmFjZSBlbnM3IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM4CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zOAogICAgICBpZmFjZSBlbnM4IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM5CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zOQogICAgICBpZmFjZSBlbnM5IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnMxMAogICAgICBhbGxvdy1ob3RwbHVnIGVuczEwCiAgICAgIGlmYWNlIGVuczEwIGluZXQgZGhjcAoKIyMj"'
2019-01-23 14:56:47 INFO Executor:329 - PUT http://localhost:8080/dataprocessor/urn:uuid:1bda25ab-723b-47e7-9704-5134db26ebdc/ -H 'Content-Type: text/occi' -H 'Category: dataprocessor; scheme="http://schemas.ugoe.cs.rwm/monitoring#"; class="kind", cpuprocessor; scheme="http://schemas.modmacao.org/usermixins#"; class="mixin"' -H 'X-OCCI-Attribute:occi.core.id="urn:uuid:1bda25ab-723b-47e7-9704-5134db26ebdc", occi.core.title="CPUAggregator"'
2019-01-23 14:56:47 INFO Executor:329 - PUT http://localhost:8080/resultprovider/urn:uuid:588f705e-5279-4847-9337-846af2c86972/ -H 'Content-Type: text/occi' -H 'Category: resultprovider; scheme="http://schemas.ugoe.cs.rwm/monitoring#"; class="kind", cpupublisher; scheme="http://schemas.modmacao.org/usermixins#"; class="mixin", occiresultprovider; scheme="http://schemas.ugoe.cs.rwm/monitoring#"; class="mixin"' -H 'X-OCCI-Attribute:occi.core.id="urn:uuid:588f705e-5279-4847-9337-846af2c86972", occi.core.title="CPUProvider", result.provider.endpoint="192.168.35.45:8080"'
2019-01-23 14:56:47 INFO Executor:329 - PUT http://localhost:8080/component/urn:uuid:f934d445-d0c8-4f2f-8086-d9f1a8255897/ -H 'Content-Type: text/occi' -H 'Category: component; scheme="http://schemas.modmacao.org/occi/platform#"; class="kind", hmaster; scheme="http://schemas.modmacao.org/usermixins#"; class="mixin"' -H 'X-OCCI-Attribute:occi.core.id="urn:uuid:f934d445-d0c8-4f2f-8086-d9f1a8255897", occi.core.title="HMaster", occi.core.summary="", occi.component.state="undeployed", occi.component.state.message=""'
2019-01-23 14:56:47 INFO Executor:329 - PUT http://localhost:8080/datagatherer/urn:uuid:051affdc-d686-48f8-884c-83fe81718a48/ -H 'Content-Type: text/occi' -H 'Category: datagatherer; scheme="http://schemas.ugoe.cs.rwm/monitoring#"; class="kind", cpugatherer; scheme="http://schemas.modmacao.org/usermixins#"; class="mixin"' -H 'X-OCCI-Attribute:occi.core.id="urn:uuid:051affdc-d686-48f8-884c-83fe81718a48", occi.core.title="Glances"'
2019-01-23 14:56:47 INFO Executor:329 - PUT http://localhost:8080/application/urn:uuid:a4888ba9-a0ea-48f2-a29e-901c876ab42d -H 'Content-Type: text/occi' -H 'Category: application; scheme="http://schemas.modmacao.org/occi/platform#"; class="kind"' -H 'X-OCCI-Attribute:occi.core.id="urn:uuid:a4888ba9-a0ea-48f2-a29e-901c876ab42d", occi.core.title="Hadoopcluster"'
2019-01-23 14:56:47 INFO Executor:329 - PUT http://localhost:8080/compute/urn:uuid:2e6a73d0-faaa-476a-bd25-ca461dd166cf/ -H 'Content-Type: text/occi' -H 'Category: compute; scheme="http://schemas.ogf.org/occi/infrastructure#"; class="kind", ssh_key; scheme="http://schemas.ogf.org/occi/infrastructure/credentials#"; class="mixin", user_data; scheme="http://schemas.ogf.org/occi/infrastructure/compute#"; class="mixin", ubuntu_xenialxerus; scheme="http://schemas.modmacao.org/openstack/swe#"; class="mixin"' -H 'X-OCCI-Attribute:occi.core.id="urn:uuid:2e6a73d0-faaa-476a-bd25-ca461dd166cf", occi.core.title="Hadoop-worker-1", occi.core.summary="", occi.compute.architecture="x86", occi.compute.cores="2", occi.compute.hostname="hadoop-worker-1", occi.compute.share="0", occi.compute.speed="0", occi.compute.memory="4096", occi.compute.state="active", occi.compute.state.message="", occi.credentials.ssh.publickey="ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC6H7Ydi45BTHid4qNppGAi5mzjbnZgt7bi6xLGmZG9CiLmhMsxOuk3Z05Nn+pmoN98qS0eY8S240PPk5VOlYqBY0vdRAwrZSHHaLdMp6I7ARNrI2KraYduweqz7ZQxPXQfwIeYx2HKQxEF2r+4//Fo4WfgdBkLuulvl/Gw3TUzJNQHvgpaiNo9+PI5CZydHnZbjUkRikS12pT+CbNKj+0QKeQztbCd41aKxDv5H0DjltVRcpPppv4dmiU/zoCAIngWLO1PPgfYWyze8Z9IoyBT7Qdg30U91TYZBuxzXR5lq7Fh64y/IZ/SjdOdSIvIuDjtmJDULRdLJzrvubrKY+YH Generated-by-Nova", occi.compute.userdata="I2Nsb3VkLWNvbmZpZwoKIyBVcGdyYWRlIHRoZSBpbnN0YW5jZSBvbiBmaXJzdCBib290CiMgKGllIHJ1biBhcHQtZ2V0IHVwZ3JhZGUpCiMKIyBEZWZhdWx0OiBmYWxzZQojIEFsaWFzZXM6IGFwdF91cGdyYWRlCnBhY2thZ2VfdXBncmFkZTogdHJ1ZQoKcGFja2FnZXM6CiAtIHB5dGhvbgoKd3JpdGVfZmlsZXM6CiAgLSBwYXRoOiAvZXRjL25ldHdvcmsvaW50ZXJmYWNlcy5kLzUwLWNsb3VkLWluaXQuY2ZnCiAgICBjb250ZW50OiB8CiAgICAgIGF1dG8gbG8KICAgICAgaWZhY2UgbG8gaW5ldCBsb29wYmFjawogICAgICAKICAgICAgYXV0byBlbnMwCiAgICAgIGFsbG93LWhvdHBsdWcgZW5zMAogICAgICBpZmFjZSBlbnMwIGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnMxCiAgICAgIGFsbG93LWhvdHBsdWcgZW5zMQogICAgICBpZmFjZSBlbnMxIGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnMyCiAgICAgIGFsbG93LWhvdHBsdWcgZW5zMgogICAgICBpZmFjZSBlbnMyIGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnMzCiAgICAgIGFsbG93LWhvdHBsdWcgZW5zMwogICAgICBpZmFjZSBlbnMzIGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM0CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zNAogICAgICBpZmFjZSBlbnM0IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM1CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zNQogICAgICBpZmFjZSBlbnM1IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM2CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zNgogICAgICBpZmFjZSBlbnM2IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM3CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zNwogICAgICBpZmFjZSBlbnM3IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM4CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zOAogICAgICBpZmFjZSBlbnM4IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM5CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zOQogICAgICBpZmFjZSBlbnM5IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnMxMAogICAgICBhbGxvdy1ob3RwbHVnIGVuczEwCiAgICAgIGlmYWNlIGVuczEwIGluZXQgZGhjcAoKIyMj"'
2019-01-23 14:56:47 INFO Executor:329 - PUT http://localhost:8080/sensor/urn:uuid:efb0f50a-7a7c-4153-b939-4846d6554dbb/ -H 'Content-Type: text/occi' -H 'Category: sensor; scheme="http://schemas.ugoe.cs.rwm/monitoring#"; class="kind"' -H 'X-OCCI-Attribute:occi.core.id="urn:uuid:efb0f50a-7a7c-4153-b939-4846d6554dbb", occi.core.title="CPUSensor", occi.core.summary="", occi.app.state="undeployed", occi.app.state.message=""'
2019-01-23 14:56:47 INFO Executor:329 - PUT http://localhost:8080/compute/urn:uuid:37829092-c690-494a-98fa-335b2fd660ea/ -H 'Content-Type: text/occi' -H 'Category: compute; scheme="http://schemas.ogf.org/occi/infrastructure#"; class="kind", ssh_key; scheme="http://schemas.ogf.org/occi/infrastructure/credentials#"; class="mixin", user_data; scheme="http://schemas.ogf.org/occi/infrastructure/compute#"; class="mixin", ubuntu_xenialxerus; scheme="http://schemas.modmacao.org/openstack/swe#"; class="mixin"' -H 'X-OCCI-Attribute:occi.core.id="urn:uuid:37829092-c690-494a-98fa-335b2fd660ea", occi.core.title="MonVm", occi.core.summary="", occi.compute.architecture="x86", occi.compute.cores="2", occi.compute.hostname="monVM", occi.compute.share="0", occi.compute.speed="0", occi.compute.memory="4096", occi.compute.state="active", occi.compute.state.message="", occi.credentials.ssh.publickey="ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC6H7Ydi45BTHid4qNppGAi5mzjbnZgt7bi6xLGmZG9CiLmhMsxOuk3Z05Nn+pmoN98qS0eY8S240PPk5VOlYqBY0vdRAwrZSHHaLdMp6I7ARNrI2KraYduweqz7ZQxPXQfwIeYx2HKQxEF2r+4//Fo4WfgdBkLuulvl/Gw3TUzJNQHvgpaiNo9+PI5CZydHnZbjUkRikS12pT+CbNKj+0QKeQztbCd41aKxDv5H0DjltVRcpPppv4dmiU/zoCAIngWLO1PPgfYWyze8Z9IoyBT7Qdg30U91TYZBuxzXR5lq7Fh64y/IZ/SjdOdSIvIuDjtmJDULRdLJzrvubrKY+YH Generated-by-Nova", occi.compute.userdata="I2Nsb3VkLWNvbmZpZwoKIyBVcGdyYWRlIHRoZSBpbnN0YW5jZSBvbiBmaXJzdCBib290CiMgKGllIHJ1biBhcHQtZ2V0IHVwZ3JhZGUpCiMKIyBEZWZhdWx0OiBmYWxzZQojIEFsaWFzZXM6IGFwdF91cGdyYWRlCnBhY2thZ2VfdXBncmFkZTogdHJ1ZQoKcGFja2FnZXM6CiAtIHB5dGhvbgoKd3JpdGVfZmlsZXM6CiAgLSBwYXRoOiAvZXRjL25ldHdvcmsvaW50ZXJmYWNlcy5kLzUwLWNsb3VkLWluaXQuY2ZnCiAgICBjb250ZW50OiB8CiAgICAgIGF1dG8gbG8KICAgICAgaWZhY2UgbG8gaW5ldCBsb29wYmFjawogICAgICAKICAgICAgYXV0byBlbnMwCiAgICAgIGFsbG93LWhvdHBsdWcgZW5zMAogICAgICBpZmFjZSBlbnMwIGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnMxCiAgICAgIGFsbG93LWhvdHBsdWcgZW5zMQogICAgICBpZmFjZSBlbnMxIGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnMyCiAgICAgIGFsbG93LWhvdHBsdWcgZW5zMgogICAgICBpZmFjZSBlbnMyIGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnMzCiAgICAgIGFsbG93LWhvdHBsdWcgZW5zMwogICAgICBpZmFjZSBlbnMzIGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM0CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zNAogICAgICBpZmFjZSBlbnM0IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM1CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zNQogICAgICBpZmFjZSBlbnM1IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM2CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zNgogICAgICBpZmFjZSBlbnM2IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM3CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zNwogICAgICBpZmFjZSBlbnM3IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM4CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zOAogICAgICBpZmFjZSBlbnM4IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM5CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zOQogICAgICBpZmFjZSBlbnM5IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnMxMAogICAgICBhbGxvdy1ob3RwbHVnIGVuczEwCiAgICAgIGlmYWNlIGVuczEwIGluZXQgZGhjcAoKIyMj"'
2019-01-23 14:56:47 INFO Executor:329 - PUT http://localhost:8080/network/urn:uuid:29d78078-fb4c-47aa-a9af-b8aaf3339590/ -H 'Content-Type: text/occi' -H 'Category: network; scheme="http://schemas.ogf.org/occi/infrastructure#"; class="kind", runtimeid; scheme="http://schemas.modmacao.org/openstack/runtime#"; class="mixin"' -H 'X-OCCI-Attribute:occi.core.id="urn:uuid:29d78078-fb4c-47aa-a9af-b8aaf3339590", occi.core.title="Management Network", openstack.runtime.id="75a4639e-9ce7-4058-b859-8a711b0e2e7b"'
2019-01-23 14:56:47 INFO Executor:329 - PUT http://localhost:8080/component/urn:uuid:f934d445-d0c8-4f2f-8086-d9f1a8255896/ -H 'Content-Type: text/occi' -H 'Category: component; scheme="http://schemas.modmacao.org/occi/platform#"; class="kind", hjob; scheme="http://schemas.modmacao.org/usermixins#"; class="mixin"' -H 'X-OCCI-Attribute:occi.core.id="urn:uuid:f934d445-d0c8-4f2f-8086-d9f1a8255896", occi.core.title="HJob", occi.core.summary="", occi.component.state="undeployed", occi.component.state.message=""'
2019-01-23 14:56:47 ERROR Executor:122 - Failed: http://localhost:8080/dataprocessor/urn:uuid:1bda25ab-723b-47e7-9704-5134db26ebdc/ HTTP error code: 500
2019-01-23 14:56:47 INFO Executor:74 - PUT Failed: CPUAggregator Rerequest in 5s!
2019-01-23 14:56:47 ERROR Executor:122 - Failed: http://localhost:8080/component/urn:uuid:f934d445-d0c8-4f2f-8086-d9f1a8255897/ HTTP error code: 500
2019-01-23 14:56:47 INFO Executor:74 - PUT Failed: HMaster Rerequest in 5s!
2019-01-23 14:56:47 INFO Executor:329 - PUT http://localhost:8080/componentlink/urn:uuid:7890f02b-6f56-4809-865f-d8c686fd9da1 -H 'Content-Type: text/occi' -H 'Category: componentlink; scheme="http://schemas.modmacao.org/occi/platform#"; class="kind"' -H 'X-OCCI-Attribute:occi.core.source="/application/urn:uuid:a4888ba9-a0ea-48f2-a29e-901c876ab42d",occi.core.target="/component/urn:uuid:f934d445-d0c8-4f2f-8086-d9f1a8255898/",occi.core.id="urn:uuid:7890f02b-6f56-4809-865f-d8c686fd9da1", occi.core.title="link4"'
2019-01-23 14:56:47 INFO Executor:329 - PUT http://localhost:8080/componentlink/urn:uuid:04cf6483-706d-4a2a-9114-9918ab2bb52a/ -H 'Content-Type: text/occi' -H 'Category: componentlink; scheme="http://schemas.modmacao.org/occi/platform#"; class="kind"' -H 'X-OCCI-Attribute:occi.core.source="/sensor/urn:uuid:efb0f50a-7a7c-4153-b939-4846d6554dbb/",occi.core.target="/datagatherer/urn:uuid:051affdc-d686-48f8-884c-83fe81718a48/",occi.core.id="urn:uuid:04cf6483-706d-4a2a-9114-9918ab2bb52a", occi.core.title="link1"'
2019-01-23 14:56:47 INFO Executor:329 - PUT http://localhost:8080/componentlink/urn:uuid:93f08e31-f350-42b7-a73b-c139eba4a8e3/ -H 'Content-Type: text/occi' -H 'Category: componentlink; scheme="http://schemas.modmacao.org/occi/platform#"; class="kind"' -H 'X-OCCI-Attribute:occi.core.source="/sensor/urn:uuid:efb0f50a-7a7c-4153-b939-4846d6554dbb/",occi.core.target="/resultprovider/urn:uuid:588f705e-5279-4847-9337-846af2c86972/",occi.core.id="urn:uuid:93f08e31-f350-42b7-a73b-c139eba4a8e3", occi.core.title="link3"'
2019-01-23 14:56:52 INFO Executor:329 - PUT http://localhost:8080/dataprocessor/urn:uuid:1bda25ab-723b-47e7-9704-5134db26ebdc/ -H 'Content-Type: text/occi' -H 'Category: dataprocessor; scheme="http://schemas.ugoe.cs.rwm/monitoring#"; class="kind", cpuprocessor; scheme="http://schemas.modmacao.org/usermixins#"; class="mixin"' -H 'X-OCCI-Attribute:occi.core.id="urn:uuid:1bda25ab-723b-47e7-9704-5134db26ebdc", occi.core.title="CPUAggregator"'
2019-01-23 14:56:52 INFO Executor:329 - PUT http://localhost:8080/componentlink/urn:uuid:9551c357-59f8-4ac1-8c85-0e886e206b80/ -H 'Content-Type: text/occi' -H 'Category: componentlink; scheme="http://schemas.modmacao.org/occi/platform#"; class="kind"' -H 'X-OCCI-Attribute:occi.core.source="/resultprovider/urn:uuid:588f705e-5279-4847-9337-846af2c86972/",occi.core.target="/dataprocessor/urn:uuid:1bda25ab-723b-47e7-9704-5134db26ebdc/",occi.core.id="urn:uuid:9551c357-59f8-4ac1-8c85-0e886e206b80", occi.core.title="link1"'
2019-01-23 14:56:52 INFO Executor:329 - PUT http://localhost:8080/componentlink/urn:uuid:1a821776-7886-4cb4-8b80-46a8403acf40/ -H 'Content-Type: text/occi' -H 'Category: componentlink; scheme="http://schemas.modmacao.org/occi/platform#"; class="kind"' -H 'X-OCCI-Attribute:occi.core.source="/dataprocessor/urn:uuid:1bda25ab-723b-47e7-9704-5134db26ebdc/",occi.core.target="/datagatherer/urn:uuid:051affdc-d686-48f8-884c-83fe81718a48/",occi.core.id="urn:uuid:1a821776-7886-4cb4-8b80-46a8403acf40", occi.core.title="link1"'
2019-01-23 14:56:52 INFO Executor:329 - PUT http://localhost:8080/componentlink/urn:uuid:9c604867-3135-4fa1-af9e-2bb11018ff5a/ -H 'Content-Type: text/occi' -H 'Category: componentlink; scheme="http://schemas.modmacao.org/occi/platform#"; class="kind"' -H 'X-OCCI-Attribute:occi.core.source="/sensor/urn:uuid:efb0f50a-7a7c-4153-b939-4846d6554dbb/",occi.core.target="/dataprocessor/urn:uuid:1bda25ab-723b-47e7-9704-5134db26ebdc/",occi.core.id="urn:uuid:9c604867-3135-4fa1-af9e-2bb11018ff5a", occi.core.title="link2"'
2019-01-23 14:56:52 INFO Executor:329 - PUT http://localhost:8080/component/urn:uuid:f934d445-d0c8-4f2f-8086-d9f1a8255897/ -H 'Content-Type: text/occi' -H 'Category: component; scheme="http://schemas.modmacao.org/occi/platform#"; class="kind", hmaster; scheme="http://schemas.modmacao.org/usermixins#"; class="mixin"' -H 'X-OCCI-Attribute:occi.core.id="urn:uuid:f934d445-d0c8-4f2f-8086-d9f1a8255897", occi.core.title="HMaster", occi.core.summary="", occi.component.state="undeployed", occi.component.state.message=""'
2019-01-23 14:56:52 INFO Executor:329 - PUT http://localhost:8080/componentlink/urn:uuid:9aa31c50-c605-4370-aa60-2c7c461051ef -H 'Content-Type: text/occi' -H 'Category: componentlink; scheme="http://schemas.modmacao.org/occi/platform#"; class="kind"' -H 'X-OCCI-Attribute:occi.core.source="/application/urn:uuid:a4888ba9-a0ea-48f2-a29e-901c876ab42d",occi.core.target="/component/urn:uuid:f934d445-d0c8-4f2f-8086-d9f1a8255897/",occi.core.id="urn:uuid:9aa31c50-c605-4370-aa60-2c7c461051ef", occi.core.title="ComponentLink"'
2019-01-23 14:56:57 INFO Executor:154 - GET http://localhost:8080/network/urn:uuid:7a9fca2c-24fb-473c-aa9c-8dc9e68a432a/
2019-01-23 14:56:57 INFO Executor:154 - GET http://localhost:8080/compute/urn:uuid:2e6a73d0-faaa-476a-bd25-ca461dd166cf/
2019-01-23 14:56:57 INFO Executor:154 - GET http://localhost:8080/compute/urn:uuid:37829092-c690-494a-98fa-335b2fd660ea/
2019-01-23 14:56:57 INFO Executor:154 - GET http://localhost:8080/network/urn:uuid:29d78078-fb4c-47aa-a9af-b8aaf3339591/
2019-01-23 14:56:57 INFO Executor:154 - GET http://localhost:8080/compute/urn:uuid:2e6a73d0-faaa-476a-bd25-ca461dd166ce/
2019-01-23 14:56:57 INFO Executor:329 - PUT http://localhost:8080/networkinterface/urn:uuid:356f7b59-69a7-4df1-9ab5-c0a46b49b9d1/ -H 'Content-Type: text/occi' -H 'Category: networkinterface; scheme="http://schemas.ogf.org/occi/infrastructure#"; class="kind", ansibleendpoint; scheme="http://schemas.modmacao.org/occi/ansible#"; class="mixin", ipnetworkinterface; scheme="http://schemas.ogf.org/occi/infrastructure/networkinterface#"; class="mixin"' -H 'X-OCCI-Attribute:occi.core.source="/compute/urn:uuid:2e6a73d0-faaa-476a-bd25-ca461dd166cf/",occi.core.target="/network/urn:uuid:29d78078-fb4c-47aa-a9af-b8aaf3339590/",occi.core.id="urn:uuid:356f7b59-69a7-4df1-9ab5-c0a46b49b9d1", occi.core.title="Hadoop-worker-1 -> Management Network"'
2019-01-23 14:56:57 INFO Executor:329 - PUT http://localhost:8080/placementlink/urn:uuid:ff292f08-d263-41b6-88c8-84d33783b917/ -H 'Content-Type: text/occi' -H 'Category: placementlink; scheme="http://schemas.modmacao.org/placement#"; class="kind"' -H 'X-OCCI-Attribute:occi.core.source="/component/urn:uuid:f934d445-d0c8-4f2f-8086-d9f1a8255898/",occi.core.target="/compute/urn:uuid:2e6a73d0-faaa-476a-bd25-ca461dd166cf/",occi.core.id="urn:uuid:ff292f08-d263-41b6-88c8-84d33783b917", occi.core.title="link1"'
2019-01-23 14:56:57 INFO Executor:329 - PUT http://localhost:8080/placementlink/urn:uuid:ff292f08-d263-41b6-88c8-84d33783b928/ -H 'Content-Type: text/occi' -H 'Category: placementlink; scheme="http://schemas.modmacao.org/placement#"; class="kind"' -H 'X-OCCI-Attribute:occi.core.source="/component/urn:uuid:f934d445-d0c8-4f2f-8086-d9f1a8255897/",occi.core.target="/compute/urn:uuid:2e6a73d0-faaa-476a-bd25-ca461dd166ce/",occi.core.id="urn:uuid:ff292f08-d263-41b6-88c8-84d33783b928", occi.core.title="link1"'
2019-01-23 14:56:57 INFO Executor:329 - PUT http://localhost:8080/networkinterface/urn:uuid:3b458e77-f136-426c-90c4-97fce19c8ae8/ -H 'Content-Type: text/occi' -H 'Category: networkinterface; scheme="http://schemas.ogf.org/occi/infrastructure#"; class="kind", ansibleendpoint; scheme="http://schemas.modmacao.org/occi/ansible#"; class="mixin", ipnetworkinterface; scheme="http://schemas.ogf.org/occi/infrastructure/networkinterface#"; class="mixin"' -H 'X-OCCI-Attribute:occi.core.source="/compute/urn:uuid:2e6a73d0-faaa-476a-bd25-ca461dd166ce/",occi.core.target="/network/urn:uuid:29d78078-fb4c-47aa-a9af-b8aaf3339590/",occi.core.id="urn:uuid:3b458e77-f136-426c-90c4-97fce19c8ae8", occi.core.title="Hadoop-master -> Management Network"'
2019-01-23 14:56:57 INFO Executor:329 - PUT http://localhost:8080/placementlink/urn:uuid:275b5bce-084c-46f0-88bc-1f6f31bf3616/ -H 'Content-Type: text/occi' -H 'Category: placementlink; scheme="http://schemas.modmacao.org/placement#"; class="kind"' -H 'X-OCCI-Attribute:occi.core.source="/resultprovider/urn:uuid:588f705e-5279-4847-9337-846af2c86972/",occi.core.target="/compute/urn:uuid:37829092-c690-494a-98fa-335b2fd660ea/",occi.core.id="urn:uuid:275b5bce-084c-46f0-88bc-1f6f31bf3616", occi.core.title="link2"'
2019-01-23 14:56:57 INFO Executor:329 - PUT http://localhost:8080/placementlink/urn:uuid:ff7019e4-a9dc-48dc-83c3-ab77714a25f4/ -H 'Content-Type: text/occi' -H 'Category: placementlink; scheme="http://schemas.modmacao.org/placement#"; class="kind"' -H 'X-OCCI-Attribute:occi.core.source="/dataprocessor/urn:uuid:1bda25ab-723b-47e7-9704-5134db26ebdc/",occi.core.target="/compute/urn:uuid:37829092-c690-494a-98fa-335b2fd660ea/",occi.core.id="urn:uuid:ff7019e4-a9dc-48dc-83c3-ab77714a25f4", occi.core.title="link2"'
2019-01-23 14:56:57 INFO Executor:329 - PUT http://localhost:8080/placementlink/urn:uuid:60cc05ca-4fd7-465b-8fd0-945dcbf8867f/ -H 'Content-Type: text/occi' -H 'Category: placementlink; scheme="http://schemas.modmacao.org/placement#"; class="kind"' -H 'X-OCCI-Attribute:occi.core.source="/datagatherer/urn:uuid:051affdc-d686-48f8-884c-83fe81718a48/",occi.core.target="/compute/urn:uuid:2e6a73d0-faaa-476a-bd25-ca461dd166cf/",occi.core.id="urn:uuid:60cc05ca-4fd7-465b-8fd0-945dcbf8867f", occi.core.title="link1"'
2019-01-23 14:56:57 INFO Executor:329 - PUT http://localhost:8080/networkinterface/urn:uuid:ea482951-5c26-471d-aa1b-8e03b1e6096c -H 'Content-Type: text/occi' -H 'Category: networkinterface; scheme="http://schemas.ogf.org/occi/infrastructure#"; class="kind", ipnetworkinterface; scheme="http://schemas.ogf.org/occi/infrastructure/networkinterface#"; class="mixin"' -H 'X-OCCI-Attribute:occi.core.source="/compute/urn:uuid:2e6a73d0-faaa-476a-bd25-ca461dd166ce/",occi.core.target="/network/urn:uuid:29d78078-fb4c-47aa-a9af-b8aaf3339591/",occi.core.id="urn:uuid:ea482951-5c26-471d-aa1b-8e03b1e6096c", occi.core.title="link3", occi.networkinterface.address="10.254.1.5"'
2019-01-23 14:56:57 INFO Executor:329 - PUT http://localhost:8080/networkinterface/urn:uuid:03f91178-136f-4023-876e-84509f8a5a2d/ -H 'Content-Type: text/occi' -H 'Category: networkinterface; scheme="http://schemas.ogf.org/occi/infrastructure#"; class="kind", ipnetworkinterface; scheme="http://schemas.ogf.org/occi/infrastructure/networkinterface#"; class="mixin"' -H 'X-OCCI-Attribute:occi.core.source="/compute/urn:uuid:2e6a73d0-faaa-476a-bd25-ca461dd166cf/",occi.core.target="/network/urn:uuid:7a9fca2c-24fb-473c-aa9c-8dc9e68a432a/",occi.core.id="urn:uuid:03f91178-136f-4023-876e-84509f8a5a2d", occi.core.title="monNwLink", occi.networkinterface.address="100.254.1.35"'
2019-01-23 14:56:57 INFO Executor:329 - PUT http://localhost:8080/networkinterface/urn:uuid:c8c49905-3d5e-43b2-8d09-fabf92d29722 -H 'Content-Type: text/occi' -H 'Category: networkinterface; scheme="http://schemas.ogf.org/occi/infrastructure#"; class="kind", ipnetworkinterface; scheme="http://schemas.ogf.org/occi/infrastructure/networkinterface#"; class="mixin"' -H 'X-OCCI-Attribute:occi.core.source="/compute/urn:uuid:2e6a73d0-faaa-476a-bd25-ca461dd166cf/",occi.core.target="/network/urn:uuid:29d78078-fb4c-47aa-a9af-b8aaf3339591/",occi.core.id="urn:uuid:c8c49905-3d5e-43b2-8d09-fabf92d29722", occi.core.title="link2", occi.networkinterface.address="10.254.1.8"'
2019-01-23 14:56:57 INFO Executor:329 - PUT http://localhost:8080/networkinterface/urn:uuid:00d6889d-b644-44bf-af13-3fe350e926ed/ -H 'Content-Type: text/occi' -H 'Category: networkinterface; scheme="http://schemas.ogf.org/occi/infrastructure#"; class="kind", ipnetworkinterface; scheme="http://schemas.ogf.org/occi/infrastructure/networkinterface#"; class="mixin"' -H 'X-OCCI-Attribute:occi.core.source="/compute/urn:uuid:37829092-c690-494a-98fa-335b2fd660ea/",occi.core.target="/network/urn:uuid:7a9fca2c-24fb-473c-aa9c-8dc9e68a432a/",occi.core.id="urn:uuid:00d6889d-b644-44bf-af13-3fe350e926ed", occi.core.title="link1"'
2019-01-23 14:56:57 INFO Executor:329 - PUT http://localhost:8080/monitorableproperty/urn:uuid:ba16f4ee-1601-4192-a259-eae4274aed72/ -H 'Content-Type: text/occi' -H 'Category: monitorableproperty; scheme="http://schemas.ugoe.cs.rwm/monitoring#"; class="kind"' -H 'X-OCCI-Attribute:occi.core.source="/sensor/urn:uuid:efb0f50a-7a7c-4153-b939-4846d6554dbb/",occi.core.target="/compute/urn:uuid:2e6a73d0-faaa-476a-bd25-ca461dd166cf/",occi.core.id="urn:uuid:ba16f4ee-1601-4192-a259-eae4274aed72", occi.core.title="CPU", monitoring.property="CPU"'
2019-01-23 14:56:57 INFO Executor:329 - PUT http://localhost:8080/placementlink/urn:uuid:ff292f08-d263-41b6-88c8-84d33783b929/ -H 'Content-Type: text/occi' -H 'Category: placementlink; scheme="http://schemas.modmacao.org/placement#"; class="kind"' -H 'X-OCCI-Attribute:occi.core.source="/component/urn:uuid:f934d445-d0c8-4f2f-8086-d9f1a8255896/",occi.core.target="/compute/urn:uuid:2e6a73d0-faaa-476a-bd25-ca461dd166ce/",occi.core.id="urn:uuid:ff292f08-d263-41b6-88c8-84d33783b929", occi.core.title="link1"'
2019-01-23 14:56:57 INFO Executor:329 - PUT http://localhost:8080/networkinterface/urn:uuid:22338480-0fc3-4a7a-bf36-806f2ec600fb/ -H 'Content-Type: text/occi' -H 'Category: networkinterface; scheme="http://schemas.ogf.org/occi/infrastructure#"; class="kind", ansibleendpoint; scheme="http://schemas.modmacao.org/occi/ansible#"; class="mixin", ipnetworkinterface; scheme="http://schemas.ogf.org/occi/infrastructure/networkinterface#"; class="mixin"' -H 'X-OCCI-Attribute:occi.core.source="/compute/urn:uuid:37829092-c690-494a-98fa-335b2fd660ea/",occi.core.target="/network/urn:uuid:29d78078-fb4c-47aa-a9af-b8aaf3339590/",occi.core.id="urn:uuid:22338480-0fc3-4a7a-bf36-806f2ec600fb", occi.core.title="MonVm -> Management Network"'
2019-01-23 14:56:58 INFO Executor:105 - POST http://localhost:8080/application/urn:uuid:a4888ba9-a0ea-48f2-a29e-901c876ab42d?action=deploy -H 'Content-Type: text/occi' -H 'Category: deploy; scheme="http://schemas.modmacao.org/occi/platform/application/action#"; class="action"'
2019-01-23 14:56:58 INFO Executor:105 - POST http://localhost:8080/application/urn:uuid:a4888ba9-a0ea-48f2-a29e-901c876ab42d?action=configure -H 'Content-Type: text/occi' -H 'Category: configure; scheme="http://schemas.modmacao.org/occi/platform/application/action#"; class="action"'
2019-01-23 14:56:58 INFO Executor:105 - POST http://localhost:8080/application/urn:uuid:a4888ba9-a0ea-48f2-a29e-901c876ab42d?action=start -H 'Content-Type: text/occi' -H 'Category: start; scheme="http://schemas.modmacao.org/occi/platform/application/action#"; class="action"'
2019-01-23 14:56:58 INFO Executor:105 - POST http://localhost:8080/sensor/urn:uuid:efb0f50a-7a7c-4153-b939-4846d6554dbb/?action=deploy -H 'Content-Type: text/occi' -H 'Category: deploy; scheme="http://schemas.modmacao.org/occi/platform/application/action#"; class="action"'
2019-01-23 14:56:58 INFO Executor:105 - POST http://localhost:8080/sensor/urn:uuid:efb0f50a-7a7c-4153-b939-4846d6554dbb/?action=configure -H 'Content-Type: text/occi' -H 'Category: configure; scheme="http://schemas.modmacao.org/occi/platform/application/action#"; class="action"'
2019-01-23 14:56:58 INFO Executor:105 - POST http://localhost:8080/sensor/urn:uuid:efb0f50a-7a7c-4153-b939-4846d6554dbb/?action=start -H 'Content-Type: text/occi' -H 'Category: start; scheme="http://schemas.modmacao.org/occi/platform/application/action#"; class="action"'
2019-01-23 14:56:58 INFO Executor:378 - GET http://localhost:8080/resultprovider
```
\ No newline at end of file
# Setting up the MartServer to be used in OpenStack
To manage a cloud deployment using the MartServer it has to be deployed on Virtual Machine within the cloud that has to be connected to a management network.
## Configuring the MartServer in the Cloud
First you need to setup a Virtual Machine hosting the MartServer:
1. Start a Virtual Machine (we used an Ubuntu 16.04 image)
2. Insert the OpenStack Controller IP in /etc/hosts. For example: 192.168.34.1 controller.
3. Install [ansible](https://docs.ansible.com/) on the machine running the MART Server.
4. Deploy either the Docker container or export the MartServer project.
Moreover, a management network is required over which the MartServer connects to spawned Virtual Machines:
1. Create a network
2. Attach the MartServer VM to the network
A figure depicting the general setup is shown below:
<img src="./Martoverview.jpg" width="500">
## Extension adjustments
When performing the proposed approach in a cloud, some connectors have to be configured to gain access to specific information, e.g., user credentials.
Moreover, each cloud provider has different entry points for their API and may have different kinds of offers regarding their offered vm images and flavors.
### Configuration Tool Adjustments
To use the configuration management tools of MoDMaCAO some adjustments have to be performed.
These adjustments configure the path to the ansible roles located on the MART server, as well as the location of the playbook.
Moreover, the ansible user and the location of the private key to be used have to be configured.
The settings itself can be found at martserver-plugins/org.modmacao.cm.jar in the ansible.properties file.
An example of this configuraiton is shown in the following Listing:
```
ansible_rolespath = /home/ubuntu/roles
ansible_bin = /usr/bin/ansible-playbook
ansible_user = ubuntu
private_key_path = /home/ubuntu/.ssh/key.pem
```
### Provider specifics
In order to translate the REST requests to requests of the cloud API, the MART server requires a connector for the corresponding cloud.
Therefore, the connector's jar has to be placed in the martserver-plugins folder before the server is started.
Currently, only a prototypical [connector for OpenStack](https://github.com/occiware/MoDMaCAO) is provided as part of the MoDMaCAO framework.
However, also this connector has to be configured.
The settings itself can be found at in martserver-plugins/org.modmacao.openstack.connector.jar in the openstack.properties file. An example is shown in the following Listing:
```
openstack_username = username
openstack_tenant = testTenant
openstack_password = password
openstack_endpoint = http://192.168.34.1:5000/v2.0
openstack_default_network = d52754e0-6729-4034-adbb-8f1f3800f2c6
openstack_default_image = adf63ddc-debe-4d7e-b899-b936e989439f
openstack_default_flavor = 36637a26-fded-4635-b6c5-ec8ec0745eab
```
*Note:* This connector currently only supports version 2 of the openstack authentication service.
*Note:* In our scenarios we have chosen the public network as default network to let spawned VMs download software packages defined within the configuration management scripts.
### Images and Flavors
Each vm possesses a flavor and an image. While the image describes the OS of the compute instance, the flavor describes its size.
Both attributes are depended on the used cloud provider, as they e.g., may offer different kinds of OS. To adjust your model according to this, different offers two approaches can be chosen:
#### Set default values in the connector
As already shown, a standard image and flavor can be configured within the OpenStack Connector.
This means, if no templates are attached to the compute instance regarding its size and OS the default values are used.
Thus, this configuration is rather convenient but limits the used to one kind of image and flavor for all VM used.
#### Create a new OCCI Extension fitting to the provider
If these settings are not enough, an OCCI Extension representing the offer of the cloud provider has to be created.
An example of such an extension is given in martserver-plugins\org.modmacao.openstack.swe.runtime.jar.
In order to create your own extension, we recommend using OCCI-Studio, as it provides not only a Sirius designer for the Extension, but also allows to completely generate the required code from the modeled Extension.
Then, the Extension has only be packed and put into the martserver-plugins folder to be ready for use.
*Note:* When creating a new Extension it has to be registered within the IDE, model, and code.
### User Data Adjustments
User data describes a specific behavior which shall be executed when starting a VM for the first time.
n the OCCI model, the user data is described as a Mixin within each compute resource encoded as Base64.
When encoded the Base64 represents a cloud init script.
This has to be configured in such a manner that hot-plugging of networkinterfaces is allowed in each VM.
These may differ according to the network managing tool of the VM.
Furthermore, Python 2.7 has to be installed on the used VM.
If not already part of the image it can also be installed via cloud init at startup.
Therefore, the following script can be used:
```
#cloud-config
package_upgrade: true
packages:
- python
```
\ No newline at end of file
# Sensor Creation
In this scenario the hadoop cluster model gets enhanced to monitor Memory utilization in addition to CPU utilization of worker nodes.
Therefore, a tree editor in OCCI-Studio is used as described in the following.
## Enhancing the Model for Simulation Purposes
The following description shows how to adapt the initial deployment model using an editor within OCCIWare Studio:
### Starting OCCI-Studio
1. Open the folder OCCI-Studio located on the Desktop
2. Double click on OCCI-Studio to open the IDE
3. Now you should see a checked out version of MOCCI
### Creating a new Modeling Project
1. Right click on the Project Explorer
2. Choose New->Project...
3. Search for Modeling and choose Sirius Modeling Project
4. Press Next and name the project MemMonitoring
5. Copy the de.ugoe.cs.rwm.mocci/src/main/resources/hadoopClusterCPU.occic file from the MOCCI project into the MemMonitoring project
6. Rename the file in your project to hadoopClusterCPUandMem.occic
### Utilizing the Tree Editor
1. Right click on hadoopClusterCPUandMem.occic
2. Choose Open With->OCCI Model Editor
3. Expand the first item, as well as the Configuration it contains
4. Now you can see the hadoop cluster model used for the initial deployment as shown below
![Tree](./tree.jpg "Tree")
### Adding a Memory Sensor to the Model
1. Right click on Configuration->New Child->Resource
1. Open the properties view and set the kind of the new resource to Sensor
2. Right click on the Sensor->New Child->Link
1. Set the kind of the new link to MonitorableProperty
2. Set the target of the link to the compute node it should monitor
3. Right click on the MonitorableProperty->New Child-> Attribute State
1. Name the attribute monitoring.property
2. Set the value of the attribute to Mem
2. Right click on Configuration->New Child->Resource
1. Set the kind of one resource to ResultProvider
3. Right click on Configuration->New Child->Resource
1. Set the kind of the other resource to DataGatherer
4. Create two links within the Resource representing the Sensor recently created: right click New Child->Link
1. Set the kind of both to ComponentLink
2. Set the target of one link to the Resource representing the ResultProvider by choosing its id.
3. Set the target of the other link to the Resource representing the DataGatherer by choosing its id.
5. Save your changes to the model. It should look similar to the model shown below:
![AdjustedTree](./adjustedTree.jpg "AdjustedTree")
### Deploying the adjusted Model
Even though the model currently does not consists of placementlinks for the new monitoring sensor which is required for an deployment in the cloud, it is sufficient to perform the simulation.
To test the enhanced model follow the enumerated instructions. Hereby, the MartServer does not have to be reseted, as the deployment engine compares the runtime model to the input model and performs only the requests required to reach the desired state.
1. Copy the hadoopClusterCPUandMem.occic file to the desktop
2. Open a terminal (Ctrl-Alt-T) and navigate to the desktop (cd Desktop)
3. Start the Mart Server (./startMart.sh)
4. Open another terminal (Ctrl-Alt-T) and navigate to the desktop (cd Desktop)
5. Execute the following command
```
java -jar initialDeployment.jar hadoopClusterCPUandMem.occic
```
This command puts your adjusted model into the models at runtime engine which is also used for the intial deployment.
To start the added sensor execute the following REST request.
The string **sensorid has to be replaced** with the id of the Resource representing the Sensor you added. E.g., *urn:uuid:c2263c17-4b46-44f7-90f7-2036ac12eb03*.
For example, curl can be used by starting another terminal (Ctrl-Alt-T).
```
curl -v -X POST http://localhost:8080/sensor/sensorid/?action=start -H 'Content-Type: text/occi' -H 'Category: start; scheme="http://schemas.modmacao.org/occi/platform/application/action#"; class="action"'
```
Finally, the added Sensors monitorable property should be filled with simulated monitoring data.
This can be checked by investigating the model through the browser or by having a look at the output of the MartServer.
```
http://localhost:8080/monitorableproperty/
```
This time two monitorableproperties should be displayed, one providing monitoring results for CPU and one for Mem.
To adjust the simulation follow the instructions given in the [dummy connector](https://gitlab.gwdg.de/rwm/de.ugoe.cs.rwm.mocci/tree/master/de.ugoe.cs.rwm.mocci.connector.dummy)
### Visualizing the Model
To visualize the model in an graphical Sirius editor the following steps have to be performed:
1. Double click on representation.aird
2. Press Add... in the Models section
3. Choose Browse Workspace...
4. Select MemMonitoring->hadoopClusterCPUandMem.occic
5. Now the Model and its possible representations should been loaded (transparent)
6. Under Representations doubleclick on OCCI Configuratrion/Configuration diagram
7. Next choose Configuration diagram (0) (non-transparent)
8. Select the Configuration element and press Finish
Now a new configuration diagram is shown which has a rather large size. This is due to the large strings contained within the compute nodes.
To reduce the size of the model visualization navigate to the left and collapse the User_Data and SSH information of each compute node. Thereafter, press arrange all in the editor.
Now the cloud deployment is ready to be explored more easily.
*Note:* This editor can also be used to create and adjust OCCI models.
## Adjusting the Model for an actual deployment.
To make the model ready for an actual deployment placementlinks in each component of the sensor has to be added.
Moreover, the individual components have to be tagged with user mixins refering to their configuration management scripts.
Please refer to the [connector documentation](https://gitlab.gwdg.de/rwm/de.ugoe.cs.rwm.mocci/tree/master/de.ugoe.cs.rwm.mocci.connector) of the monitoring extension for more information.
The model for a concrete deployment of a memory monitoring sensor, including its configuration management script, can be found [here](../src/main/resources/hadoopClusterNewExtWithMem.occic).
\ No newline at end of file
# Setting up OCCI-Studio
## Downloading OCCI-Studio
1. Download the [latest release of OCCI-Studio](https://github.com/occiware/OCCI-Studio/releases).
2. Extract OCCI-Studio and start it.
## Installing Required Plugins
To initialize the proposed OCCI extensions, the following plugins need to be added to the OCCI-Studio.
These allow to correctly depict OCCI models in the textual and graphical editor. To Install plugins the following steps have
to be performed:
1. Navigate to: Help -> Install New Software...
2. Press Add...
3. Insert the location of the update site:
### MoDMaCAO
The updatesite can be found at: [http://c109-125.cloud.gwdg.de/](http://c109-125.cloud.gwdg.de/).
To install the plugin please deselect "Group items by category" and choose MoDMaCAO.
### Gradle
To easily access our provided example install the gradle plugin within OCCI-Studio by following the instructions given here:
```
https://github.com/eclipse/buildship/blob/master/docs/user/Installation.md
```
### MOCCI
Finally, the MOCCI plugin can be installed which registers the OCCI monitoring extension. Therefore, the following steps have to be performed:
1. Navigate to [https://rwm.pages.gwdg.de/de.ugoe.cs.rwm.mocci/index.html](https://rwm.pages.gwdg.de/de.ugoe.cs.rwm.mocci/index.html):
2. Press Download Eclipse Plugin Archive
3. Save the updatesite.zip to any destination
4. Then follow the steps to install the plugin given above, but system choose the location of the updatesite.zip
Alternatively, you can build the Eclipse plugin yourself by checking out the project and perform the following command on the mocci.model project:
```
gradle updateSiteZip
```
\ No newline at end of file
doc/tree.jpg

122 KiB

# Vertical Scaling Scenario
Prerequisite for this scenario is the [initial deployment](./initial.md) of the hadoop cluster.
Thereafter, a MAPE-k loop is initialized that periodically checks whether the CPU utilization of the worker node reaches a critical level.
If that is the case a request against the OCCI API is performed, increasing the number of cores and memory available to the machine.
This scenario serves as an example showing how to directly work with the OCCI interface only requiring the execution of REST requests.
## Starting the Adaptation Loop Script
In this scenario, a simple bash script is used to check the gathered monitoring data and perform corresponding actions.
Before the adaptation script is started make sure that the MartServer is running and the hadoop cluster has been deployed.
To start the script execute the [vertical.sh](https://gitlab.gwdg.de/rwm/de.ugoe.cs.rwm.mocci/blob/master/src/main/resources/vertical.sh) script.
In the getting started VM the script is located on the desktop. Create a terminal (Ctrl-Alt-T) navigate to the desktop (cd Desktop) and start the script with the following command:
```
./vertical.sh
```
*Note*: To perform other scenarios it is recommended to stop the self-adaptation loop of this scenario. Therefore, press Ctrl-C in the terminal running the loop while it is waiting for a new cycle.
### Adaptation Loop Script - Output
The output of the script is separated into the individual steps of the MAPE loop: Monitor, Analyze, Plan, and Execute.
Thus, the output looks depending on the adaptive action to be performed similar to:
```
Starting MAPE script
Requesting http://localhost:8080/monitorableproperty?attribute=monitoring.result&value=Critical every 3 seconds!
Monitor
{
"id" : "urn:uuid:ba16f4ee-1601-4192-a259-eae4274aed72",
"kind" : "http://schemas.ugoe.cs.rwm/monitoring#monitorableproperty",
"mixins" : [ ],
"attributes" : {
"monitoring.property" : "CPU",
"monitoring.result" : "Critical"
},
"actions" : [ ],
"location" : "/monitorableproperty/urn:uuid:ba16f4ee-1601-4192-a259-eae4274aed72",
"source" : {
"location" : "/sensor/urn:uuid:efb0f50a-7a7c-4153-b939-4846d6554dbb",
"kind" : "http://schemas.ugoe.cs.rwm/monitoring#sensor"
},
"target" : {
"location" : "/compute/urn:uuid:2e6a73d0-faaa-476a-bd25-ca461dd166cf",
"kind" : "http://schemas.ogf.org/occi/infrastructure#compute"
}
}
Analyze
Critical Compute Detected
Plan: Scale up VM
State: DownScaled
Execute
```
In this case the query for VMs detects a Critical CPU utilization resulting in the "Scale up VM" plan. As the current state of the VM which is stored by the script is set to DownScaled a REST request adjusting the amount of cores of the VM is executed. Hereby, the occi.compute.cores attribute is updated from 2 to 8 cores. If the VM has currently has 8 cores and a downscale plan is executed the amount of cores is set to 2.
Independent of which plan gets executed the REST response is printed in the terminal executing the script.
The response shows the complete information about the updated VM, including its Links, which is rather large.
An example log file from the execution of the script can be found [here](./verticalLog.md).
### Browser - Output
Again, the browser can be used to query the running OCCI model. As the self-adaptation script adjusts the amount of cores of the worker node in the hadoop cluster, the compute node can be directly queries to gain information about its current state.
Therefore, investigate the occi.compute.core attribute of the worker node using the following query. The updated values can be checked by **refreshing the browser**:
```
http://localhost:8080/compute/urn:uuid:2e6a73d0-faaa-476a-bd25-ca461dd166cf/
```
## Tuning the Scenario
As the adaptation only upscales on a Critical behavior, it may be interesting to tune the simulated monitoring results.
Therefore, follow the steps defined the documentation of the [dummy connector](https://gitlab.gwdg.de/rwm/de.ugoe.cs.rwm.mocci/tree/master/de.ugoe.cs.rwm.mocci.connector.dummy).
*Note*: This scenario mainly serves to get started with the OCCI API. Currently, there is no connector implementing the vertical adjustment as shown in this scenario.
\ No newline at end of file
# Vertical Scaling Log
This file shows a short excerpt form the standard output of the vertical.sh script.
Depending on the Monitoring results, an analyzis is performed checking whether the VM has to up- or downscaled followed by an PUT request updating the amount of cores of the VM.
```
Starting MAPE script
Requesting http://localhost:8080/monitorableproperty?attribute=monitoring.result&value=Critical every 3 seconds!
Monitor
{
"id" : "urn:uuid:ba16f4ee-1601-4192-a259-eae4274aed72",
"kind" : "http://schemas.ugoe.cs.rwm/monitoring#monitorableproperty",
"mixins" : [ ],
"attributes" : {
"monitoring.property" : "CPU",
"monitoring.result" : "Critical"
},
"actions" : [ ],
"location" : "/monitorableproperty/urn:uuid:ba16f4ee-1601-4192-a259-eae4274aed72",
"source" : {
"location" : "/sensor/urn:uuid:efb0f50a-7a7c-4153-b939-4846d6554dbb",
"kind" : "http://schemas.ugoe.cs.rwm/monitoring#sensor"
},
"target" : {
"location" : "/compute/urn:uuid:2e6a73d0-faaa-476a-bd25-ca461dd166cf",
"kind" : "http://schemas.ogf.org/occi/infrastructure#compute"
}
}
Analyze
Critical Compute Detected
Plan: Scale up VM
State: UpScaled
Execute
* Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 8080 (#0)
> PUT /compute/urn:uuid:2e6a73d0-faaa-476a-bd25-ca461dd166cf/ HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.47.0
> Accept: */*
> Content-Type: text/occi
> Category: compute; scheme="http://schemas.ogf.org/occi/infrastructure#"; class="kind", ssh_key; scheme="http://schemas.ogf.org/occi/infrastructure/credentials#"; class="mixin", user_data; scheme="http://schemas.ogf.org/occi/infrastructure/compute#"; class="mixin", ubuntu_xenialxerus; scheme="http://schemas.modmacao.org/openstack/swe#"; class="mixin"
> X-OCCI-Attribute:occi.core.id="urn:uuid:2e6a73d0-faaa-476a-bd25-ca461dd166cf", occi.core.title="hadoop-worker-1", occi.core.summary="", occi.compute.architecture="x86", occi.compute.cores="8", occi.compute.hostname="hadoop-worker-1", occi.compute.share="0", occi.compute.speed="0", occi.compute.memory="8192", occi.compute.state="active", occi.compute.state.message="", occi.credentials.ssh.publickey="ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC6H7Ydi45BTHid4qNppGAi5mzjbnZgt7bi6xLGmZG9CiLmhMsxOuk3Z05Nn+pmoN98qS0eY8S240PPk5VOlYqBY0vdRAwrZSHHaLdMp6I7ARNrI2KraYduweqz7ZQxPXQfwIeYx2HKQxEF2r+4//Fo4WfgdBkLuulvl/Gw3TUzJNQHvgpaiNo9+PI5CZydHnZbjUkRikS12pT+CbNKj+0QKeQztbCd41aKxDv5H0DjltVRcpPppv4dmiU/zoCAIngWLO1PPgfYWyze8Z9IoyBT7Qdg30U91TYZBuxzXR5lq7Fh64y/IZ/SjdOdSIvIuDjtmJDULRdLJzrvubrKY+YH Generated-by-Nova", occi.compute.userdata="I2Nsb3VkLWNvbmZpZwoKIyBVcGdyYWRlIHRoZSBpbnN0YW5jZSBvbiBmaXJzdCBib290CiMgKGllIHJ1biBhcHQtZ2V0IHVwZ3JhZGUpCiMKIyBEZWZhdWx0OiBmYWxzZQojIEFsaWFzZXM6IGFwdF91cGdyYWRlCnBhY2thZ2VfdXBncmFkZTogdHJ1ZQoKcGFja2FnZXM6CiAtIHB5dGhvbgoKd3JpdGVfZmlsZXM6CiAgLSBwYXRoOiAvZXRjL25ldHdvcmsvaW50ZXJmYWNlcy5kLzUwLWNsb3VkLWluaXQuY2ZnCiAgICBjb250ZW50OiB8CiAgICAgIGF1dG8gbG8KICAgICAgaWZhY2UgbG8gaW5ldCBsb29wYmFjawogICAgICAKICAgICAgYXV0byBlbnMwCiAgICAgIGFsbG93LWhvdHBsdWcgZW5zMAogICAgICBpZmFjZSBlbnMwIGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnMxCiAgICAgIGFsbG93LWhvdHBsdWcgZW5zMQogICAgICBpZmFjZSBlbnMxIGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnMyCiAgICAgIGFsbG93LWhvdHBsdWcgZW5zMgogICAgICBpZmFjZSBlbnMyIGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnMzCiAgICAgIGFsbG93LWhvdHBsdWcgZW5zMwogICAgICBpZmFjZSBlbnMzIGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM0CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zNAogICAgICBpZmFjZSBlbnM0IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM1CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zNQogICAgICBpZmFjZSBlbnM1IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM2CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zNgogICAgICBpZmFjZSBlbnM2IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM3CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zNwogICAgICBpZmFjZSBlbnM3IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM4CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zOAogICAgICBpZmFjZSBlbnM4IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM5CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zOQogICAgICBpZmFjZSBlbnM5IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnMxMAogICAgICBhbGxvdy1ob3RwbHVnIGVuczEwCiAgICAgIGlmYWNlIGVuczEwIGluZXQgZGhjcAoKIyMj"
>
< HTTP/1.1 201 Created
< Date: Tue, 29 Jan 2019 15:11:21 GMT
< Server: OCCIWare MART Server v1.0 OCCI/1.2
< Accept: text/occi;application/json;application/occi+json;text/plain;text/occi+plain
< Content-Type: application/json
< Location: http://localhost:8080/compute/urn:uuid:2e6a73d0-faaa-476a-bd25-ca461dd166cf
< Content-Length: 6337
<
{
"id" : "urn:uuid:2e6a73d0-faaa-476a-bd25-ca461dd166cf",
"kind" : "http://schemas.ogf.org/occi/infrastructure#compute",
"mixins" : [ "http://schemas.ogf.org/occi/infrastructure/credentials#ssh_key", "http://schemas.ogf.org/occi/infrastructure/compute#user_data", "http://schemas.modmacao.org/openstack/swe#ubuntu_xenialxerus" ],
"attributes" : {
"occi.compute.architecture" : "x86",
"occi.compute.cores" : 8,
"occi.compute.hostname" : "hadoop-worker-1",
"occi.compute.share" : 0,
"occi.compute.speed" : 0.0,
"occi.compute.memory" : 8192.0,
"occi.compute.state" : "active",
"occi.compute.state.message" : "",
"occi.credentials.ssh.publickey" : "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC6H7Ydi45BTHid4qNppGAi5mzjbnZgt7bi6xLGmZG9CiLmhMsxOuk3Z05Nn+pmoN98qS0eY8S240PPk5VOlYqBY0vdRAwrZSHHaLdMp6I7ARNrI2KraYduweqz7ZQxPXQfwIeYx2HKQxEF2r+4//Fo4WfgdBkLuulvl/Gw3TUzJNQHvgpaiNo9+PI5CZydHnZbjUkRikS12pT+CbNKj+0QKeQztbCd41aKxDv5H0DjltVRcpPppv4dmiU/zoCAIngWLO1PPgfYWyze8Z9IoyBT7Qdg30U91TYZBuxzXR5lq7Fh64y/IZ/SjdOdSIvIuDjtmJDULRdLJzrvubrKY+YH Generated-by-Nova",
"occi.compute.userdata" : "I2Nsb3VkLWNvbmZpZwoKIyBVcGdyYWRlIHRoZSBpbnN0YW5jZSBvbiBmaXJzdCBib290CiMgKGllIHJ1biBhcHQtZ2V0IHVwZ3JhZGUpCiMKIyBEZWZhdWx0OiBmYWxzZQojIEFsaWFzZXM6IGFwdF91cGdyYWRlCnBhY2thZ2VfdXBncmFkZTogdHJ1ZQoKcGFja2FnZXM6CiAtIHB5dGhvbgoKd3JpdGVfZmlsZXM6CiAgLSBwYXRoOiAvZXRjL25ldHdvcmsvaW50ZXJmYWNlcy5kLzUwLWNsb3VkLWluaXQuY2ZnCiAgICBjb250ZW50OiB8CiAgICAgIGF1dG8gbG8KICAgICAgaWZhY2UgbG8gaW5ldCBsb29wYmFjawogICAgICAKICAgICAgYXV0byBlbnMwCiAgICAgIGFsbG93LWhvdHBsdWcgZW5zMAogICAgICBpZmFjZSBlbnMwIGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnMxCiAgICAgIGFsbG93LWhvdHBsdWcgZW5zMQogICAgICBpZmFjZSBlbnMxIGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnMyCiAgICAgIGFsbG93LWhvdHBsdWcgZW5zMgogICAgICBpZmFjZSBlbnMyIGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnMzCiAgICAgIGFsbG93LWhvdHBsdWcgZW5zMwogICAgICBpZmFjZSBlbnMzIGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM0CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zNAogICAgICBpZmFjZSBlbnM0IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM1CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zNQogICAgICBpZmFjZSBlbnM1IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM2CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zNgogICAgICBpZmFjZSBlbnM2IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM3CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zNwogICAgICBpZmFjZSBlbnM3IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM4CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zOAogICAgICBpZmFjZSBlbnM4IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM5CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zOQogICAgICBpZmFjZSBlbnM5IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnMxMAogICAgICBhbGxvdy1ob3RwbHVnIGVuczEwCiAgICAgIGlmYWNlIGVuczEwIGluZXQgZGhjcAoKIyMj",
"openstack.runtime.id" : "5437eae8-7c47-4834-929c-a314de77d291"
},
"links" : [ {
"id" : "urn:uuid:356f7b59-69a7-4df1-9ab5-c0a46b49b9d1",
"kind" : "http://schemas.ogf.org/occi/infrastructure#networkinterface",
"mixins" : [ "http://schemas.modmacao.org/occi/ansible#ansibleendpoint", "http://schemas.ogf.org/occi/infrastructure/networkinterface#ipnetworkinterface" ],
"attributes" : {
"occi.networkinterface.interface" : "",
"occi.networkinterface.mac" : "",
"occi.networkinterface.state" : "active",
"occi.networkinterface.state.message" : "",
"occi.networkinterface.address" : "",
"occi.networkinterface.gateway" : "",
"occi.networkinterface.allocation" : "dynamic"
},
"actions" : [ ],
"location" : "/networkinterface/urn:uuid:356f7b59-69a7-4df1-9ab5-c0a46b49b9d1",
"source" : {
"location" : "/compute/urn:uuid:2e6a73d0-faaa-476a-bd25-ca461dd166cf",
"kind" : "http://schemas.ogf.org/occi/infrastructure#compute"
},
"target" : {
"location" : "/network/urn:uuid:29d78078-fb4c-47aa-a9af-b8aaf3339590",
"kind" : "http://schemas.ogf.org/occi/infrastructure#network"
}
}, {
"id" : "urn:uuid:03f91178-136f-4023-876e-84509f8a5a2d",
"kind" : "http://schemas.ogf.org/occi/infrastructure#networkinterface",
"mixins" : [ "http://schemas.ogf.org/occi/infrastructure/networkinterface#ipnetworkinterface" ],
"attributes" : {
"occi.networkinterface.interface" : "",
"occi.networkinterface.mac" : "",
"occi.networkinterface.state" : "active",
"occi.networkinterface.state.message" : "",
"occi.networkinterface.address" : "100.254.1.35",
"occi.networkinterface.gateway" : "",
"occi.networkinterface.allocation" : "dynamic"
},
"actions" : [ ],
"location" : "/networkinterface/urn:uuid:03f91178-136f-4023-876e-84509f8a5a2d",
"source" : {
"location" : "/compute/urn:uuid:2e6a73d0-faaa-476a-bd25-ca461dd166cf",
"kind" : "http://schemas.ogf.org/occi/infrastructure#compute"
},
"target" : {
"location" : "/network/urn:uuid:7a9fca2c-24fb-473c-aa9c-8dc9e68a432a",
"kind" : "http://schemas.ogf.org/occi/infrastructure#network"
}
}, {
"id" : "urn:uuid:c8c49905-3d5e-43b2-8d09-fabf92d29722",
"kind" : "http://schemas.ogf.org/occi/infrastructure#networkinterface",
"mixins" : [ "http://schemas.ogf.org/occi/infrastructure/networkinterface#ipnetworkinterface" ],
"attributes" : {
"occi.networkinterface.interface" : "",
"occi.networkinterface.mac" : "",
"occi.networkinterface.state" : "active",
"occi.networkinterface.state.message" : "",
"occi.networkinterface.address" : "10.254.1.8",
"occi.networkinterface.gateway" : "",
"occi.networkinterface.allocation" : "dynamic"
},
"actions" : [ ],
"location" : "/networkinterface/urn:uuid:c8c49905-3d5e-43b2-8d09-fabf92d29722",
"source" : {
"location" : "/compute/urn:uuid:2e6a73d0-faaa-476a-bd25-ca461dd166cf",
"kind" : "http://schemas.ogf.org/occi/infrastructure#compute"
},
"target" : {
"location" : "/network/urn:uuid:29d78078-fb4c-47aa-a9af-b8aaf3339591",
"kind" : "http://schemas.ogf.org/occi/infrastructure#network"
}
} ],
"actions" : [ "http://schemas.ogf.org/occi/infrastructure/compute/action#start", "http://schemas.ogf.org/occi/infrastructure/compute/action#stop", "http://schemas.ogf.org/occi/infrastructure/compute/action#restart", "http://schemas.ogf.org/occi/infrastructure/compute/action#suspend", "http://schemas.ogf.org/occi/infrastructure/compute/action#save" ],
"location" : "/compute/urn:uuid:2e6a73d0-faaa-476a-bd25-ca461dd166cf"
}
* Connection #0 to host localhost left intact
Monitor
{
"id" : "urn:uuid:ba16f4ee-1601-4192-a259-eae4274aed72",
"kind" : "http://schemas.ugoe.cs.rwm/monitoring#monitorableproperty",
"mixins" : [ ],
"attributes" : {
"monitoring.property" : "CPU",
"monitoring.result" : "Critical"
},
"actions" : [ ],
"location" : "/monitorableproperty/urn:uuid:ba16f4ee-1601-4192-a259-eae4274aed72",
"source" : {
"location" : "/sensor/urn:uuid:efb0f50a-7a7c-4153-b939-4846d6554dbb",
"kind" : "http://schemas.ugoe.cs.rwm/monitoring#sensor"
},
"target" : {
"location" : "/compute/urn:uuid:2e6a73d0-faaa-476a-bd25-ca461dd166cf",
"kind" : "http://schemas.ogf.org/occi/infrastructure#compute"
}
}
Analyze
Critical Compute Detected
Plan: Scale up VM
Monitor
{ }
Analyze
No Crtical Compute Detected
Plan: Scale down VM
State: DownScaled
* Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 8080 (#0)
> PUT /compute/urn:uuid:2e6a73d0-faaa-476a-bd25-ca461dd166cf/ HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.47.0
> Accept: */*
> Content-Type: text/occi
> Category: compute; scheme="http://schemas.ogf.org/occi/infrastructure#"; class="kind", ssh_key; scheme="http://schemas.ogf.org/occi/infrastructure/credentials#"; class="mixin", user_data; scheme="http://schemas.ogf.org/occi/infrastructure/compute#"; class="mixin", ubuntu_xenialxerus; scheme="http://schemas.modmacao.org/openstack/swe#"; class="mixin"
> X-OCCI-Attribute:occi.core.id="urn:uuid:2e6a73d0-faaa-476a-bd25-ca461dd166cf", occi.core.title="hadoop-worker-1", occi.core.summary="", occi.compute.architecture="x86", occi.compute.cores="2", occi.compute.hostname="hadoop-worker-1", occi.compute.share="0", occi.compute.speed="0", occi.compute.memory="4096", occi.compute.state="active", occi.compute.state.message="", occi.credentials.ssh.publickey="ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC6H7Ydi45BTHid4qNppGAi5mzjbnZgt7bi6xLGmZG9CiLmhMsxOuk3Z05Nn+pmoN98qS0eY8S240PPk5VOlYqBY0vdRAwrZSHHaLdMp6I7ARNrI2KraYduweqz7ZQxPXQfwIeYx2HKQxEF2r+4//Fo4WfgdBkLuulvl/Gw3TUzJNQHvgpaiNo9+PI5CZydHnZbjUkRikS12pT+CbNKj+0QKeQztbCd41aKxDv5H0DjltVRcpPppv4dmiU/zoCAIngWLO1PPgfYWyze8Z9IoyBT7Qdg30U91TYZBuxzXR5lq7Fh64y/IZ/SjdOdSIvIuDjtmJDULRdLJzrvubrKY+YH Generated-by-Nova", occi.compute.userdata="I2Nsb3VkLWNvbmZpZwoKIyBVcGdyYWRlIHRoZSBpbnN0YW5jZSBvbiBmaXJzdCBib290CiMgKGllIHJ1biBhcHQtZ2V0IHVwZ3JhZGUpCiMKIyBEZWZhdWx0OiBmYWxzZQojIEFsaWFzZXM6IGFwdF91cGdyYWRlCnBhY2thZ2VfdXBncmFkZTogdHJ1ZQoKcGFja2FnZXM6CiAtIHB5dGhvbgoKd3JpdGVfZmlsZXM6CiAgLSBwYXRoOiAvZXRjL25ldHdvcmsvaW50ZXJmYWNlcy5kLzUwLWNsb3VkLWluaXQuY2ZnCiAgICBjb250ZW50OiB8CiAgICAgIGF1dG8gbG8KICAgICAgaWZhY2UgbG8gaW5ldCBsb29wYmFjawogICAgICAKICAgICAgYXV0byBlbnMwCiAgICAgIGFsbG93LWhvdHBsdWcgZW5zMAogICAgICBpZmFjZSBlbnMwIGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnMxCiAgICAgIGFsbG93LWhvdHBsdWcgZW5zMQogICAgICBpZmFjZSBlbnMxIGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnMyCiAgICAgIGFsbG93LWhvdHBsdWcgZW5zMgogICAgICBpZmFjZSBlbnMyIGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnMzCiAgICAgIGFsbG93LWhvdHBsdWcgZW5zMwogICAgICBpZmFjZSBlbnMzIGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM0CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zNAogICAgICBpZmFjZSBlbnM0IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM1CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zNQogICAgICBpZmFjZSBlbnM1IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM2CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zNgogICAgICBpZmFjZSBlbnM2IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM3CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zNwogICAgICBpZmFjZSBlbnM3IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM4CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zOAogICAgICBpZmFjZSBlbnM4IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM5CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zOQogICAgICBpZmFjZSBlbnM5IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnMxMAogICAgICBhbGxvdy1ob3RwbHVnIGVuczEwCiAgICAgIGlmYWNlIGVuczEwIGluZXQgZGhjcAoKIyMj"
>
< HTTP/1.1 201 Created
< Date: Tue, 29 Jan 2019 15:11:27 GMT
< Server: OCCIWare MART Server v1.0 OCCI/1.2
< Accept: text/occi;application/json;application/occi+json;text/plain;text/occi+plain
< Content-Type: application/json
< Location: http://localhost:8080/compute/urn:uuid:2e6a73d0-faaa-476a-bd25-ca461dd166cf
< Content-Length: 6337
<
{
"id" : "urn:uuid:2e6a73d0-faaa-476a-bd25-ca461dd166cf",
"kind" : "http://schemas.ogf.org/occi/infrastructure#compute",
"mixins" : [ "http://schemas.ogf.org/occi/infrastructure/credentials#ssh_key", "http://schemas.ogf.org/occi/infrastructure/compute#user_data", "http://schemas.modmacao.org/openstack/swe#ubuntu_xenialxerus" ],
"attributes" : {
"occi.compute.architecture" : "x86",
"occi.compute.cores" : 2,
"occi.compute.hostname" : "hadoop-worker-1",
"occi.compute.share" : 0,
"occi.compute.speed" : 0.0,
"occi.compute.memory" : 4096.0,
"occi.compute.state" : "active",
"occi.compute.state.message" : "",
"occi.credentials.ssh.publickey" : "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC6H7Ydi45BTHid4qNppGAi5mzjbnZgt7bi6xLGmZG9CiLmhMsxOuk3Z05Nn+pmoN98qS0eY8S240PPk5VOlYqBY0vdRAwrZSHHaLdMp6I7ARNrI2KraYduweqz7ZQxPXQfwIeYx2HKQxEF2r+4//Fo4WfgdBkLuulvl/Gw3TUzJNQHvgpaiNo9+PI5CZydHnZbjUkRikS12pT+CbNKj+0QKeQztbCd41aKxDv5H0DjltVRcpPppv4dmiU/zoCAIngWLO1PPgfYWyze8Z9IoyBT7Qdg30U91TYZBuxzXR5lq7Fh64y/IZ/SjdOdSIvIuDjtmJDULRdLJzrvubrKY+YH Generated-by-Nova",
"occi.compute.userdata" : "I2Nsb3VkLWNvbmZpZwoKIyBVcGdyYWRlIHRoZSBpbnN0YW5jZSBvbiBmaXJzdCBib290CiMgKGllIHJ1biBhcHQtZ2V0IHVwZ3JhZGUpCiMKIyBEZWZhdWx0OiBmYWxzZQojIEFsaWFzZXM6IGFwdF91cGdyYWRlCnBhY2thZ2VfdXBncmFkZTogdHJ1ZQoKcGFja2FnZXM6CiAtIHB5dGhvbgoKd3JpdGVfZmlsZXM6CiAgLSBwYXRoOiAvZXRjL25ldHdvcmsvaW50ZXJmYWNlcy5kLzUwLWNsb3VkLWluaXQuY2ZnCiAgICBjb250ZW50OiB8CiAgICAgIGF1dG8gbG8KICAgICAgaWZhY2UgbG8gaW5ldCBsb29wYmFjawogICAgICAKICAgICAgYXV0byBlbnMwCiAgICAgIGFsbG93LWhvdHBsdWcgZW5zMAogICAgICBpZmFjZSBlbnMwIGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnMxCiAgICAgIGFsbG93LWhvdHBsdWcgZW5zMQogICAgICBpZmFjZSBlbnMxIGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnMyCiAgICAgIGFsbG93LWhvdHBsdWcgZW5zMgogICAgICBpZmFjZSBlbnMyIGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnMzCiAgICAgIGFsbG93LWhvdHBsdWcgZW5zMwogICAgICBpZmFjZSBlbnMzIGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM0CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zNAogICAgICBpZmFjZSBlbnM0IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM1CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zNQogICAgICBpZmFjZSBlbnM1IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM2CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zNgogICAgICBpZmFjZSBlbnM2IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM3CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zNwogICAgICBpZmFjZSBlbnM3IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM4CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zOAogICAgICBpZmFjZSBlbnM4IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM5CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zOQogICAgICBpZmFjZSBlbnM5IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnMxMAogICAgICBhbGxvdy1ob3RwbHVnIGVuczEwCiAgICAgIGlmYWNlIGVuczEwIGluZXQgZGhjcAoKIyMj",
"openstack.runtime.id" : "5437eae8-7c47-4834-929c-a314de77d291"
},
"links" : [ {
"id" : "urn:uuid:356f7b59-69a7-4df1-9ab5-c0a46b49b9d1",
"kind" : "http://schemas.ogf.org/occi/infrastructure#networkinterface",
"mixins" : [ "http://schemas.modmacao.org/occi/ansible#ansibleendpoint", "http://schemas.ogf.org/occi/infrastructure/networkinterface#ipnetworkinterface" ],
"attributes" : {
"occi.networkinterface.interface" : "",
"occi.networkinterface.mac" : "",
"occi.networkinterface.state" : "active",
"occi.networkinterface.state.message" : "",
"occi.networkinterface.address" : "",
"occi.networkinterface.gateway" : "",
"occi.networkinterface.allocation" : "dynamic"
},
"actions" : [ ],
"location" : "/networkinterface/urn:uuid:356f7b59-69a7-4df1-9ab5-c0a46b49b9d1",
"source" : {
"location" : "/compute/urn:uuid:2e6a73d0-faaa-476a-bd25-ca461dd166cf",
"kind" : "http://schemas.ogf.org/occi/infrastructure#compute"
},
"target" : {
"location" : "/network/urn:uuid:29d78078-fb4c-47aa-a9af-b8aaf3339590",
"kind" : "http://schemas.ogf.org/occi/infrastructure#network"
}
}, {
"id" : "urn:uuid:03f91178-136f-4023-876e-84509f8a5a2d",
"kind" : "http://schemas.ogf.org/occi/infrastructure#networkinterface",
"mixins" : [ "http://schemas.ogf.org/occi/infrastructure/networkinterface#ipnetworkinterface" ],
"attributes" : {
"occi.networkinterface.interface" : "",
"occi.networkinterface.mac" : "",
"occi.networkinterface.state" : "active",
"occi.networkinterface.state.message" : "",
"occi.networkinterface.address" : "100.254.1.35",
"occi.networkinterface.gateway" : "",
"occi.networkinterface.allocation" : "dynamic"
},
"actions" : [ ],
"location" : "/networkinterface/urn:uuid:03f91178-136f-4023-876e-84509f8a5a2d",
"source" : {
"location" : "/compute/urn:uuid:2e6a73d0-faaa-476a-bd25-ca461dd166cf",
"kind" : "http://schemas.ogf.org/occi/infrastructure#compute"
},
"target" : {
"location" : "/network/urn:uuid:7a9fca2c-24fb-473c-aa9c-8dc9e68a432a",
"kind" : "http://schemas.ogf.org/occi/infrastructure#network"
}
}, {
"id" : "urn:uuid:c8c49905-3d5e-43b2-8d09-fabf92d29722",
"kind" : "http://schemas.ogf.org/occi/infrastructure#networkinterface",
"mixins" : [ "http://schemas.ogf.org/occi/infrastructure/networkinterface#ipnetworkinterface" ],
"attributes" : {
"occi.networkinterface.interface" : "",
"occi.networkinterface.mac" : "",
"occi.networkinterface.state" : "active",
"occi.networkinterface.state.message" : "",
"occi.networkinterface.address" : "10.254.1.8",
"occi.networkinterface.gateway" : "",
"occi.networkinterface.allocation" : "dynamic"
},
"actions" : [ ],
"location" : "/networkinterface/urn:uuid:c8c49905-3d5e-43b2-8d09-fabf92d29722",
"source" : {
"location" : "/compute/urn:uuid:2e6a73d0-faaa-476a-bd25-ca461dd166cf",
"kind" : "http://schemas.ogf.org/occi/infrastructure#compute"
},
"target" : {
"location" : "/network/urn:uuid:29d78078-fb4c-47aa-a9af-b8aaf3339591",
"kind" : "http://schemas.ogf.org/occi/infrastructure#network"
}
} ],
"actions" : [ "http://schemas.ogf.org/occi/infrastructure/compute/action#start", "http://schemas.ogf.org/occi/infrastructure/compute/action#stop", "http://schemas.ogf.org/occi/infrastructure/compute/action#restart", "http://schemas.ogf.org/occi/infrastructure/compute/action#suspend", "http://schemas.ogf.org/occi/infrastructure/compute/action#save" ],
"location" : "/compute/urn:uuid:2e6a73d0-faaa-476a-bd25-ca461dd166cf"
}
* Connection #0 to host localhost left intact
Monitor
{ }
Analyze
No Crtical Compute Detected
Plan: Scale down VM
```
\ No newline at end of file
...@@ -18,6 +18,5 @@ include 'services:webservice' ...@@ -18,6 +18,5 @@ include 'services:webservice'
rootProject.name = 'de.ugoe.cs.rwm.mocci' rootProject.name = 'de.ugoe.cs.rwm.mocci'
include 'de.ugoe.cs.rwm.mocci.model' include 'de.ugoe.cs.rwm.mocci.model'
include 'de.ugoe.cs.rwm.mocci.model.edit' include 'de.ugoe.cs.rwm.mocci.model.edit'
include 'de.ugoe.cs.rwm.mocci.examples'
include 'de.ugoe.cs.rwm.mocci.connector' include 'de.ugoe.cs.rwm.mocci.connector'
include 'de.ugoe.cs.rwm.mocci.connector.dummy' include 'de.ugoe.cs.rwm.mocci.connector.dummy'
\ No newline at end of file
/**
* Copyright (c) 2018-2019 University of Goettingen
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* - Johannes Erbel <johannes.erbel@cs.uni-goettingen.de>
*/
package de.ugoe.cs.rwm.mocci;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.cmf.occi.core.impl.OCCIFactoryImpl;
import org.eclipse.cmf.occi.infrastructure.impl.InfrastructureFactoryImpl;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.resource.Resource;
import org.modmacao.ansibleconfiguration.impl.AnsibleconfigurationFactoryImpl;
import org.modmacao.occi.platform.impl.PlatformFactoryImpl;
import org.modmacao.placement.impl.PlacementFactoryImpl;
import de.ugoe.cs.rwm.docci.connector.Connector;
import monitoring.impl.MonitoringFactoryImpl;
import ossweruntime.impl.OssweruntimeFactoryImpl;
public abstract class AbsScaler {
protected InfrastructureFactoryImpl iFactory = new InfrastructureFactoryImpl();
protected OCCIFactoryImpl factory = new OCCIFactoryImpl();
protected MonitoringFactoryImpl mFactory = new MonitoringFactoryImpl();
protected PlatformFactoryImpl pFactory = new PlatformFactoryImpl();
protected PlacementFactoryImpl placeFactory = new PlacementFactoryImpl();
protected OssweruntimeFactoryImpl osFactory = new OssweruntimeFactoryImpl();
protected AnsibleconfigurationFactoryImpl aFactory = new AnsibleconfigurationFactoryImpl();
protected Resource runtimeModel;
protected Connector conn;
protected Path runtimePath;
@SuppressWarnings("serial")
static List<String> interfaces = new ArrayList<String>() {
{
add("10.254.1.12");
add("10.254.1.22");
add("10.254.1.32");
add("10.254.1.42");
add("10.254.1.52");
}
};
protected org.eclipse.cmf.occi.core.Resource getResourceById(EList<org.eclipse.cmf.occi.core.Resource> eList,
String string) {
for (org.eclipse.cmf.occi.core.Resource res : eList) {
if (res.getId().equals(string)) {
return res;
}
}
return null;
}
}
/**
* Copyright (c) 2018-2019 University of Goettingen
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* - Johannes Erbel <johannes.erbel@cs.uni-goettingen.de>
*/
package de.ugoe.cs.rwm.mocci;
import java.nio.file.Path;
import java.util.List;
import org.eclipse.cmf.occi.core.AttributeState;
import org.eclipse.cmf.occi.core.Configuration;
import org.eclipse.cmf.occi.core.Link;
import org.eclipse.cmf.occi.infrastructure.Compute;
import org.eclipse.cmf.occi.infrastructure.Networkinterface;
import org.eclipse.emf.common.util.BasicEList;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.epsilon.emc.emf.CachedResourceSet;
import org.modmacao.occi.platform.Component;
import de.ugoe.cs.rwm.docci.ModelUtility;
import de.ugoe.cs.rwm.docci.connector.Connector;
import monitoring.Monitorableproperty;
import monitoring.Sensor;
public class DownScaler extends AbsScaler {
private List<Link> linksToDelete;
private List<org.eclipse.cmf.occi.core.Resource> resourcesToDelete;
public DownScaler(Connector conn, Path runtimePath) {
this.conn = conn;
this.runtimePath = runtimePath;
this.linksToDelete = new BasicEList<Link>();
this.resourcesToDelete = new BasicEList<org.eclipse.cmf.occi.core.Resource>();
}
public Resource downScaleNodes() {
CachedResourceSet.getCache().clear();
runtimeModel = ModelUtility.loadOCCIintoEMFResource(conn.loadRuntimeModel(runtimePath));
Configuration config = ((Configuration) runtimeModel.getContents().get(0));
boolean downScale = false;
for (org.eclipse.cmf.occi.core.Resource res : config.getResources()) {
if (res instanceof Compute) {
Compute comp = (Compute) res;
if (comp.getTitle().contains("worker")) {
Monitorableproperty monProp = getAttachedCPUMonProp(comp);
if (monProp != null && monProp.getMonitoringResult() != null) {
if (monProp.getMonitoringResult().equals("None")) {
if (atLeastTwoWorkers(config)) {
System.out.println(" VM with None CPU utilization found: " + comp.getId());
addConnectedLinksAndComponents(comp);
addConnectedLinksAndComponents(monProp.getSource());
resourcesToDelete.add(comp);
resourcesToDelete.add(monProp.getSource());
System.out.println(
" Delete Entities Around: " + comp.getTitle() + " (" + comp.getId() + ")");
downScale = true;
break;
}
}
}
}
}
}
if (downScale == false) {
System.out.println(" Every Compute busy/Only one worker! Skipping downScale!");
}
for (Link link : linksToDelete) {
EcoreUtil.delete(link);
}
config.getResources().removeAll(resourcesToDelete);
for (org.eclipse.cmf.occi.core.Resource res : resourcesToDelete) {
for (Link l : res.getLinks()) {
EcoreUtil.delete(l);
}
EcoreUtil.delete(res);
}
Resource rM = runtimeModel;
MAPE.newComp = null;
CachedResourceSet.getCache().clear();
return rM;
}
private boolean atLeastTwoWorkers(Configuration config) {
int count = 0;
for (org.eclipse.cmf.occi.core.Resource res : config.getResources()) {
if (res instanceof Compute) {
if (res.getTitle().toLowerCase().contains("worker")) {
count++;
}
}
}
if (count >= 2) {
return true;
}
return false;
}
private Monitorableproperty getAttachedCPUMonProp(Compute comp) {
for (Link link : comp.getRlinks()) {
if (link instanceof Monitorableproperty) {
Monitorableproperty monProp = (Monitorableproperty) link;
if (monProp.getMonitoringProperty().equals("CPU")) {
return monProp;
}
}
}
return null;
}
private void addConnectedLinksAndComponents(org.eclipse.cmf.occi.core.Resource comp) {
linksToDelete.addAll(comp.getLinks());
linksToDelete.addAll(comp.getRlinks());
for (Link link : comp.getRlinks()) {
if (link.getSource() instanceof Component) {
resourcesToDelete.add(link.getSource());
linksToDelete.addAll(link.getSource().getLinks());
linksToDelete.addAll(link.getSource().getRlinks());
}
if (link instanceof Monitorableproperty) {
resourcesToDelete.add(link.getSource());
}
}
for (Link link : comp.getLinks()) {
if (link instanceof Networkinterface) {
Networkinterface nwi = (Networkinterface) link;
for (AttributeState attr : nwi.getAttributes()) {
if (attr.getName().equals("occi.networkinterface.address")) {
if (attr.getValue().startsWith("10.254.1")) {
interfaces.add(attr.getValue());
}
}
}
/*
* for(MixinBase mixB: nwi.getParts()) { if(mixB instanceof Ipnetworkinterface)
* { Ipnetworkinterface ipnwi = (Ipnetworkinterface) mixB;
* if(ipnwi.getOcciNetworkinterfaceAddress().startsWith("100.254.1")) {
* interfaces.add(ipnwi.getOcciNetworkinterfaceAddress()); } } }
*/
}
}
if (comp instanceof Sensor) {
for (Link l : comp.getLinks()) {
if (l.getTarget() instanceof Component) {
resourcesToDelete.add(l.getTarget());
linksToDelete.addAll(l.getTarget().getLinks());
linksToDelete.addAll(l.getTarget().getRlinks());
}
}
}
}
}
package de.ugoe.cs.rwm.mocci;
/**Making javadoc happy.
* @author erbel
*
*/
public class ExampleClass {
/**Making javadoc happy.
* @param args Making javadoc happy.
*/
public static void main(String[] args) {
System.out.println("Hello world");
}
}
/**
* Copyright (c) 2018-2019 University of Goettingen
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* - Johannes Erbel <johannes.erbel@cs.uni-goettingen.de>
*/
package de.ugoe.cs.rwm.mocci;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URL;
import java.nio.file.Path;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.epsilon.eol.exceptions.EolRuntimeException;
import de.ugoe.cs.rwm.docci.MartDeployer;
import de.ugoe.cs.rwm.docci.ModelUtility;
import de.ugoe.cs.rwm.docci.connector.Connector;
import de.ugoe.cs.rwm.docci.connector.LocalhostConnector;
import de.ugoe.cs.rwm.docci.connector.MartConnector;
import de.ugoe.cs.rwm.docci.executor.MartExecutor;
import de.ugoe.cs.rwm.tocci.Transformator;
import de.ugoe.cs.rwm.tocci.TransformatorFactory;
import de.ugoe.cs.rwm.tocci.occi2openstack.OCCI2OPENSTACKTransformator;
public class InitialDeployment {
public static void main(String args[]) {
Connector conn = new LocalhostConnector("localhost", 8080, "ubuntu");
// Connector conn = new MartConnector("192.168.35.45", 8080, "ubuntu",
// "~/key.pem");
RegistryAndLoggerSetup.setup();
Path occiPath;
if (args.length == 0) {
System.out.println("Choosing default initial deployment model");
occiPath = getModelPath("de/ugoe/cs/rwm/mocci/occi/hadoopClusterCPU.occic");
} else {
System.out.println("Choosing user defined deployment model: " + args[0]);
File occiFile = new File(args[0]);
occiPath = occiFile.toPath().toAbsolutePath();
}
Resource model = ModelUtility.loadOCCIintoEMFResource(occiPath);
Transformator trans = TransformatorFactory.getTransformator("OCCI2OCCI");
try {
trans.transform(model, occiPath);
} catch (EolRuntimeException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
model = ModelUtility.loadOCCIintoEMFResource(occiPath);
OCCI2OPENSTACKTransformator trans2 = new OCCI2OPENSTACKTransformator();
trans2.setTransformationProperties(RegistryAndLoggerSetup.manNWRuntimeId, RegistryAndLoggerSetup.sshKey,
RegistryAndLoggerSetup.userData, RegistryAndLoggerSetup.manNWid);
try {
trans2.transform(model, occiPath);
} catch (EolRuntimeException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
model = ModelUtility.loadOCCIintoEMFResource(occiPath);
MartDeployer deployer;
if (conn instanceof MartConnector) {
deployer = new MartDeployer(conn, 100000);
} else {
deployer = new MartDeployer(conn);
}
deployer.deploy(model);
MartExecutor executor = new MartExecutor(conn);
executor.executeGetOperation("/resultprovider");
}
public static Path getModelPath(String resourceName) {
File file = null;
URL res = ClassLoader.getSystemClassLoader().getResource(resourceName);
if (res.toString().startsWith("jar:")) {
try (InputStream input = ClassLoader.getSystemClassLoader().getResourceAsStream(resourceName)) {
file = File.createTempFile("tempfile", ".occic");
@SuppressWarnings("resource")
OutputStream out = new FileOutputStream(file);
int read;
int byteArrSize = 1024;
byte[] bytes = new byte[byteArrSize];
while ((read = input.read(bytes)) != -1) {
out.write(bytes, 0, read);
}
file.deleteOnExit();
} catch (IOException ex) {
ex.printStackTrace();
}
} else {
// this will probably work in your IDE, but not from a JAR
file = new File(res.getFile());
}
if (file != null && !file.exists()) {
throw new RuntimeException("Error: File " + file + " not found!");
}
return file.toPath();
}
}
/**
* Copyright (c) 2018-2019 University of Goettingen
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* - Johannes Erbel <johannes.erbel@cs.uni-goettingen.de>
*/
package de.ugoe.cs.rwm.mocci;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Scanner;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.epsilon.eol.exceptions.EolRuntimeException;
import org.json.JSONArray;
import org.modmacao.occi.platform.Component;
import de.ugoe.cs.rwm.docci.MartDeployer;
import de.ugoe.cs.rwm.docci.ModelUtility;
import de.ugoe.cs.rwm.docci.connector.Connector;
import de.ugoe.cs.rwm.docci.connector.LocalhostConnector;
import de.ugoe.cs.rwm.docci.connector.MartConnector;
import de.ugoe.cs.rwm.docci.executor.MartExecutor;
import de.ugoe.cs.rwm.tocci.occi2openstack.OCCI2OPENSTACKTransformator;
/**
* Making javadoc happy.
*
* @author erbel
*
*/
public class MAPE {
protected static final Path RUNTIMEPATH = Paths.get(System.getProperty("user.home") + "/.rwm/runtime.occic");
static Connector conn = new LocalhostConnector("localhost", 8080, "ubuntu");
// static Connector conn = new MartConnector("192.168.35.45", 8080, "ubuntu",
// "~/key.pem");
static MartExecutor executor = new MartExecutor(conn);
static Resource runtimeModel;
static Component newComp;
static int interval = 5000;
static boolean manualMode = false;
/**
* Making javadoc happy.
*
* @param args Making javadoc happy.
*/
public static void main(String[] args) {
System.out.println("Starting MAPE loop");
RegistryAndLoggerSetup.setup();
for (String arg : args) {
if (arg.matches("\\d+")) {
System.out.println("Cycle argument set to: " + arg);
interval = Integer.parseInt(arg);
}
if (arg.matches("manual")) {
System.out.println("Manual mode enabled!");
manualMode = true;
}
}
if (args.length == 0) {
System.out.println("No argument given. Using default cycle of: " + interval);
}
while (true) {
try {
if (manualMode) {
System.out.println("Press Enter to trigger next cycle or write exit to stop the loop.");
Scanner scanner = new Scanner(System.in);
String line = scanner.nextLine();
if (line.equals("exit")) {
return;
}
System.out.println("Next Cycle triggered");
} else {
System.out.println("\n--------------------Waiting for new MAPE-K Cycle: Sleeping " + interval
+ "--------------------");
Thread.sleep(interval);
}
Monitor monitor = monitor();
String analysis = analyze(monitor);
runtimeModel = plan(analysis);
execute(runtimeModel);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
public static Monitor monitor() {
int critCPUs = getNumberOfCriticalCPUs();
int noneCPUs = getNumberOfNoneCPUs();
int allCPUs = getNumberOfAllCPUs();
Monitor mon = new Monitor(critCPUs, noneCPUs, allCPUs);
System.out.println("Monitor: " + "Monitored CPUs: " + allCPUs + "| Critical CPUs: " + critCPUs + "| None CPUs: "
+ noneCPUs);
return mon;
}
public static String analyze(Monitor monitor) {
int noneCPUs = monitor.getNoneCPUs();
int critCPUs = monitor.getCritCPUs();
int allCPUs = monitor.getAllCPUs();
if (noneCPUs == 0 && critCPUs > allCPUs / 2 && allCPUs <= 6) {
System.out.println("Analyze: Critical State Detected");
return "upScale";
} else if (allCPUs > 2) {
System.out.println("Analyze: Non Critical State Detected");
return "downScale";
}
return "noScale";
}
public static Resource plan(String analysis) {
switch (analysis) {
case "upScale":
System.out.println("Plan: upScale!");
UpScalerSpark upscaler = new UpScalerSpark(conn, RUNTIMEPATH);
return upscaler.upScaleNodes();
case "downScale":
System.out.println("Plan: downScale!");
DownScaler downscaler = new DownScaler(conn, RUNTIMEPATH);
return downscaler.downScaleNodes();
}
return ModelUtility.loadOCCIintoEMFResource(RUNTIMEPATH);
}
public static void execute(Resource runtimeModel) {
if (runtimeModel == null) {
System.out.println("Execute: Skipped as no scaling planned");
}
System.out.println("Execute: Deploying adjusted Model");
Path occiPath = RUNTIMEPATH;
OCCI2OPENSTACKTransformator trans2 = new OCCI2OPENSTACKTransformator();
trans2.setTransformationProperties(RegistryAndLoggerSetup.manNWRuntimeId, RegistryAndLoggerSetup.sshKey,
RegistryAndLoggerSetup.userData, RegistryAndLoggerSetup.manNWid);
try {
trans2.transform(runtimeModel, occiPath);
} catch (EolRuntimeException e) {
e.printStackTrace();
}
runtimeModel = ModelUtility.loadOCCIintoEMFResource(occiPath);
MartDeployer deployer;
if (conn instanceof MartConnector) {
deployer = new MartDeployer(conn, 1000);
} else {
deployer = new MartDeployer(conn);
}
deployer.deploy(runtimeModel);
if (newComp != null) {
executor.executeOperation("POST", newComp, ModelUtility.getAction(newComp, "start"));
}
}
private static int getNumberOfNoneCPUs() {
String query = "/monitorableproperty?attribute=monitoring.result&value=None";
String result = executor.executeGetOperation(query);
if (result.equals("{ }") == false) {
String substring = result.substring(result.indexOf("["), (result.lastIndexOf("]") + 1));
JSONArray arr = new JSONArray(substring);
if (arr.length() == 0) {
return 1;
} else {
return arr.length();
}
} else {
return 0;
}
}
private static int getNumberOfCriticalCPUs() {
String query = "/monitorableproperty?attribute=monitoring.result&value=Critical";
String result = executor.executeGetOperation(query);
if (result.equals("{ }") == false) {
String substring = result.substring(result.indexOf("["), (result.lastIndexOf("]") + 1));
JSONArray arr = new JSONArray(substring);
if (arr.length() == 0) {
return 1;
} else {
return arr.length();
}
} else {
return 0;
}
}
private static int getNumberOfAllCPUs() {
String query = "/monitorableproperty?attribute=monitoring.property&value=CPU";
String result = executor.executeGetOperation(query);
if (result.equals("{ }") == false) {
String substring = result.substring(result.indexOf("["), (result.lastIndexOf("]") + 1));
JSONArray arr = new JSONArray(substring);
if (arr.length() == 0) {
return 1;
} else {
return arr.length();
}
} else {
return 0;
}
}
}
\ No newline at end of file
/**
* Copyright (c) 2018-2019 University of Goettingen
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* - Johannes Erbel <johannes.erbel@cs.uni-goettingen.de>
*/
package de.ugoe.cs.rwm.mocci;
public class Monitor {
private int critCPUs;
private int noneCPUs;
private int allCPUs;
public int getAllCPUs() {
return allCPUs;
}
public void setAllCPUs(int allCPUs) {
this.allCPUs = allCPUs;
}
public Monitor(int critCPUs, int noneCPUs, int allCPUs) {
this.critCPUs = critCPUs;
this.noneCPUs = noneCPUs;
this.allCPUs = allCPUs;
}
public int getCritCPUs() {
return critCPUs;
}
public void setCritCPUs(int critCPUs) {
this.critCPUs = critCPUs;
}
public int getNoneCPUs() {
return noneCPUs;
}
public void setNoneCPUs(int noneCPUs) {
this.noneCPUs = noneCPUs;
}
}