cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ke4...@apache.org
Subject [5/50] git commit: CS-9919: Support for Nexus Swiches (Cisco Vswitches)
Date Sun, 27 May 2012 22:30:43 GMT
CS-9919: Support for Nexus Swiches (Cisco Vswitches)

Description:

	Incorporating Salvatore's review comments.


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

Branch: refs/heads/master
Commit: 7cf04c1fe4628ce8738d1eccf730f08abf876972
Parents: 8eff665
Author: Vijayendra Bhamidipati <vijayendra.bhamidipati@citrix.com>
Authored: Fri May 25 09:43:00 2012 -0700
Committer: Vijayendra Bhamidipati <vijayendra.bhamidipati@citrix.com>
Committed: Fri May 25 19:02:00 2012 -0700

----------------------------------------------------------------------
 .../network/CiscoNexusVSMDeviceManagerImpl.java    |   63 ++++++---------
 1 files changed, 26 insertions(+), 37 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7cf04c1f/server/src/com/cloud/network/CiscoNexusVSMDeviceManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/CiscoNexusVSMDeviceManagerImpl.java b/server/src/com/cloud/network/CiscoNexusVSMDeviceManagerImpl.java
index 6746880..e00564f 100644
--- a/server/src/com/cloud/network/CiscoNexusVSMDeviceManagerImpl.java
+++ b/server/src/com/cloud/network/CiscoNexusVSMDeviceManagerImpl.java
@@ -144,7 +144,8 @@ public abstract class CiscoNexusVSMDeviceManagerImpl extends AdapterBase
{
     	}
     	
     	// At this stage, we have a VSM record for sure. Connect the VSM to the cluster Id.
-    	ClusterVSMMapVO connectorObj = new ClusterVSMMapVO(clusterId, _ciscoNexusVSMDeviceDao.getVSMbyIpaddress(ipaddress).getId());
+    	long vsmId = _ciscoNexusVSMDeviceDao.getVSMbyIpaddress(ipaddress).getId();
+    	ClusterVSMMapVO connectorObj = new ClusterVSMMapVO(clusterId, vsmId);
     	Transaction txn = Transaction.currentTxn();
     	try {
     		txn.start();
@@ -160,36 +161,37 @@ public abstract class CiscoNexusVSMDeviceManagerImpl extends AdapterBase
{
     	// All ESXi servers are stored in the host table, and their resource
     	// type is vmwareresource.
     	
-        List<HostVO> hosts = _resourceMgr.listAllHostsInCluster(clusterId);
+        //List<HostVO> hosts = _resourceMgr.listAllHostsInCluster(clusterId);
         
+        //TODO: Activate the code below if we make the Nexus VSM a separate resource.
         // Iterate through each of the hosts in this list. Each host has a host id.
         // Given this host id, we can reconfigure the in-memory resource representing
         // the host via the agent manager. Thus we inject VSM related information
         // into each host's resource. Also, we first configure each resource's
         // entries in the database to contain this VSM information before the injection.
     	
-        for (HostVO host : hosts) {        	
+        //for (HostVO host : hosts) {        	
         	// Create a host details VO object and write it out for this hostid.
-        	long vsmId = _ciscoNexusVSMDeviceDao.getVSMbyIpaddress(ipaddress).getId();
-        	Long hostid = new Long(vsmId);
-        	DetailVO vsmDetail = new DetailVO(host.getId(), "vsmId", hostid.toString());
-        	Transaction tx = Transaction.currentTxn();
-        	try {
-        		tx.start();
-        		_hostDetailDao.persist(vsmDetail);
-        		tx.commit();
-        	} catch (Exception e) {
-        		tx.rollback();
-        		throw new CloudRuntimeException(e.getMessage());
-        	}
-        	// Reconfigure the resource.
-        	Map hostDetails = new HashMap<String, String>();
-        	hostDetails.put(ApiConstants.ID, vsmId);
-        	hostDetails.put(ApiConstants.IP_ADDRESS, ipaddress);
-            hostDetails.put(ApiConstants.USERNAME, username);
-            hostDetails.put(ApiConstants.PASSWORD, password);
-            //_agentMrg.send(host.getId(), )
-        }
+        	//Long hostid = new Long(vsmId);
+        	//DetailVO vsmDetail = new DetailVO(host.getId(), "vsmId", hostid.toString());
+        	//Transaction tx = Transaction.currentTxn();
+        	//try {
+        		//tx.start();
+        		//_hostDetailDao.persist(vsmDetail);
+        		//tx.commit();
+        	//} catch (Exception e) {
+        		//tx.rollback();
+        		//throw new CloudRuntimeException(e.getMessage());
+        	//}
+        //}
+        // Reconfigure the resource.
+        //Map hostDetails = new HashMap<String, String>();
+        //hostDetails.put(ApiConstants.ID, vsmId);
+        //hostDetails.put(ApiConstants.IP_ADDRESS, ipaddress);
+        //hostDetails.put(ApiConstants.USERNAME, username);
+        //hostDetails.put(ApiConstants.PASSWORD, password);
+        //_agentMrg.send(host.getId(), )
+        
         return VSMObj;
         
     }
@@ -262,12 +264,6 @@ public abstract class CiscoNexusVSMDeviceManagerImpl extends AdapterBase
{
     		}
     	}
         
-        /*****
-        // Ok, I'm putting in a port profile creation call here. Just for testing.
-        PortProfileManagerImpl obj = new PortProfileManagerImpl();
-        obj.addPortProfile("pp1", 1, 4000, PortType.vEthernet, BindingType.Ephemeral);
-        ***/
-        
         return cisconexusvsm;
     }
     
@@ -291,14 +287,7 @@ public abstract class CiscoNexusVSMDeviceManagerImpl extends AdapterBase
{
     			throw new CloudRuntimeException(e.getMessage());
     		}
     	}
-       
-        /**
-        // Deleting the same port profile..        
-        PortProfileVO obj = _ppDao.findByName("pp1");
-        PortProfileManagerImpl obj2 = new PortProfileManagerImpl();
-        obj2.deletePortProfile(obj.getId());
-        //_ppmgr.addPortProfile("pp1", 1, 4000, PortType.vEthernet, BindingType.Ephemeral);
-        **/
+        
         return cisconexusvsm;
     }
     


Mime
View raw message