From a728f5b0711a44f70f89204346f72df040d5c740 Mon Sep 17 00:00:00 2001 From: Kelven Yang Date: Thu, 23 Jun 2011 17:21:46 -0700 Subject: [PATCH] bug 10434: limit vCenter cluster size to be within VMFS limit --- server/src/com/cloud/configuration/Config.java | 1 + .../com/cloud/resource/ResourceManagerImpl.java | 15 ++++----------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/server/src/com/cloud/configuration/Config.java b/server/src/com/cloud/configuration/Config.java index bc8c29a36e5..1770721a2d3 100755 --- a/server/src/com/cloud/configuration/Config.java +++ b/server/src/com/cloud/configuration/Config.java @@ -198,6 +198,7 @@ public enum Config { VmwareAdditionalVncPortRangeStart("Advanced", ManagementServer.class, Integer.class, "vmware.additional.vnc.portrange.start", "59000", "Start port number of additional VNC port range", null), VmwareAdditionalVncPortRangeSize("Advanced", ManagementServer.class, Integer.class, "vmware.additional.vnc.portrange.size", "1000", "Start port number of additional VNC port range", null), VmwareGuestNicDeviceType("Advanced", ManagementServer.class, String.class, "vmware.guest.nic.device.type", "E1000", "Ethernet card type used in guest VM, valid values are E1000, PCNet32, Vmxnet2, Vmxnet3", null), + VmwarePerClusterHostMax("Advanced", ManagementServer.class, Integer.class, "vmware.percluster.host.max", "8", "maxmium hosts per vCenter cluster(do not let it grow over 8)", "1-8"), // KVM KvmPublicNetwork("Advanced", ManagementServer.class, String.class, "kvm.public.network.device", null, "Specify the public bridge on host for public network", null), diff --git a/server/src/com/cloud/resource/ResourceManagerImpl.java b/server/src/com/cloud/resource/ResourceManagerImpl.java index 8170df4d3c4..61c87158d56 100644 --- a/server/src/com/cloud/resource/ResourceManagerImpl.java +++ b/server/src/com/cloud/resource/ResourceManagerImpl.java @@ -253,12 +253,8 @@ public class ResourceManagerImpl implements ResourceManager, ResourceService, Ma List hosts = new ArrayList(); Map> resources = null; - - try { - resources = discoverer.find(dcId, podId, clusterId, uri, username, password); - } catch (Exception e) { - s_logger.info("Exception in external cluster discovery process with discoverer: " + discoverer.getName()); - } + resources = discoverer.find(dcId, podId, clusterId, uri, username, password); + if (resources != null) { for (Map.Entry> entry : resources.entrySet()) { ServerResource resource = entry.getKey(); @@ -281,9 +277,6 @@ public class ResourceManagerImpl implements ResourceManager, ResourceService, Ma s_logger.warn("Unable to find the server resources at " + url); throw new DiscoveryException("Unable to add the external cluster"); - } catch (Throwable e) { - s_logger.error("Unexpected exception ", e); - throw new DiscoveryException("Unable to add the external cluster due to unhandled exception"); } finally { if (!success) { _clusterDetailsDao.deleteDetails(clusterId); @@ -487,8 +480,8 @@ public class ResourceManagerImpl implements ResourceManager, ResourceService, Ma try { resources = discoverer.find(dcId, podId, clusterId, uri, username, password); - } catch (DiscoveredWithErrorException e) { - throw e; + } catch(DiscoveryException e) { + throw e; } catch (Exception e) { s_logger.info("Exception in host discovery process with discoverer: " + discoverer.getName() + ", skip to another discoverer if there is any"); }