Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion systemvm/debian/opt/cloud/bin/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def __update(self, vm_ip, password):
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()
Expand Down
5 changes: 5 additions & 0 deletions systemvm/debian/opt/cloud/bin/cs/CsAddress.py
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,11 @@ def post_config_change(self, method):
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"]:
Expand Down
12 changes: 9 additions & 3 deletions systemvm/debian/opt/cloud/bin/cs/CsRedundant.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,15 @@ def _redundant_on(self):
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:
Expand Down Expand Up @@ -339,7 +344,8 @@ def set_master(self):

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)
Expand Down