You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ke...@apache.org on 2012/05/28 00:30:43 UTC

[10/50] git commit: CS-9919: Support for Nexus Swiches (Cisco Vswitches) Description:

CS-9919: Support for Nexus Swiches (Cisco Vswitches)
Description:

	Removed the vcenter_dc_name and vcenter_ipaddr
	fields from the virtual_supervisor_module
	table, the CiscoNexusVSMDeviceVO, addClusterCmd,
	and all other references to these two fields.

	Fixing null pointer exceptions when checking
	for nexus related global parameter values in
	addClusterCmd.

Conflicts:

	api/src/com/cloud/api/commands/AddClusterCmd.java


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

Branch: refs/heads/master
Commit: 15d0cf782ad72e7cd7be68c3d40f3d500900f1a9
Parents: 1593900
Author: Vijayendra Bhamidipati <vi...@citrix.com>
Authored: Wed May 23 16:44:50 2012 -0700
Committer: Vijayendra Bhamidipati <vi...@citrix.com>
Committed: Fri May 25 18:37:20 2012 -0700

----------------------------------------------------------------------
 api/src/com/cloud/api/ApiConstants.java            |    2 -
 api/src/com/cloud/api/commands/AddClusterCmd.java  |   21 --------
 .../cloud/api/response/CiscoNexusVSMResponse.java  |   14 -----
 api/src/com/cloud/network/CiscoNexusVSMDevice.java |    4 --
 .../hypervisor/vmware/VmwareServerDiscoverer.java  |    6 +-
 .../network/CiscoNexusVSMDeviceManagerImpl.java    |    2 +-
 .../com/cloud/network/CiscoNexusVSMDeviceVO.java   |   39 +--------------
 .../network/element/CiscoNexusVSMElement.java      |    2 -
 .../com/cloud/resource/ResourceManagerImpl.java    |    4 +-
 setup/db/create-schema.sql                         |    2 -
 setup/db/db/schema-302to303.sql                    |    2 -
 11 files changed, 7 insertions(+), 91 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/15d0cf78/api/src/com/cloud/api/ApiConstants.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/ApiConstants.java b/api/src/com/cloud/api/ApiConstants.java
index 6ef4b32..a839f66 100755
--- a/api/src/com/cloud/api/ApiConstants.java
+++ b/api/src/com/cloud/api/ApiConstants.java
@@ -340,8 +340,6 @@ public class ApiConstants {
     public static final String EXTERNAL_SWITCH_MGMT_DEVICE_STATE = "vsmdevicestate";
     // Would we need to have a capacity field for Cisco N1KV VSM? Max hosts managed by it perhaps? May remove this later.
     public static final String EXTERNAL_SWITCH_MGMT_DEVICE_CAPACITY = "vsmdevicecapacity";
-    public static final String VCENTER_IP_ADDRESS = "vcenteripaddr";
-    public static final String VCENTER_DC_NAME = "vcenterdcname";
     public static final String CISCO_NEXUS_VSM_NAME = "vsmname";
     public static final String VSM_USERNAME = "vsmusername";
     public static final String VSM_PASSWORD = "vsmpassword";

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/15d0cf78/api/src/com/cloud/api/commands/AddClusterCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/AddClusterCmd.java b/api/src/com/cloud/api/commands/AddClusterCmd.java
index cb2df87..b462361 100755
--- a/api/src/com/cloud/api/commands/AddClusterCmd.java
+++ b/api/src/com/cloud/api/commands/AddClusterCmd.java
@@ -75,27 +75,6 @@ public class AddClusterCmd extends BaseCmd {
     @Parameter(name = ApiConstants.VSM_IPADDRESS, type = CommandType.STRING, required = false, description = "the ipaddress of the VSM associated with this cluster")
     private String vsmipaddress;
     
-    @Parameter(name = ApiConstants.VCENTER_IP_ADDRESS, type = CommandType.STRING, required = false, description = "the ipaddress of the vCenter the VSM associated with this cluster will connect to")
-    private String vcenteripaddr;
-    
-    @Parameter(name = ApiConstants.VCENTER_DC_NAME, type = CommandType.STRING, required = false, description = "the name of the vCenter Data Center the VSM associated with this cluster will serve")
-    private String vcenterdcname;
-    
-    @Parameter(name = ApiConstants.ADD_VSM_FLAG, type = CommandType.STRING, required = false, description = "flag that indicates a Cisco Nexus 1000v VSM is being associated with this cluster")
-    private String addVSMFlag;
-    
-    public String getAddVSMFlag() {
-    	return addVSMFlag;
-    }
-    
-    public String getvCenterDCName() {
-    	return vcenterdcname;
-    }
-
-    public String getvCenterIPAddr() {
-    	return vcenteripaddr;
-    }
-    
     public String getVSMIpaddress() {
         return vsmipaddress;
     }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/15d0cf78/api/src/com/cloud/api/response/CiscoNexusVSMResponse.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/response/CiscoNexusVSMResponse.java b/api/src/com/cloud/api/response/CiscoNexusVSMResponse.java
index 3bef2ed..1bc880e 100644
--- a/api/src/com/cloud/api/response/CiscoNexusVSMResponse.java
+++ b/api/src/com/cloud/api/response/CiscoNexusVSMResponse.java
@@ -32,12 +32,6 @@ public class CiscoNexusVSMResponse extends BaseResponse {
     
     @SerializedName(ApiConstants.EXTERNAL_SWITCH_MGMT_DEVICE_STATE) @Param(description="device state")
     private String deviceState;
-
-    @SerializedName(ApiConstants.VCENTER_IP_ADDRESS) @Param(description="ipaddress of vCenter the VSM connects to")
-    private String vcenteripaddress;
-    
-    @SerializedName(ApiConstants.VCENTER_DC_NAME) @Param(description="name of the vCenter Data Center the VSM is associated with")
-    private String vcenterdcname;
     
     @SerializedName(ApiConstants.VSM_MGMT_VLAN_ID) @Param(description="management vlan id of the VSM")
     private String vsmmgmtvlanid;
@@ -80,14 +74,6 @@ public class CiscoNexusVSMResponse extends BaseResponse {
     	this.deviceState = deviceState;
     }
     
-    public void setvCenterIpAddress(String ipaddress) {
-    	this.vcenteripaddress = ipaddress;
-    }
-    
-    public void setvCenterDcName(String dcName) {
-    	this.vcenterdcname = dcName;
-    }
-    
     public void setVSMMgmtVlanId(String vlanId) {
     	this.vsmmgmtvlanid = vlanId;
     }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/15d0cf78/api/src/com/cloud/network/CiscoNexusVSMDevice.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/network/CiscoNexusVSMDevice.java b/api/src/com/cloud/network/CiscoNexusVSMDevice.java
index 66315da..7b9ba9f 100644
--- a/api/src/com/cloud/network/CiscoNexusVSMDevice.java
+++ b/api/src/com/cloud/network/CiscoNexusVSMDevice.java
@@ -46,10 +46,6 @@ public interface CiscoNexusVSMDevice {
 
     public String getipaddr();
     
-    public String getvCenterIPAddr();
-    
-    public String getvCenterDCName();
-    
     public int getManagementVlan();
     
     public int getControlVlan();

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/15d0cf78/server/src/com/cloud/hypervisor/vmware/VmwareServerDiscoverer.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/hypervisor/vmware/VmwareServerDiscoverer.java b/server/src/com/cloud/hypervisor/vmware/VmwareServerDiscoverer.java
index 5ce2532..f100906 100755
--- a/server/src/com/cloud/hypervisor/vmware/VmwareServerDiscoverer.java
+++ b/server/src/com/cloud/hypervisor/vmware/VmwareServerDiscoverer.java
@@ -117,7 +117,7 @@ public class VmwareServerDiscoverer extends DiscovererBase implements Discoverer
         String guestTrafficLabel = null;
         Map<String, String> vsmCredentials = null;
         if (_vmwareMgr.getNexusVSwitchGlobalParameter()) {
-            if (_vmwareMgr.getPrivateVSwitchTypeGlobalParameter().equalsIgnoreCase("nexus")) {
+            if (_vmwareMgr.getPrivateVSwitchTypeGlobalParameter() != null && _vmwareMgr.getPrivateVSwitchTypeGlobalParameter().equalsIgnoreCase("nexus")) {
                 // Get physical network label
                 privateTrafficLabel = _netmgr.getDefaultManagementTrafficLabel(dcId, HypervisorType.VMware);
                 if (privateTrafficLabel != null) {
@@ -128,7 +128,7 @@ public class VmwareServerDiscoverer extends DiscovererBase implements Discoverer
             DataCenterVO zone = _dcDao.findById(dcId);
             NetworkType zoneType = zone.getNetworkType();
 
-            if (zoneType != NetworkType.Basic && _vmwareMgr.getPublicVSwitchTypeGlobalParameter().equalsIgnoreCase("nexus")) {
+            if (zoneType != NetworkType.Basic && _vmwareMgr.getPublicVSwitchTypeGlobalParameter() != null && _vmwareMgr.getPublicVSwitchTypeGlobalParameter().equalsIgnoreCase("nexus")) {
                 // Get physical network label
                 publicTrafficLabel = _netmgr.getDefaultPublicTrafficLabel(dcId, HypervisorType.VMware);
                 if (publicTrafficLabel != null) {
@@ -139,7 +139,7 @@ public class VmwareServerDiscoverer extends DiscovererBase implements Discoverer
                 s_logger.info("Skipping detection of public traffic label as zone type is Basic.");
             }
 
-            if (_vmwareMgr.getGuestVSwitchTypeGlobalParameter().equalsIgnoreCase("nexus")) {
+            if (_vmwareMgr.getGuestVSwitchTypeGlobalParameter() != null && _vmwareMgr.getGuestVSwitchTypeGlobalParameter().equalsIgnoreCase("nexus")) {
                 // Get physical network label
                 guestTrafficLabel = _netmgr.getDefaultGuestTrafficLabel(dcId, HypervisorType.VMware);
                 if (guestTrafficLabel != null) {

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/15d0cf78/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 2d7ef76..fec8a4a 100644
--- a/server/src/com/cloud/network/CiscoNexusVSMDeviceManagerImpl.java
+++ b/server/src/com/cloud/network/CiscoNexusVSMDeviceManagerImpl.java
@@ -131,7 +131,7 @@ public abstract class CiscoNexusVSMDeviceManagerImpl extends AdapterBase {
 
     	if (VSMObj == null) {    		
     		// Create the VSM record. For now, we aren't using the vsmName field.
-    		VSMObj = new CiscoNexusVSMDeviceVO(ipaddress, username, password, vCenterIpaddr, vCenterDcName);
+    		VSMObj = new CiscoNexusVSMDeviceVO(ipaddress, username, password);
     		Transaction txn = Transaction.currentTxn();
     		try {
    				txn.start();

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/15d0cf78/server/src/com/cloud/network/CiscoNexusVSMDeviceVO.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/CiscoNexusVSMDeviceVO.java b/server/src/com/cloud/network/CiscoNexusVSMDeviceVO.java
index b1f1954..6165ec1 100644
--- a/server/src/com/cloud/network/CiscoNexusVSMDeviceVO.java
+++ b/server/src/com/cloud/network/CiscoNexusVSMDeviceVO.java
@@ -64,13 +64,6 @@ public class CiscoNexusVSMDeviceVO implements CiscoNexusVSMDevice, Identity{
     @Column(name = "ipaddr")
     private String ipaddr;
     
-    @Column(name = "vcenter_ipaddr")
-    private String vCenterIPAddr;
-    
-    // Name of the DataCenter (as seen in vCenter) that this VSM manages.
-    @Column(name = "vcenter_dc_name")
-    private String vCenterDCName;
-    
     @Column(name = "management_vlan")
     private int managementVlan;
 
@@ -120,14 +113,6 @@ public class CiscoNexusVSMDeviceVO implements CiscoNexusVSMDevice, Identity{
     	return ipaddr;
     }
     
-    public String getvCenterIPAddr() {
-    	return vCenterIPAddr;
-    }
-    
-    public String getvCenterDCName() {
-    	return vCenterDCName;
-    }
-    
     public int getManagementVlan() {
     	return managementVlan;
     }
@@ -186,14 +171,6 @@ public class CiscoNexusVSMDeviceVO implements CiscoNexusVSMDevice, Identity{
     	this.ipaddr = ipaddr;
     }
     
-    public void setvCenterIPAddr(String ipaddr) {
-    	this.vCenterIPAddr = ipaddr;
-    }
-    
-    public void setvCenterDCName(String dcname) {
-    	this.vCenterDCName = dcname;
-    }
-    
     public void setManagementVlan(int vlan) {
     	this.managementVlan = vlan;
     }
@@ -227,21 +204,9 @@ public class CiscoNexusVSMDeviceVO implements CiscoNexusVSMDevice, Identity{
     }
  
         
-    // Constructor methods.
-    
-    public CiscoNexusVSMDeviceVO(String vsmIpAddr, String username, String password, String vCenterIpaddr, String vCenterDcName) {    	
-    	// Set all the VSM's properties here.
-        this.uuid = UUID.randomUUID().toString();
-        this.setMgmtIpAddr(vsmIpAddr);
-        this.setVsmUserName(username);
-        this.setVsmPassword(password);
-        this.setvCenterIPAddr(vCenterIpaddr);
-        this.setvCenterDCName(vCenterDcName);
-        // By default, enable a VSM.
-        this.setVsmDeviceState(VSMDeviceState.Enabled);
-    }
+    // Constructors.
     
-    public CiscoNexusVSMDeviceVO(String vsmIpAddr, String username, String password, long dummy) {    	
+    public CiscoNexusVSMDeviceVO(String vsmIpAddr, String username, String password) {    	
     	// Set all the VSM's properties here.
         this.uuid = UUID.randomUUID().toString();
         this.setMgmtIpAddr(vsmIpAddr);

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/15d0cf78/server/src/com/cloud/network/element/CiscoNexusVSMElement.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/element/CiscoNexusVSMElement.java b/server/src/com/cloud/network/element/CiscoNexusVSMElement.java
index 844d125..1156a26 100644
--- a/server/src/com/cloud/network/element/CiscoNexusVSMElement.java
+++ b/server/src/com/cloud/network/element/CiscoNexusVSMElement.java
@@ -216,8 +216,6 @@ public class CiscoNexusVSMElement extends CiscoNexusVSMDeviceManagerImpl impleme
     	response.setDeviceName(vsmDeviceVO.getvsmName());
     	response.setDeviceState(vsmDeviceVO.getvsmDeviceState().toString());    	
     	response.setMgmtIpAddress(vsmDeviceVO.getipaddr());
-    	response.setvCenterDcName(vsmDeviceVO.getvCenterDCName());    	
-    	response.setvCenterIpAddress(vsmDeviceVO.getvCenterIPAddr());
     	// The following values can be null, so check for that.
     	if(vsmDeviceVO.getvsmConfigMode() != null)
     		response.setVSMConfigMode(vsmDeviceVO.getvsmConfigMode().toString());

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/15d0cf78/server/src/com/cloud/resource/ResourceManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/resource/ResourceManagerImpl.java b/server/src/com/cloud/resource/ResourceManagerImpl.java
index 6daffab..82b30d6 100755
--- a/server/src/com/cloud/resource/ResourceManagerImpl.java
+++ b/server/src/com/cloud/resource/ResourceManagerImpl.java
@@ -436,8 +436,6 @@ public class ResourceManagerImpl implements ResourceManager, ResourceService, Ma
         	String vsmIp = cmd.getVSMIpaddress();
             String vsmUser = cmd.getVSMUsername();
             String vsmPassword = cmd.getVSMPassword();
-            String vCenterIpaddr = cmd.getvCenterIPAddr();
-            String vCenterDcName = cmd.getvCenterDCName();
 
         	if(vsmIp != null && vsmUser != null && vsmPassword != null) {
 	            NetconfHelper netconfClient;
@@ -451,7 +449,7 @@ public class ResourceManagerImpl implements ResourceManager, ResourceService, Ma
 	                throw new CloudRuntimeException(msg);
 	            }
 	            // persist credentials to database
-	            CiscoNexusVSMDeviceVO vsm = new CiscoNexusVSMDeviceVO(vsmIp, vsmUser, vsmPassword, vCenterIpaddr, vCenterDcName);
+	            CiscoNexusVSMDeviceVO vsm = new CiscoNexusVSMDeviceVO(vsmIp, vsmUser, vsmPassword);
 	            
 	            Transaction txn = Transaction.currentTxn();
 	            try {

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/15d0cf78/setup/db/create-schema.sql
----------------------------------------------------------------------
diff --git a/setup/db/create-schema.sql b/setup/db/create-schema.sql
index be17895..488fb06 100755
--- a/setup/db/create-schema.sql
+++ b/setup/db/create-schema.sql
@@ -2097,8 +2097,6 @@ CREATE TABLE `cloud`.`virtual_supervisor_module` (
   `username` varchar(255) NOT NULL,
   `password` varchar(255) NOT NULL,
   `ipaddr` varchar(80) NOT NULL,
-  `vcenter_ipaddr` varchar(80),
-  `vcenter_dc_name` varchar(255),
   `management_vlan` int(32),
   `control_vlan` int(32),
   `packet_vlan` int(32),

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/15d0cf78/setup/db/db/schema-302to303.sql
----------------------------------------------------------------------
diff --git a/setup/db/db/schema-302to303.sql b/setup/db/db/schema-302to303.sql
index 7293d7e..4aeb85f 100755
--- a/setup/db/db/schema-302to303.sql
+++ b/setup/db/db/schema-302to303.sql
@@ -148,8 +148,6 @@ CREATE TABLE `cloud`.`virtual_supervisor_module` (
   `username` varchar(255) NOT NULL,
   `password` varchar(255) NOT NULL,
   `ipaddr` varchar(80) NOT NULL,
-  `vcenter_ipaddr` varchar(80),
-  `vcenter_dc_name` varchar(255),
   `management_vlan` int(32),
   `control_vlan` int(32),
   `packet_vlan` int(32),