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


Orchestrate virtual domains


Asynchronous deployment

Using Compound in previous examples was a waste of time because every virtual domain waited for the previous in the description to be launched, even on another host. Instead, we can replace it with one of its derivative: Parallel with switch asynchCreateChild true. Changing localVirtualPool.sf, this would give:

#include "org/smartfrog/components.sf" #include "ch/cern/openlab/smartdomains/components.sf" #include "org/smartfrog/services/shellscript/components.sf" #include "ch/cern/openlab/util/schemas.sf" #include "org/smartfrog/sfcore/workflow/combinators/parallel.sf" DefaultXenDomain extends XenDomain { shell LAZY ATTRIB myShell; kernel "/boot/vmlinuz-2.6-xen"; gateway "999.999.1.1"; netmask "255.255.0.0"; } sfConfig extends Compound { sfSyncTerminate true; myShell extends BashShell; pool extends Parallel { asynchCreateChild true; smartDomain1 extends Compound { sfSyncTerminate true; loop extends LoopbackStorageBackend { shell LAZY ATTRIB myShell; domainName "domainLoopback"; baseImage "/data/xen/slc3-smartfrog.img"; } domain1 extends DefaultXenDomain { domainName "domainLoopback"; // useless since rev 84 (release 0.9.02) ip "999.999.999.999"; hostname "machine9-dom1"; storageBackend LAZY ATTRIB loop; } } smartDomain2 extends Compound { sfSyncTerminate true; lvm extends LVMStorageBackend { shell LAZY ATTRIB myShell; domainName "domainLVM"; baseImage "/data/xen/slc3-smartfrog.img"; } domain2 extends DefaultXenDomain { domainName "domainLVM"; // useless since rev 84 (release 0.9.02) ip "999.999.999.998"; hostname "machine9-dom2"; storageBackend LAZY ATTRIB lvm; } } } }

There are 3 phases in a lifecycle of a SmartDomain:

deployment, start and termination are the 3 phases of any SmartFrog component. Compound and Parallel orchestrate the phases of their children, but not the same way.
Compound deploys them in order, one after the other, then starts them all. On termination of one of its children, Compound terminates the other children and itself.
Parallel glues together deployment and start phase. It handles next child only after current is started, except if attribute asynchCreateChild is set to true. In this case it starts all deployments together.