incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alena1...@apache.org
Subject [8/51] [abbrv] git commit: VPC : revert some change
Date Fri, 15 Jun 2012 22:38:02 GMT
VPC : revert some change


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

Branch: refs/heads/vpc
Commit: e69561b8577757c3bbfdf3f9ea4af3a0fd9a1ce1
Parents: 3e5f391
Author: anthony <anthony@cloud.com>
Authored: Tue Jun 12 15:32:06 2012 -0700
Committer: Alena Prokharchyk <alena.prokharchyk@citrix.com>
Committed: Fri Jun 15 14:32:47 2012 -0700

----------------------------------------------------------------------
 .../com/cloud/network/guru/ControlNetworkGuru.java |   19 +++++++++++++-
 .../network/lb/ElasticLoadBalancerManagerImpl.java |    6 ++++
 .../router/VirtualNetworkApplianceManagerImpl.java |   18 ++++++++-----
 wscript                                            |    2 +-
 4 files changed, 35 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/e69561b8/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 807bf31..4427be7 100755
--- a/server/src/com/cloud/network/guru/ControlNetworkGuru.java
+++ b/server/src/com/cloud/network/guru/ControlNetworkGuru.java
@@ -106,7 +106,14 @@ public class ControlNetworkGuru extends PodBasedNetworkGuru implements
NetworkGu
     @Override
     public NicProfile allocate(Network config, NicProfile nic, VirtualMachineProfile<?
extends VirtualMachine> vm) throws InsufficientVirtualNetworkCapcityException,
             InsufficientAddressCapacityException {
-       
+    	
+        if(vm.getHypervisorType() == HypervisorType.VMware && vm.getType() != VirtualMachine.Type.DomainRouter)
{
+        	NicProfile nicProf = new NicProfile(Nic.ReservationStrategy.Create, null, null,
null, null);
+            String mac = _networkMgr.getNextAvailableMacAddressInNetwork(config.getId());
+            nicProf.setMacAddress(mac);
+            return nicProf;
+        }
+        
         if (nic != null) {
             throw new CloudRuntimeException("Does not support nic specification at this time:
" + nic);
         }
@@ -130,6 +137,15 @@ public class ControlNetworkGuru extends PodBasedNetworkGuru implements
NetworkGu
 	            String mac = _networkMgr.getNextAvailableMacAddressInNetwork(config.getId());
 	            nic.setMacAddress(mac);
 	            return;
+        	} else {
+        		// in basic mode and in VMware case, control network will be shared with guest
network
+	            String mac = _networkMgr.getNextAvailableMacAddressInNetwork(config.getId());
+	            nic.setMacAddress(mac);
+	            nic.setIp4Address("0.0.0.0");
+	            nic.setNetmask("0.0.0.0");
+	            nic.setFormat(AddressFormat.Ip4);
+	            nic.setGateway("0.0.0.0");
+        		return;
         	}
         }
         
@@ -142,7 +158,6 @@ public class ControlNetworkGuru extends PodBasedNetworkGuru implements
NetworkGu
         nic.setNetmask("255.255.0.0");
         nic.setFormat(AddressFormat.Ip4);
         nic.setGateway(NetUtils.getLinkLocalGateway());
-        nic.setDeviceId(0);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/e69561b8/server/src/com/cloud/network/lb/ElasticLoadBalancerManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/lb/ElasticLoadBalancerManagerImpl.java b/server/src/com/cloud/network/lb/ElasticLoadBalancerManagerImpl.java
index 17b4050..1870518 100644
--- a/server/src/com/cloud/network/lb/ElasticLoadBalancerManagerImpl.java
+++ b/server/src/com/cloud/network/lb/ElasticLoadBalancerManagerImpl.java
@@ -856,6 +856,12 @@ public class ElasticLoadBalancerManagerImpl implements
                     // always add management explicit route, for basic networking setup
                     buf.append(" mgmtcidr=").append(_mgmtCidr);
                     buf.append(" localgw=").append(dest.getPod().getGateway());
+
+                    if (dc.getNetworkType() == NetworkType.Basic) {
+                        // ask elb vm to setup SSH on guest network
+                        buf.append(" sshonguest=true");
+                    }
+
                 }
 
                 controlNic = nic;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/e69561b8/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 ad99885..216622e 100755
--- a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
+++ b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
@@ -1210,12 +1210,8 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian
             s_logger.error("Didn't support redundant virtual router without public network!");
             return null;
         }
-        //Check if control network has to be set on VR
-        boolean controlNetwork = true;
-        if ( dest.getDataCenter().getNetworkType() == NetworkType.Basic ) {
-            // in basic mode, use private network as control network
-            controlNetwork = false;
-        }
+
+        
         
         //1) Get deployment plan and find out the list of routers
         boolean isPodBased = (dest.getDataCenter().getNetworkType() == NetworkType.Basic
|| 
@@ -1589,6 +1585,13 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian
                         buf.append(" mgmtcidr=").append(_mgmt_cidr);
                         buf.append(" localgw=").append(dest.getPod().getGateway());
                     }
+                    
+
+                    if (dc.getNetworkType() == NetworkType.Basic) {
+                        // ask domR to setup SSH on guest network
+                        buf.append(" sshonguest=true");
+                    }
+
                 }
             } else {
                 //Remove public and guest nics from the profile
@@ -1704,7 +1707,8 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian
 
         NicProfile controlNic = null;
 
-        if( dcVo.getNetworkType() == NetworkType.Basic) {
+        if(profile.getHypervisorType() == HypervisorType.VMware && dcVo.getNetworkType()
== NetworkType.Basic) {
+            // TODO this is a ugly to test hypervisor type here
             // for basic network mode, we will use the guest NIC for control NIC
             for (NicProfile nic : profile.getNics()) {
                 if (nic.getTrafficType() == TrafficType.Guest && nic.getIp4Address()
!= null) {

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/e69561b8/wscript
----------------------------------------------------------------------
diff --git a/wscript b/wscript
index f8b7aea..9507336 100644
--- a/wscript
+++ b/wscript
@@ -5,7 +5,7 @@
 # if you change 'em here, you need to change it also in cloud.spec, add a %changelog entry
there, and add an entry in debian/changelog
 
 
-VERSION = '3.0.3.2012-06-12T20:28:54Z'
+VERSION = '3.0.3.2012-06-12T21:55:09Z'
 APPNAME = 'cloud'
 
 import shutil,os


Mime
View raw message