You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by al...@apache.org on 2013/07/26 01:39:32 UTC

[4/4] git commit: updated refs/heads/master to 2e0847b

CLOUDSTACK-3232: InternalLB system vm - allocate control ip address from the private range when vm's hypervisor is vmWare


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

Branch: refs/heads/master
Commit: 2e0847bfe01e74f5c80e028b66aee74d7a07493f
Parents: 6a916b9
Author: Alena Prokharchyk <al...@citrix.com>
Authored: Thu Jul 25 16:34:03 2013 -0700
Committer: Alena Prokharchyk <al...@citrix.com>
Committed: Thu Jul 25 16:39:23 2013 -0700

----------------------------------------------------------------------
 server/src/com/cloud/network/guru/ControlNetworkGuru.java | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2e0847bf/server/src/com/cloud/network/guru/ControlNetworkGuru.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/guru/ControlNetworkGuru.java b/server/src/com/cloud/network/guru/ControlNetworkGuru.java
index 6060dac..4c5d247 100755
--- a/server/src/com/cloud/network/guru/ControlNetworkGuru.java
+++ b/server/src/com/cloud/network/guru/ControlNetworkGuru.java
@@ -109,7 +109,7 @@ public class ControlNetworkGuru extends PodBasedNetworkGuru implements NetworkGu
     public NicProfile allocate(Network config, NicProfile nic, VirtualMachineProfile vm) throws InsufficientVirtualNetworkCapcityException,
     InsufficientAddressCapacityException {
 
-        if(vm.getHypervisorType() == HypervisorType.VMware && vm.getType() != VirtualMachine.Type.DomainRouter) {
+        if(vm.getHypervisorType() == HypervisorType.VMware && !isRouterVm(vm)) {
             NicProfile nicProf = new NicProfile(Nic.ReservationStrategy.Create, null, null, null, null);
             String mac = _networkMgr.getNextAvailableMacAddressInNetwork(config.getId());
             nicProf.setMacAddress(mac);
@@ -132,7 +132,7 @@ public class ControlNetworkGuru extends PodBasedNetworkGuru implements NetworkGu
     InsufficientAddressCapacityException {
         assert nic.getTrafficType() == TrafficType.Control;
 
-        if (dest.getHost().getHypervisorType() == HypervisorType.VMware && vm.getType() == VirtualMachine.Type.DomainRouter) {
+        if (dest.getHost().getHypervisorType() == HypervisorType.VMware && isRouterVm(vm)) {
             if(dest.getDataCenter().getNetworkType() != NetworkType.Basic) {
                 super.reserve(nic, config, vm, dest, context);
 
@@ -166,7 +166,7 @@ public class ControlNetworkGuru extends PodBasedNetworkGuru implements NetworkGu
     public boolean release(NicProfile nic, VirtualMachineProfile vm, String reservationId) {
         assert nic.getTrafficType() == TrafficType.Control;
 
-        if (vm.getHypervisorType() == HypervisorType.VMware && vm.getType() == VirtualMachine.Type.DomainRouter) {
+        if (vm.getHypervisorType() == HypervisorType.VMware && isRouterVm(vm)) {
             long dcId = vm.getVirtualMachine().getDataCenterId();
             DataCenterVO dcVo = _dcDao.findById(dcId);
             if(dcVo.getNetworkType() != NetworkType.Basic) {
@@ -194,6 +194,10 @@ public class ControlNetworkGuru extends PodBasedNetworkGuru implements NetworkGu
         return true;
     }
 
+    protected boolean isRouterVm(VirtualMachineProfile<? extends VirtualMachine> vm) {
+        return vm.getType() == VirtualMachine.Type.DomainRouter || vm.getType() == VirtualMachine.Type.InternalLoadBalancerVm;
+    }
+
     @Override
     public Network implement(Network config, NetworkOffering offering, DeployDestination destination, ReservationContext context) throws InsufficientVirtualNetworkCapcityException {
         assert config.getTrafficType() == TrafficType.Control : "Why are you sending this configuration to me " + config;