cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject [01/20] git commit: updated refs/heads/master to a9f45df
Date Fri, 23 Dec 2016 12:21:08 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master cc9e3b2bd -> a9f45dfc5


CLOUDSTACK-9649: In the management server log there is an error
 related to 0.0.0.0 IP address

Added guest ip of VR as control ip for a Basic zone with VMware.


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

Branch: refs/heads/master
Commit: 15eab829c737dc9ec97721b9bab94c271d0a390d
Parents: f231c8c
Author: Sudhansu <sudhansu.sahu@accelerite.com>
Authored: Fri Dec 2 15:49:08 2016 +0530
Committer: Sudhansu <sudhansu.sahu@accelerite.com>
Committed: Sat Dec 3 10:25:53 2016 +0530

----------------------------------------------------------------------
 .../VirtualNetworkApplianceManagerImpl.java     | 30 +++++++++++++++++---
 1 file changed, 26 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/15eab829/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
index 3332393..e877f02 100644
--- a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
+++ b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
@@ -1208,10 +1208,9 @@ Configurable, StateListener<VirtualMachine.State, VirtualMachine.Event,
VirtualM
                 if (!Boolean.parseBoolean(serviceMonitoringFlag) || router.getVpcId() !=
null) {
                     continue;
                 }
+                String controlIP = getRouterControlIP(router);
 
-                final String privateIP = router.getPrivateIpAddress();
-
-                if (privateIP != null) {
+                if (controlIP != null && !controlIP.equals("0.0.0.0")) {
                     OpRouterMonitorServiceVO opRouterMonitorServiceVO = _opRouterMonitorServiceDao.findById(router.getId());
 
                     GetRouterAlertsCommand command = null;
@@ -1225,7 +1224,7 @@ Configurable, StateListener<VirtualMachine.State, VirtualMachine.Event,
VirtualM
                         command = new GetRouterAlertsCommand(opRouterMonitorServiceVO.getLastAlertTimestamp());
                     }
 
-                    command.setAccessDetail(NetworkElementCommand.ROUTER_IP, router.getPrivateIpAddress());
+                    command.setAccessDetail(NetworkElementCommand.ROUTER_IP, controlIP);
 
                     try {
                         final Answer origAnswer = _agentMgr.easySend(router.getHostId(),
command);
@@ -1280,6 +1279,29 @@ Configurable, StateListener<VirtualMachine.State, VirtualMachine.Event,
VirtualM
         }
     }
 
+    private String getRouterControlIP(DomainRouterVO router){
+        final DataCenterVO dcVo = _dcDao.findById(router.getDataCenterId());
+        String controlIP = null;
+
+        if(router.getHypervisorType() == HypervisorType.VMware  && dcVo.getNetworkType()
== NetworkType.Basic ){
+
+            final List<NicVO> nics = _nicDao.listByVmId(router.getId());
+            for (final NicVO nic : nics) {
+                final NetworkVO nc = _networkDao.findById(nic.getNetworkId());
+                if (nc.getTrafficType() == TrafficType.Guest && nic.getIPv4Address()
!= null) {
+                    controlIP = nic.getIPv4Address();
+                    break;
+                }
+            }
+            s_logger.debug("Vmware with Basic network selected Guest NIC ip as control IP
" + controlIP );
+        }else{
+            controlIP = _routerControlHelper.getRouterControlIp(router.getId());
+        }
+
+        s_logger.debug("IP of control NIC " + controlIP );
+        return controlIP;
+    }
+
     @Override
     public boolean finalizeVirtualMachineProfile(final VirtualMachineProfile profile, final
DeployDestination dest, final ReservationContext context) {
 


Mime
View raw message