Go back --> [wiki:Tutorials Tutorials] [[TOC(heading=Tutorial TOC, Tutorials, depth=2)]] = How to define and use Topologies in an experiment script = === Prerequisite === This feature is only available in [wiki:Old/NodeHandler NodeHandler v4] and above. Before going through this tutorial, you should know the basics of writing and running an experiment script (see [wiki:Tutorial/HelloWorld here] and [wiki:Tutorial/HowtoWriteScripts here]). You should also have installed a disk image with Node Agent v4 on the nodes of the testbed you are using (e.g. "baseline.ndz"). See [wiki:Tutorial/HowToImage "How to install a disk image"]. === Goal === In this tutorial, you will learn a simple way to define and use topology in your experiments. As explained [wiki:Tutorial/HowToImage here], after installing an image on all the nodes of a testbed, 3 default topologies will be generated. One of them (system:topo:active) defines all the nodes that were correctly imaged. In other words, it contains a list of all nodes on the testbed that are currently working and have the requested disk image. In this tutorial experiment, you will use this default active topology to create your own topologies to use in your experiments. === The tutorial experiment === This experiment is given in the attached script [attachment:tut_topo_1.rb tut_topo_1.rb]. This file contains extensive comments that should help you understand the different steps involved in defining and using topologies. You can find more detailed information on the available commands to define topologies [wiki:Documentation/NodeHandler/Commands/defTopology here]. To run this example script, use the following command: {{{ omf exec tut_topo_1 }}} === The Results === The experiment screen output should then look like [attachment:grid_2007_08_27_20_45_37-Output.txt this]. And the experiment log file should look like [attachment:grid_2007_08_27_20_45_37.log this]. You can also access the results of this particular experiment example in the MySQL database, using the experiment ID: "grid_2007_08_27_20_45_37" (please refer to [wiki:Tutorials/AnalyzeResults this page] for more information on accessing the results). === More... === This other script [attachment:tut_topo_1_more.rb tut_topo_1_more.rb] contains an extended version of the above script with more optional features.