Repository: stratos
Updated Branches:
  refs/heads/lvs_extension 33460d56e -> ea2a752ea


Update python agent with virtual ip subnet mask


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/ea2a752e
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/ea2a752e
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/ea2a752e

Branch: refs/heads/lvs_extension
Commit: ea2a752eaaa532485156bb30c70e55279c3c7c39
Parents: 33460d5
Author: Gayan Gunarathne <[email protected]>
Authored: Wed May 27 15:16:22 2015 +0530
Committer: Gayan Gunarathne <[email protected]>
Committed: Wed May 27 15:16:22 2015 +0530

----------------------------------------------------------------------
 .../extensions/bash/CreateLVSDummyInterface.sh               | 4 ++--
 .../cartridge.agent/modules/event/eventhandler.py            | 8 ++++++--
 .../simple/single-group-app/artifacts/application.json       | 4 ++--
 3 files changed, 10 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/ea2a752e/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/extensions/bash/CreateLVSDummyInterface.sh
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/extensions/bash/CreateLVSDummyInterface.sh
 
b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/extensions/bash/CreateLVSDummyInterface.sh
index 39c7f96..3fb7d3b 100755
--- 
a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/extensions/bash/CreateLVSDummyInterface.sh
+++ 
b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/extensions/bash/CreateLVSDummyInterface.sh
@@ -26,6 +26,6 @@
 
 
 modprobe dummy numdummies=1
-ifconfig dummy0 ${STRATOS_LVS_VIRTUAL_IP} netmask 255.255.255.0
+ifconfig dummy0 ${STRATOS_LVS_DUMMY_VIRTUAL_IP} netmask 
${STRATOS_LVS_SUBNET_MASK}
 
-echo "update the dummy interface with ${STRATOS_LVS_VIRTUAL_IP}"
\ No newline at end of file
+echo "update the dummy interface with ${STRATOS_LVS_DUMMY_VIRTUAL_IP} and 
${STRATOS_LVS_SUBNET_MASK}"
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/ea2a752e/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/event/eventhandler.py
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/event/eventhandler.py
 
b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/event/eventhandler.py
index 1bda169..8888693 100644
--- 
a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/event/eventhandler.py
+++ 
b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/event/eventhandler.py
@@ -61,8 +61,11 @@ class EventHandler:
 
     def create_dummy_interface(self):
         self.__log.debug("Processing lvs dummy interface creation...")
+        lvs_vip = self.__config.lvs_virtual_ip.split("|")
+        self.__log.debug("LVS dummy interface creation values %s %s " 
%(lvs_vip[0], lvs_vip[1]) )
         self.execute_event_extendables(constants.CREATE_LVS_DUMMY_INTERFACE,
-                                       {"LVS_VIRTUAL_IP": 
self.__config.lvs_virtual_ip})
+                                       {"EVENT": 
constants.CREATE_LVS_DUMMY_INTERFACE, "LVS_DUMMY_VIRTUAL_IP": lvs_vip[0],
+                                        "LVS_SUBNET_MASK": lvs_vip[1]})
 
     def on_instance_activated_event(self):
         self.__log.debug("Processing instance activated event...")
@@ -635,7 +638,8 @@ class EventHandler:
         lb_private_ip, lb_public_ip = 
EventHandler.get_lb_member_ip(lb_cluster_id_in_payload)
         plugin_values["LB_IP"] = lb_private_ip if lb_private_ip is not None 
else self.__config.lb_private_ip
         plugin_values["LB_PUBLIC_IP"] = lb_public_ip if lb_public_ip is not 
None else self.__config.lb_public_ip
-        plugin_values["LVS_VIRTUAL_IP"] =self.__config.lvs_virtual_ip
+
+
 
         topology = TopologyContext.get_topology()
         if topology.initialized:

http://git-wip-us.apache.org/repos/asf/stratos/blob/ea2a752e/samples/applications/simple/single-group-app/artifacts/application.json
----------------------------------------------------------------------
diff --git 
a/samples/applications/simple/single-group-app/artifacts/application.json 
b/samples/applications/simple/single-group-app/artifacts/application.json
index 5a7a9eb..5877bfd 100644
--- a/samples/applications/simple/single-group-app/artifacts/application.json
+++ b/samples/applications/simple/single-group-app/artifacts/application.json
@@ -30,7 +30,7 @@
                         "type": "php",
                         "cartridgeMin": 2,
                         "cartridgeMax": 4,
-                        "lvsVirtualIP": "192.168.56.60",
+                        "lvsVirtualIP": "192.168.56.50|255.255.255.0",
                         "subscribableInfo": {
                             "alias": "my-php",
                             "autoscalingPolicy": "autoscaling-policy-1",
@@ -51,7 +51,7 @@
                 "type": "tomcat",
                 "cartridgeMin": 2,
                 "cartridgeMax": 4,
-                "lvsVirtualIP": "192.168.56.50",
+                "lvsVirtualIP": "192.168.56.50|255.255.255.0",
                 "subscribableInfo": {
                     "alias": "my-tomcat",
                     "autoscalingPolicy": "autoscaling-policy-1",

Reply via email to