SmartDomains tutorial

SmartDomains is a tool for automated deployment and management of distributed Xen virtual machines.
Project page
Project authors: Olivier Pernet and Xavier Grehant.
Developed as part of Grid IC projects of CERN openlab second phase.

This tutorial: Xavier Grehant (xagATcernDOTch)
In sync with revision 127 (release 0.9.08)

SmartDomains is a showcase of SmartFrog, a framework for distributed configuration and deployment developed at HP Labs.

Contents


Launch a simple description


Launch a SmartFrog daemon

> sfDaemon

You should get something like this:

2006/11/02 10:22:33:011 CET [DEBUG][main] SFCORE_LOG - Logger registered: class org.smartfrog.sfcore.logging.LogToStreamsImpl 2006/11/02 10:22:33:013 CET [WARN ][main] SFCORE_LOG - SmartFrog security is NOT active SmartFrog 3.10.005dev (C) Copyright 1998-2006 Hewlett-Packard Development Company, LP 2006/11/02 10:22:33:704 CET [DEBUG][main] HOST machine9.cern.ch:rootProcess - Logger registered: class org.smartfrog.sfcore.logging.LogToStreamsImpl 2006/11/02 10:22:34:265 CET [DEBUG][main] HOST machine9.cern.ch:rootProcess:sfDefault - Logger registered: class org.smartfrog.sfcore.logging.LogToStreamsImpl 2006/11/02 10:22:34:266 CET [DEBUG][main] HOST machine9.cern.ch:rootProcess - ProcessCompound 'rootProcess' started. SmartFrog ready... [rootProcess:3800] Thu Nov 02 10:22:34 CET 2006

Now your computer is able to deploy and manage descriptions either launched by you locally or communicated by other SmartFrog daemons through port RMI (3800).

Download or write the description

A SmartFrog description is the description of a distributed application in SmartFrog language. Common practice is to write it in a set of files with extension .sf. The description given in example can be downloaded here: mgtConsole.sf. Here is the content:

#include "org/smartfrog/components.sf" #include "/org/smartfrog/services/management/components.sf" sfConfig extends Compound { mngt extends DeployManagement; }

Launching this description will display the management console on the screen (if you have a screen and a window manager on this computer). The description of Compound can be found in file org/smartfrog/components.sf. It is extended here with a new attribute called mngt. mngt is just a name. It links here to another component (DeployManagement) whose description can be found in org/smartfrog/services/management/components.sf. The new extension of Compound is bound here to attribute sfConfig.

Both Compound and DeployManagement components have behaviors: each of them has in its description an attribute sfClass whose value refers to a Java object. Compound's behavior consists in deploying the components given as its attributes. It also manages their lifecycle with the default strategy. Many other components derivate from it and manage different lifecycles for their children. DeployManagement's behavior consists in displaying the management console.

sfConfig is the top attribute of any description. When a description is launched, it is actually the description of sfConfig which is launched.

Launch the description

On another shell:

> sfStart localhost console mgtConsole.sf

This means you launch the description in mgtConsole.sf on localhost, and you call console the resulting running application.

2006/11/02 09:32:56:075 CET [WARN ][main] SFCORE_LOG - SmartFrog security is NOT active SmartFrog 3.10.007dev (C) Copyright 1998-2006 Hewlett-Packard Development Company, LP - Successfully deployed: 'HOST oplaport3.cern.ch:rootProcess:console', [mgtConsole.sf], host:localhost

The default SmartFrog management console should appear:

The attributes/values displayed here are the default parameters of the deployed management console itself. They come from DeployManagement's description.

Terminate the application

> sfTerminate localhost console
"Terminating localhost" 2006/11/02 12:34:04:630 CET [WARN ][main] SFCORE_LOG - SmartFrog security is NOT active SmartFrog 3.10.007dev (C) Copyright 1998-2006 Hewlett-Packard Development Company, LP - Successfully terminated: 'console', host:localhost

Stop SmartFrog daemon

If finally you don't want to use this computer as host for Xen virtual domains nor client node for remote deployments, you can stop the daemon.

> sfStopDaemon localhost
"Stopping sfDaemon in localhost" 2006/11/02 12:44:52:684 CET [WARN ][main] SFCORE_LOG - SmartFrog security is NOT active SmartFrog 3.10.007dev (C) Copyright 1998-2006 Hewlett-Packard Development Company, LP SmartFrog daemon terminated - Successfully terminated: 'rootProcess', host:localhost

Everything you did here is powered by SmartFrog tools integrated as is into SmartDomains distribution. SmartFrog is the Java programming framework, the description language, parser, convenience components, scripts, and much more. SmartDomains takes a subset of SmartFrog (the core), builds new components on it to manage Xen virtual domains, and makes the result a standalone project easier to use. In section Describe a pool of virtual domains we get onto SmartDomains specific components.