From 15eab829c737dc9ec97721b9bab94c271d0a390d Mon Sep 17 00:00:00 2001 From: Sudhansu Date: Fri, 2 Dec 2016 15:49:08 +0530 Subject: [PATCH] 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. --- .../VirtualNetworkApplianceManagerImpl.java | 30 ++++++++++++++++--- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java index 3332393f652..e877f023702 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 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) {