Return-Path: X-Original-To: apmail-incubator-cloudstack-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-cloudstack-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4E823CE82 for ; Sun, 27 May 2012 22:30:47 +0000 (UTC) Received: (qmail 88283 invoked by uid 500); 27 May 2012 22:30:45 -0000 Delivered-To: apmail-incubator-cloudstack-commits-archive@incubator.apache.org Received: (qmail 88012 invoked by uid 500); 27 May 2012 22:30:44 -0000 Mailing-List: contact cloudstack-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cloudstack-dev@incubator.apache.org Delivered-To: mailing list cloudstack-commits@incubator.apache.org Received: (qmail 87517 invoked by uid 99); 27 May 2012 22:30:44 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 27 May 2012 22:30:44 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 9794A18400; Sun, 27 May 2012 22:30:43 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: ke4qqq@apache.org To: cloudstack-commits@incubator.apache.org X-Mailer: ASF-Git Admin Mailer Subject: [5/50] git commit: CS-9919: Support for Nexus Swiches (Cisco Vswitches) Message-Id: <20120527223043.9794A18400@tyr.zones.apache.org> Date: Sun, 27 May 2012 22:30:43 +0000 (UTC) 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 Authored: Fri May 25 09:43:00 2012 -0700 Committer: Vijayendra Bhamidipati 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 hosts = _resourceMgr.listAllHostsInCluster(clusterId); + //List 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(); - 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(); + //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; }