This is an automated email from the ASF dual-hosted git repository.
dahn pushed a commit to branch 4.13
in repository https://gitbox.apache.org/repos/asf/cloudstack.git
The following commit(s) were added to refs/heads/4.13 by this push:
new 3f8b2c3 vrouter: reload keepalived instead of restart and fix
password… (#3898)
3f8b2c3 is described below
commit 3f8b2c369dc894696bb06768f6bd355b3a2e6eda
Author: Wei Zhou <[email protected]>
AuthorDate: Fri Feb 28 17:15:51 2020 +0100
vrouter: reload keepalived instead of restart and fix password… (#3898)
---
systemvm/debian/opt/cloud/bin/configure.py | 2 +-
systemvm/debian/opt/cloud/bin/cs/CsAddress.py | 5 +++++
systemvm/debian/opt/cloud/bin/cs/CsRedundant.py | 12 +++++++++---
3 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/systemvm/debian/opt/cloud/bin/configure.py
b/systemvm/debian/opt/cloud/bin/configure.py
index cadb7c5..2e2fbec 100755
--- a/systemvm/debian/opt/cloud/bin/configure.py
+++ b/systemvm/debian/opt/cloud/bin/configure.py
@@ -61,7 +61,7 @@ class CsPassword(CsDataBag):
server_ip = None
guest_ip = None
for interface in self.config.address().get_interfaces():
- if interface.ip_in_subnet(vm_ip):
+ if interface.ip_in_subnet(vm_ip) and interface.is_added():
if self.config.cl.is_redundant():
server_ip = interface.get_gateway()
guest_ip = interface.get_ip()
diff --git a/systemvm/debian/opt/cloud/bin/cs/CsAddress.py
b/systemvm/debian/opt/cloud/bin/cs/CsAddress.py
index 0f1a807..5b0c057 100755
--- a/systemvm/debian/opt/cloud/bin/cs/CsAddress.py
+++ b/systemvm/debian/opt/cloud/bin/cs/CsAddress.py
@@ -581,6 +581,11 @@ class CsIP:
CsPasswdSvc(self.address['public_ip']).start()
elif method == "delete":
CsPasswdSvc(self.address['public_ip']).stop()
+ elif cmdline.is_master():
+ if method == "add":
+ CsPasswdSvc(self.address['gateway'] + "," +
self.address['public_ip']).start()
+ elif method == "delete":
+ CsPasswdSvc(self.address['gateway'] + "," +
self.address['public_ip']).stop()
if self.get_type() == "public" and self.config.is_vpc() and method ==
"add":
if self.address["source_nat"]:
diff --git a/systemvm/debian/opt/cloud/bin/cs/CsRedundant.py
b/systemvm/debian/opt/cloud/bin/cs/CsRedundant.py
index 8f38961..cefedbf 100755
--- a/systemvm/debian/opt/cloud/bin/cs/CsRedundant.py
+++ b/systemvm/debian/opt/cloud/bin/cs/CsRedundant.py
@@ -194,10 +194,15 @@ class CsRedundant(object):
heartbeat_cron.commit()
proc = CsProcess(['/usr/sbin/keepalived'])
- if not proc.find() or keepalived_conf.is_changed() or
force_keepalived_restart:
+ if not proc.find():
+ force_keepalived_restart = True
+ if keepalived_conf.is_changed() or force_keepalived_restart:
keepalived_conf.commit()
os.chmod(self.KEEPALIVED_CONF, 0o644)
- CsHelper.service("keepalived", "restart")
+ if force_keepalived_restart or not self.cl.is_master():
+ CsHelper.service("keepalived", "restart")
+ else:
+ CsHelper.service("keepalived", "reload")
def release_lock(self):
try:
@@ -339,7 +344,8 @@ class CsRedundant(object):
interfaces = [interface for interface in self.address.get_interfaces()
if interface.needs_vrrp()]
for interface in interfaces:
- CsPasswdSvc(interface.get_gateway() + "," +
interface.get_ip()).restart()
+ if interface.is_added():
+ CsPasswdSvc(interface.get_gateway() + "," +
interface.get_ip()).restart()
CsHelper.service("dnsmasq", "restart")
self.cl.set_master_state(True)