cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ke4...@apache.org
Subject [23/50] git commit: CS-15010 Nexus vSwitch: Advanced Zone - System VMs failed to deploy due to Start Command Failure CS-15016 SSH connections to VSM are not cleared [Once the connections are exceeded it failed to connect to VSM]
Date Sun, 27 May 2012 22:30:43 GMT
CS-15010 Nexus vSwitch: Advanced Zone - System VMs failed to deploy due to Start Command Failure
CS-15016 SSH connections to VSM are not cleared [Once the connections are exceeded it failed
to connect to VSM]

Conflicts:

	core/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
	vmware-base/src/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.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/e952f0d5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/e952f0d5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/e952f0d5

Branch: refs/heads/master
Commit: e952f0d5f3007d8da2d225ecf8ead72138dba9e0
Parents: b28568a
Author: Sateesh Chodapuneedi <sateesh.chodapuneedi@citrix.com>
Authored: Mon May 21 17:39:27 2012 +0530
Committer: Vijayendra Bhamidipati <vijayendra.bhamidipati@citrix.com>
Committed: Fri May 25 18:17:59 2012 -0700

----------------------------------------------------------------------
 .../hypervisor/vmware/resource/VmwareResource.java |   19 ++++++----
 .../hypervisor/vmware/mo/CustomFieldConstants.java |    1 +
 .../cloud/hypervisor/vmware/mo/DatacenterMO.java   |   27 +--------------
 .../hypervisor/vmware/mo/HypervisorHostHelper.java |   20 ++++++++++-
 .../hypervisor/vmware/mo/VirtualMachineMO.java     |    6 +++
 5 files changed, 38 insertions(+), 35 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/e952f0d5/core/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java b/core/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
index e47aee3..e4953c2 100755
--- a/core/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
+++ b/core/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
@@ -4022,14 +4022,19 @@ public class VmwareResource implements StoragePoolResource, ServerResource,
Vmwa
         _morHyperHost.setType(hostTokens[0]);
         _morHyperHost.set_value(hostTokens[1]);
         
-        VmwareContext context = getServiceContext();
-        try {
-            VmwareManager mgr = context.getStockObject(VmwareManager.CONTEXT_STOCK_NAME);
-            mgr.setupResourceStartupParams(params);
-
-            CustomFieldsManagerMO cfmMo = new CustomFieldsManagerMO(context, context.getServiceContent().getCustomFieldsManager());
+        VmwareContext context = getServiceContext();
+        try {
+            VmwareManager mgr = context.getStockObject(VmwareManager.CONTEXT_STOCK_NAME);
+            mgr.setupResourceStartupParams(params);
+
+            CustomFieldsManagerMO cfmMo = new CustomFieldsManagerMO(context, context.getServiceContent().getCustomFieldsManager());
             cfmMo.ensureCustomFieldDef("Datastore", CustomFieldConstants.CLOUD_UUID);
-            cfmMo.ensureCustomFieldDef("Network", CustomFieldConstants.CLOUD_GC);
+            if (mgr.getNexusVSwitchGlobalParameter()) {
+            	cfmMo.ensureCustomFieldDef("DistributedVirtualPortgroup", CustomFieldConstants.CLOUD_GC_DVP);
+            } else {
+            	cfmMo.ensureCustomFieldDef("Network", CustomFieldConstants.CLOUD_GC);
+            }
+
             cfmMo.ensureCustomFieldDef("VirtualMachine", CustomFieldConstants.CLOUD_UUID);
             cfmMo.ensureCustomFieldDef("VirtualMachine", CustomFieldConstants.CLOUD_NIC_MASK);
 

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/e952f0d5/vmware-base/src/com/cloud/hypervisor/vmware/mo/CustomFieldConstants.java
----------------------------------------------------------------------
diff --git a/vmware-base/src/com/cloud/hypervisor/vmware/mo/CustomFieldConstants.java b/vmware-base/src/com/cloud/hypervisor/vmware/mo/CustomFieldConstants.java
index 016b04c..84f72fd 100644
--- a/vmware-base/src/com/cloud/hypervisor/vmware/mo/CustomFieldConstants.java
+++ b/vmware-base/src/com/cloud/hypervisor/vmware/mo/CustomFieldConstants.java
@@ -15,5 +15,6 @@ package com.cloud.hypervisor.vmware.mo;
 public interface CustomFieldConstants {
 	public final static String CLOUD_UUID = "cloud.uuid";
 	public final static String CLOUD_GC = "cloud.gc";
+	public final static String CLOUD_GC_DVP = "cloud.gc.dvp";	
 	public final static String CLOUD_NIC_MASK = "cloud.nic.mask";
 }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/e952f0d5/vmware-base/src/com/cloud/hypervisor/vmware/mo/DatacenterMO.java
----------------------------------------------------------------------
diff --git a/vmware-base/src/com/cloud/hypervisor/vmware/mo/DatacenterMO.java b/vmware-base/src/com/cloud/hypervisor/vmware/mo/DatacenterMO.java
index 428c88a..f9127e3 100755
--- a/vmware-base/src/com/cloud/hypervisor/vmware/mo/DatacenterMO.java
+++ b/vmware-base/src/com/cloud/hypervisor/vmware/mo/DatacenterMO.java
@@ -444,31 +444,6 @@ public class DatacenterMO extends BaseMO {
 
     public String getDvSwitchUuid(ManagedObjectReference dvSwitchMor) throws Exception {
         assert (dvSwitchMor != null);
-        PropertySpec pSpec = new PropertySpec();
-        pSpec.setType("DistributedVirtualSwitch");
-        pSpec.setPathSet(new String[] { "uuid" });
-
-        ObjectSpec oSpec = new ObjectSpec();
-        oSpec.setObj(dvSwitchMor);
-        oSpec.setSkip(Boolean.FALSE);
-        oSpec.setSelectSet(new SelectionSpec[] {});
-
-        PropertyFilterSpec pfSpec = new PropertyFilterSpec();
-        pfSpec.setPropSet(new PropertySpec[] { pSpec });
-        pfSpec.setObjectSet(new ObjectSpec[] { oSpec });
-
-        ObjectContent[] ocs = _context.getService().retrieveProperties(
-                _context.getServiceContent().getPropertyCollector(),
-                new PropertyFilterSpec[] { pfSpec });
-
-        if (ocs != null) {
-            for (ObjectContent oc : ocs) {
-                DynamicProperty[] props = oc.getPropSet();
-                if (props != null) {
-                    return (String) props[0].getVal();
-                }
-            }
-        }
-        return null;
+        return (String) _context.getServiceUtil().getDynamicProperty(dvSwitchMor, "uuid");
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/e952f0d5/vmware-base/src/com/cloud/hypervisor/vmware/mo/HypervisorHostHelper.java
----------------------------------------------------------------------
diff --git a/vmware-base/src/com/cloud/hypervisor/vmware/mo/HypervisorHostHelper.java b/vmware-base/src/com/cloud/hypervisor/vmware/mo/HypervisorHostHelper.java
index 52addaf..4ee6136 100755
--- a/vmware-base/src/com/cloud/hypervisor/vmware/mo/HypervisorHostHelper.java
+++ b/vmware-base/src/com/cloud/hypervisor/vmware/mo/HypervisorHostHelper.java
@@ -176,6 +176,10 @@ public class HypervisorHostHelper {
             } catch (CloudRuntimeException e) {
                 msg = "Failed to modify ethernet port profile " + ethPortProfileName + "
with parameters " + params.toString();
                 s_logger.error(msg);
+                if(netconfClient != null) {
+                	netconfClient.disconnect();
+                	s_logger.debug("Disconnected VSM session.");
+                }
                 throw new CloudRuntimeException(msg);
             }
         }
@@ -188,6 +192,7 @@ public class HypervisorHostHelper {
                 s_logger.info("Adding port profile configured over VLAN : " + vlanId.toString());
                 netconfClient.addPortProfile(networkName, PortProfileType.vethernet, BindingType.portbindingstatic,
SwitchPortMode.access, vlanId.intValue());
             }
+            
         } catch (CloudRuntimeException e) {
             msg = "Failed to add vEthernet port profile " + networkName + ". Exception: "
+ e.toString();
 			s_logger.error(msg);
@@ -195,6 +200,11 @@ public class HypervisorHostHelper {
                 s_logger.warn("Ignoring exception : " + e.toString());
                 // throw new CloudRuntimeException(msg);
 			}
+		} finally {
+			if(netconfClient != null) {
+            	netconfClient.disconnect();
+            	s_logger.debug("Disconnected VSM session.");
+			}
 		}
 	}
 	
@@ -224,11 +234,16 @@ public class HypervisorHostHelper {
         params.add(new Pair<OperationType, String>(OperationType.addvlanid, vlanId.toString()));
 		
 		try {
-			netconfClient.updatePortProfile(ethPortProfileName, SwitchPortMode.access, params); 
+			netconfClient.updatePortProfile(ethPortProfileName, SwitchPortMode.trunk, params); 
 		} catch(CloudRuntimeException e) {
 			msg = "Failed to modify ethernet port profile " + ethPortProfileName + " with parameters
" + params.toString();
 			s_logger.error(msg);
 			throw new CloudRuntimeException(msg);
+		} finally {
+			if(netconfClient != null) {
+            	netconfClient.disconnect();
+            	s_logger.debug("Disconnected VSM session.");
+			}
 		}
 	}
 	
@@ -339,7 +354,8 @@ public class HypervisorHostHelper {
         
         if(createGCTag) {
             NetworkMO networkMo = new NetworkMO(hostMo.getContext(), morNetwork);
-            networkMo.setCustomFieldValue(CustomFieldConstants.CLOUD_GC, "true");
+            networkMo.setCustomFieldValue(CustomFieldConstants.CLOUD_GC_DVP, "true");
+            s_logger.debug("Added custom field : " + CustomFieldConstants.CLOUD_GC_DVP);
         }
 				
 		return new Pair<ManagedObjectReference, String>(morNetwork, networkName);

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/e952f0d5/vmware-base/src/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java
----------------------------------------------------------------------
diff --git a/vmware-base/src/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java b/vmware-base/src/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java
index 71907b0..dade93d 100644
--- a/vmware-base/src/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java
+++ b/vmware-base/src/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java
@@ -650,6 +650,11 @@ public class VirtualMachineMO extends BaseMO {
 
 		int gcTagKey = getCustomFieldKey("Network", CustomFieldConstants.CLOUD_GC);
 		
+		if(gcTagKey == 0) {
+			gcTagKey = getCustomFieldKey("DistributedVirtualPortgroup", CustomFieldConstants.CLOUD_GC_DVP);
+			s_logger.debug("The custom key for dvPortGroup is : " + gcTagKey);
+		}
+			
 		PropertySpec pSpec = new PropertySpec();
 		pSpec.setType("Network");
 		pSpec.setPathSet(new String[] {"name", "vm", String.format("value[%d]", gcTagKey)});
@@ -696,6 +701,7 @@ public class VirtualMachineMO extends BaseMO {
 	    		
 	    		networks.add(details);
 	    	}
+	    	s_logger.debug("Retrieved " + networks.size() + " networks with key : " + gcTagKey);
 	    }
 		
 		return networks;


Mime
View raw message