targets for setting the of controllers
authorGiuseppe Lettieri <g.lettieri@iet.unipi.it>
Thu, 27 Sep 2012 14:19:59 +0000 (16:19 +0200)
committerGiuseppe Lettieri <g.lettieri@iet.unipi.it>
Thu, 27 Sep 2012 14:19:59 +0000 (16:19 +0200)
add CONTROLLER_x=... for each bridge x in conf.mk
(e.g., CONTROLLER_SENDER=tcp:127.0.0.1:6663).
The run:

make -j controllers

to set the controllers.
Note: use IP addresses and not DNS names.

planetlab/exp-tool/Makefile

index a6b0103..09560ee 100644 (file)
@@ -113,6 +113,10 @@ BRIDGES=$(foreach id,$(ALL_NODE_IDS),cache/bridge.$(id))
 bridges: $(BRIDGES)
 .PHONY: bridges
 
+CONTROLLERS=$(foreach id,$(ALL_NODE_IDS),cache/controller.$(id))
+controllers: $(CONTROLLERS)
+.PHONY: controllers
+
 ### node-oriented targets
 # check ssh connectivity
 cache/sshcheck.%: FORCE
@@ -141,6 +145,10 @@ cache/bridge.%: cache/switch.%
        @$(SSH) $(HOST_$*) $(SUDO) sliver-ovs create-bridge $(BRIDGE) $(IP_$*) > $@ 2> $(call log,$@) || { rm $@; exit 1; }
        @echo Created bridge with tap $$(cat $@) on $(call display,$*)
 
+cache/controller.%: cache/bridge.%
+       @echo "Setting controller on $(call display,$*) - logs in $(call log,$@)"
+       @$(SSH) $(HOST_$*) $(SUDO) ovs-vsctl set-controller $(BRIDGE) $(CONTROLLER_$*) &> $(call log,$@) || { rm $@; exit 1; }
+
 # xxx this probably needs a more thorough cleanup in cache/
 cache/stop.%: del-bridge.%
        @echo "Stopping switch & db on $(call display,$*)"