Skip to content

Quick guide Simple ping check on two machines

Ondrej Lichtner edited this page Nov 3, 2016 · 9 revisions

Test setup

  test machine 1           test machine 2
  --------------           --------------
    eth0  eth1               eth1  eth0
     |     |                  |     |
     |     |    +--------+    |     |
     |     +----| SWITCH |----+     |
     |          +--------+          |
     |                              |
     |          +--------+          |
     +----------| SWITCH |----------+
                +--------+
                    |
                    |
                   eth0
            ------------------
            controller machine
            (e.g. your laptop)

Test goal

We want to ping test machine 2 (eth1) from test machine 1 (eth1).

LNST recipe

Save the following code into file recipe.xml on your controller machine.

<lnstrecipe>
    <network>
        <host id="testmachine1">
            <interfaces>
                <eth label="tnet" id="testifc1">
                    <addresses>
                         <address value="192.168.200.2/24"/>
                    </addresses>
                </eth>
            </interfaces>
        </host>

        <host id="testmachine2">
            <interfaces>
                <eth label="tnet" id="testifc2">
                    <addresses>
                        <address value="192.168.200.3/24"/>
                    </addresses>
                </eth>
            </interfaces>
        </host>
    </network>

    <task>
        <run module="IcmpPing" host="testmachine1">
            <options>
                <option name="addr" value="{ip(testmachine2,testifc2)}"/>
                <option name="count" value="3"/>
            </options>
        </run>
    </task>
</lnstrecipe>

Running the test

First you need to make sure that the lnst-slave daemon is running on the specified slave machines. To do this you run:

$ systemctl start lnst-slave.service

on all the slave machines. You can learn more about the LNST invocation in LNST Invocation.

After you've made sure that lnst is running on all the slave machines you just need to run the controller. For that you first need to create a pool with the two test machines that you will be using.

  1. create a new directory for the pool, e.g. ~/.lnst/pool/

  2. create two files describing the test machines, machine1.xml and machine2.xml

  3. use this xml as a template for the previous two files, REPLACE the HOSTNAME and HWADDR in both files with an approriate value.

<slavemachine>
    <params>
        <param name="hostname" value="HOSTNAME"/>
    </params>
    <interfaces>
        <eth label="A" id="1">
            <params>
                <param name="hwaddr" value="HWADDR"/>
            </params>
        </eth>
    </interfaces>
</slavemachine>

And after you've created the pool just run the controller (on the controller machine) like this:

$ lnst-ctl run recipe.xml

References