Repository: cloudstack Updated Branches: refs/heads/master d0da107b7 -> cb4513379
for windows guest OS, configure gateway for each nic Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/cb451337 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/cb451337 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/cb451337 Branch: refs/heads/master Commit: cb4513379996b262ae378daf00c6388c6b7313cf Parents: d0da107 Author: Anthony Xu <[email protected]> Authored: Tue Sep 16 14:31:07 2014 -0700 Committer: Anthony Xu <[email protected]> Committed: Tue Sep 16 14:33:22 2014 -0700 ---------------------------------------------------------------------- .../router/VirtualNetworkApplianceManagerImpl.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cb451337/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 0248412..c95867e 100755 --- a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java +++ b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java @@ -180,6 +180,7 @@ import com.cloud.resource.ResourceManager; import com.cloud.server.ConfigurationServer; import com.cloud.service.ServiceOfferingVO; import com.cloud.service.dao.ServiceOfferingDao; +import com.cloud.storage.GuestOSVO; import com.cloud.storage.Storage.ProvisioningType; import com.cloud.storage.VMTemplateVO; import com.cloud.storage.Volume; @@ -3656,10 +3657,12 @@ VirtualMachineGuru, Listener, Configurable, StateListener<State, VirtualMachine. final DhcpEntryCommand dhcpCommand = new DhcpEntryCommand(nic.getMacAddress(), nic.getIp4Address(), vm.getHostName(), nic.getIp6Address(), _networkModel.getExecuteInSeqNtwkElmtCmd()); final DataCenterVO dcVo = _dcDao.findById(router.getDataCenterId()); - final Nic defaultNic = findGatewayIp(vm.getId()); - String gatewayIp = defaultNic.getGateway(); - if (gatewayIp != null && !gatewayIp.equals(nic.getGateway())) { - gatewayIp = "0.0.0.0"; + String gatewayIp = nic.getGateway(); + if (!nic.isDefaultNic() ) { + GuestOSVO guestOS = _guestOSDao.findById(vm.getGuestOSId()); + if ( guestOS == null || !guestOS.getDisplayName().toLowerCase().contains("windows")) { + gatewayIp = "0.0.0.0"; + } } dhcpCommand.setDefaultRouter(gatewayIp); dhcpCommand.setIp6Gateway(nic.getIp6Gateway());
