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
This commit is contained in:
Sateesh Chodapuneedi 2012-05-21 17:39:27 +05:30 committed by Vijayendra Bhamidipati
parent b28568a221
commit e952f0d5f3
5 changed files with 38 additions and 35 deletions

View File

@ -4029,7 +4029,12 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
CustomFieldsManagerMO cfmMo = new CustomFieldsManagerMO(context, context.getServiceContent().getCustomFieldsManager());
cfmMo.ensureCustomFieldDef("Datastore", CustomFieldConstants.CLOUD_UUID);
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);

View File

@ -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";
}

View File

@ -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");
}
}

View File

@ -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);

View File

@ -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;