wiki:GEMINI/Tutorial/GEC20/GENI_Desktop_and_GEMINI_data/RetrieveData

Version 21 (modified by mkeele@indiana.edu, 10 years ago) (diff)

--

Navigation: Up

Retrieving Data from the Periscope Supported Backend

Overview

In the previous exercise, you may have already configured measurement probes via the GENI Desktop GUI. Here we are going to show you what happens in UNIS, which is the topology service that actually supports and directs the measurements.


How the Components are Connected


The above diagram shows the components of the GEMINI framework. When a user reserves a slice, along with the slivers on that slice, hosts are created and connections between these hosts are built as well. Next step is to Initialize and Instrumentize these raw resources, which will install the tools that the GEMINI framework uses. BLiPP is the probe agent that is installed at each measurement point. The major task that BLiPP carries out is running various types of probes including ping, iperf, traceroute, etc. A user can either let these agents run a default probe or manually start the probes at selected times. Here's the link https://github.com/periscope-ps/blipp to the BLiPP code repository and here's the wiki page https://github.com/GENI-GEMINI/GEMINI/wiki/BLiPP-Documentation where you can investigate more about using BLiPP for your custom probes.


BLiPP Generates Metadata and Data from Measurements

BLiPP runs user measurements via probes, parses the command line output, and once completed BLiPP uploads the result data to the Measurement Store (MS). The MS is running on the Global Node which will act as a collection point for the data generated on the user slice. Due to the fact that there could be many different kinds of measurement data collected at different periods in the experiment, we separate the data into Metadata and Data. The Metadata will describe which particular Measurement Event Type a real data set belongs to and this is stored in UNIS for bookkeeping and for easy retrieval of the desired information. The actual data, will be stored on the Global Node via the Measurement Store on a per user slice basis, this allows us to tie data to a slice instance. The three UNIS objects you need to be familiar with for getting a full picture of your experiment: the measurement, the metadata of the measurement and the data of the metadata.


  • The Measurement object: A measurement object depicts what probe the user want to use and how that probe will run. For example, probe command line arguments for user preference (e.g. how many times to repeat? and at what interval?).
  • The Metadata object: Is a handle stored at UNIS to retrieve the actual data on a users Global Node, per slice. Also, this is the key information a user should specify should they need access to the raw data.
  • The Data object: Is a series of key value pairs in JSON format.


How to Access Data from UNIS and the MS

Before we provide a step-by-step guide to retrieving data, lets go more in depth with these components. UNIS is a topology service that is used to describe a network but underlying this concept is a RESTful API. As you might expect UNIS supports the standard HTTP Verbs: GET, POST, PUT, and DELETE.

  • For example, if we wanted to query all the nodes on our slice we could: GET unis_host:port/nodes
  • For example, if we wanted to query one particular node on our slice we could: GET unis_host:port/nodes/:id

These HTTP requests to UNIS can be executed through the browser, a script, or via the command line. For a more detailed explaination of the UNIS RESTful API see https://github.com/GENI-GEMINI/GEMINI/wiki/UNIS-REST-API. A user can supply the same HTTP verbs to interact with the MS but remember that the MS is located on the Global Node for a given slice. For a more detailed explaination of the MS RESTful API see https://github.com/GENI-GEMINI/GEMINI/wiki/MS-REST-API. If you would like more information about how UNIS represents the individual components of a network see this detailed resource http://monitor.incntre.iu.edu/docs/.

If you completed the previous exercise, http://groups.geni.net/geni/wiki/GEMINI/Tutorial/GEC20/GENI_Desktop_and_GEMINI_blipp/ExecuteExperiment, then you should have an Instrumentized slice with a couple of Virtual Machines and a Global Node.

Above is a sample web server topology that will be used in this example. The GN0 node represents the Global Node and is where the MS runs and where data is collectioned. VM and VM-0 are the Measurement Points where BLiPP executes the probes we supply.

  • To access the GN0: ssh username@pcvm2-4.instageni.illinois.edu
  • To access the VM: ssh username@pc2.instageni.illinois.edu -p 33339
  • To access the VM-0: ssh username@pc2.instageni.illinois.edu -p 33340

If one of the machines asks for a password your ssh keys may not be in place. Visit https://portal.geni.net/secure/profile.php and click SSH Keys to download your keys. Now lets login to the Global Node. Your command prompt should be similar to "[username@GN0]" for confirmation. There are a few important files to note on this machine.

  • The file /usr/local/etc/node.info contains information about your slice and what services it's using. This file can be found on any Global Node as it is created during the Instrumentation process.
  • The file /usr/local/etc/certs/unis-proxy.pem is the key, cert used to query the UNIS API, which is also created during the Instrumentation process.

When making a request to the UNIS API you will need to supply your key, cert and also the UUID of your slice so that you only see your subsection of UNIS. The slice UUID can be found in the "node.info" file with the following format, "auth_uuid=fc028e53-cfbf-463d-9bf3-d26c35333b10".

  • For example, to query all the nodes on your slice: GET /nodes?properties.geni.slice_uuid=fc028e53-cfbf-463d-9bf3-d26c35333b10

If you're going to be using a command line tool, such as curl, you will need to follow this structure to retrieve information from UNIS. Fortunately, we provide a python script https://github.com/periscope-ps/unis/blob/master/example/unis_client.py to help facilitate this process.

If you would like to try a periscope tool that handles your key, cert and slice uuid for you then you will need to install a dependency on the Global Node. For this example my Global Node is Fedora 15 but if you're using another image you can see more installation instructions here https://github.com/periscope-ps/periscope/tree/master/peri-js.

Install Dependencies
cd /usr/src
sudo wget http://nodejs.org/dist/v0.10.28/node-v0.10.28.tar.gz
sudo tar -xvzf node-v0.10.28.tar.gz
cd node-v0.10.28
sudo ./configure
sudo make
sudo make install

sudo yum install git

Test Dependencies
node -v
v0.10.28
npm -v
1.4.9
git --version
git version 1.7.6.5

Clone Periscope Tool
cd ~
git clone https://github.com/periscope-ps/periscope.git
cd periscope/peri-js/

Install Peri-JS Dependencies
sudo npm install
sudo npm install -g bower
bower install

Start Peri-JS
sudo npm start

Upon starting this tool you will see the UNIS instance you are connecting to, the MS store instance, and various information about the Global Node. The Peri-JS tool is a RESTful API itself that represents your subsection of UNIS. You can query this tool using the browser or command line.

Browser: http://pcvm2-4.instageni.illinois.edu:42424/api
CMD: curl pcvm2-4.instageni.illinois.edu:42424/api

Either way, when you request this URL you will see a list of routes you can query. These routes accept the same HTTP verbs as the UNIS and MS API's but Peri-JS only displays the data for your slice.

Routes
GET /api/slice
GET /api/nodes
GET /api/nodes/:id
GET /api/services
GET /api/services/:id
GET /api/measurements
GET /api/measurements/:id
POST /api/measurements/:id
GET /api/data/:id
GET /api/links
GET /api/links/:id
GET /api/ports
GET /api/ports/:id
GET /api/domains
GET /api/domains/:id

Once some measurements are posted and executed by BLiPP, metadata will be generated. Every measurement object has a list of event types associated with it and you will use this event type of find the data you desire. For example, if you were to schedule a throughput test you could expect an event type for bandwidth. BLiPP executes a few measurement probes directly after Instrumentation, such as cpu, mem, and net. Now, lets step through the process of gathering memory usage data.

Navigate to http://pcvm2-4.instageni.illinois.edu:42424/api/metadata to see a list of all metadata.

Search for "memory" and you will see every event types such as:
"ps:tools:blipp:linux:memory:utilization:free"
"ps:tools:blipp:linux:memory:utilization:kernel"
"ps:tools:blipp:linux:memory:utilization:used"

For the memory free event type copy the value for the id key and add that value to your route, http://pcvm2-4.instageni.illinois.edu:42424/api/metadata/53a486ad377f972d2e1b8e7b . This will display the single metadata object for memory free. To see the actual memory free data alter the URL to, http://pcvm2-4.instageni.illinois.edu:42424/api/data/53a486ad377f972d2e1b8e7b .

Now you should see all your data in JSON format. To reiterate, each metadata object represents an event type for a particular measurement. Navigating to a particular event type/metadata object by the metadata ID will get the single metadata object. Using that metadata ID, you can query the data route to get the data associated with that event type.

Once you have your data you might like to visualize it to help make discoveries from the data. At this repository, https://github.com/GENI-GEMINI/UW/blob/master/msplot_python/ms_plot.py we provide a script to help you with data visualization.

...install python dependencies


Attachments (5)

Download all attachments as: .zip