diff --git a/patches/systemvm/debian/config/etc/init.d/cloud-early-config b/patches/systemvm/debian/config/etc/init.d/cloud-early-config index d3748093337..cbdb975163e 100755 --- a/patches/systemvm/debian/config/etc/init.d/cloud-early-config +++ b/patches/systemvm/debian/config/etc/init.d/cloud-early-config @@ -327,9 +327,10 @@ setup_redundant_router() { sed -i "s/\[IGNORE_IP2\]/$ETH0_IP/g" /etc/conntrackd/conntrackd.conf sed -i "s/\[IGNORE_IP3\]/$ETH1_IP/g" /etc/conntrackd/conntrackd.conf sed -i "s/\[ETH2IP\]/$ETH2_IP/g" /root/redundant_router/enable_pubip.sh + sed -i "s/\[ETH2MASK\]/$ETH2_MASK/g" /root/redundant_router/enable_pubip.sh sed -i "s/\[GATEWAY\]/$GW/g" /root/redundant_router/enable_pubip.sh sed -i "s/--exec\ \$DAEMON;/--exec\ \$DAEMON\ --\ --vrrp;/g" /etc/init.d/keepalived - #grep "sleep 10;" /etc/init.d/keepalived > /dev/null + grep "sleep 10;" /etc/init.d/keepalived > /dev/null if [ $? -ne 0 ] then sed -i "s/if\ start-stop-daemon\ --start/sleep\ 10;if\ start-stop-daemon\ --start/g" /etc/init.d/keepalived diff --git a/patches/systemvm/debian/config/root/redundant_router/disable_pubip.sh b/patches/systemvm/debian/config/root/redundant_router/disable_pubip.sh index 349ddef14ea..9a9a2c6f72f 100644 --- a/patches/systemvm/debian/config/root/redundant_router/disable_pubip.sh +++ b/patches/systemvm/debian/config/root/redundant_router/disable_pubip.sh @@ -1,5 +1,4 @@ #!/bin/bash -ifdown eth2 ifconfig eth2 down service dnsmasq stop diff --git a/patches/systemvm/debian/config/root/redundant_router/enable_pubip.sh.templ b/patches/systemvm/debian/config/root/redundant_router/enable_pubip.sh.templ index ac8b0e0ea85..1ad513ab6ac 100644 --- a/patches/systemvm/debian/config/root/redundant_router/enable_pubip.sh.templ +++ b/patches/systemvm/debian/config/root/redundant_router/enable_pubip.sh.templ @@ -1,8 +1,8 @@ #!/bin/bash -ifdown eth2 && \ ifconfig eth2 down && \ ifconfig eth2 hw ether [ETH2MAC] && \ -ifup eth2 && \ +ifconfig eth2 [ETH2IP] netmask [ETH2MASK] && \ +ifconfig eth2 up && \ ip route add default via [GATEWAY] dev eth2 && \ service dnsmasq restart diff --git a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java index 5671d64f326..f71b76bb8ad 100755 --- a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java +++ b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java @@ -98,6 +98,7 @@ import com.cloud.exception.PermissionDeniedException; import com.cloud.exception.ResourceUnavailableException; import com.cloud.exception.StorageUnavailableException; import com.cloud.host.HostVO; +import com.cloud.host.Status; import com.cloud.host.dao.HostDao; import com.cloud.hypervisor.Hypervisor.HypervisorType; import com.cloud.network.IPAddressVO; @@ -766,7 +767,8 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian String privateIP = router.getPrivateIpAddress(); HostVO host = _hostDao.findById(router.getHostId()); /* Only cover hosts managed by this management server */ - if (host == null || host.getManagementServerId() != ManagementServerNode.getManagementServerId()) { + if (host == null || host.getStatus() != Status.Up || + host.getManagementServerId() != ManagementServerNode.getManagementServerId()) { continue; } if (privateIP != null) {