Return-Path: X-Original-To: apmail-cloudstack-commits-archive@www.apache.org Delivered-To: apmail-cloudstack-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 272A7F197 for ; Fri, 29 Mar 2013 18:20:27 +0000 (UTC) Received: (qmail 4397 invoked by uid 500); 29 Mar 2013 18:20:19 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 4310 invoked by uid 500); 29 Mar 2013 18:20:19 -0000 Mailing-List: contact commits-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list commits@cloudstack.apache.org Received: (qmail 3426 invoked by uid 99); 29 Mar 2013 18:20:18 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 29 Mar 2013 18:20:18 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id C7CBA8340E0; Fri, 29 Mar 2013 18:20:17 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: prachidamle@apache.org To: commits@cloudstack.apache.org Date: Fri, 29 Mar 2013 18:20:40 -0000 Message-Id: <095581a313a64a4fad67a8ba7b47872a@git.apache.org> In-Reply-To: <249912a2528342cc981002e54fe8ed15@git.apache.org> References: <249912a2528342cc981002e54fe8ed15@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [24/50] [abbrv] git commit: updated refs/heads/affinity_groups to 857ed16 CLOUDSTACK-1381 Fixed inconsistency in cluster limit check for Vmware clusters. While adding a new Vmware cluster limit check done correctly but while adding a host to an existing cluster there was an issue with limit check. Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/c502b467 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/c502b467 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/c502b467 Branch: refs/heads/affinity_groups Commit: c502b4670328b6b950630e84b4a7d3fd4bcb96ca Parents: 3e4430d Author: Koushik Das Authored: Thu Mar 28 17:26:12 2013 +0530 Committer: Koushik Das Committed: Thu Mar 28 17:26:12 2013 +0530 ---------------------------------------------------------------------- .../hypervisor/vmware/VmwareServerDiscoverer.java | 12 ++++++------ .../vmware/manager/VmwareManagerImpl.java | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c502b467/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/VmwareServerDiscoverer.java ---------------------------------------------------------------------- diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/VmwareServerDiscoverer.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/VmwareServerDiscoverer.java index 94ba97d..2b3eba6 100755 --- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/VmwareServerDiscoverer.java +++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/VmwareServerDiscoverer.java @@ -135,14 +135,14 @@ public class VmwareServerDiscoverer extends DiscovererBase implements return null; } - List hosts = _resourceMgr.listAllHostsInCluster(clusterId); + List hosts = _resourceMgr.listAllHostsInCluster(clusterId); if (hosts != null && hosts.size() > 0) { int maxHostsPerCluster = _hvCapabilitiesDao.getMaxHostsPerCluster(hosts.get(0).getHypervisorType(), hosts.get(0).getHypervisorVersion()); - if (hosts.size() > maxHostsPerCluster) { - String msg = "VMware cluster " + cluster.getName() + " is too big to add new host now. (current configured cluster size: " + maxHostsPerCluster + ")"; - s_logger.error(msg); - throw new DiscoveredWithErrorException(msg); - } + if (hosts.size() >= maxHostsPerCluster) { + String msg = "VMware cluster " + cluster.getName() + " is too big to add new host, current size: " + hosts.size() + ", max. size: " + maxHostsPerCluster; + s_logger.error(msg); + throw new DiscoveredWithErrorException(msg); + } } String privateTrafficLabel = null; http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c502b467/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java ---------------------------------------------------------------------- diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java index 9d29abf..b2e3768 100755 --- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java +++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java @@ -355,10 +355,10 @@ public class VmwareManagerImpl extends ManagerBase implements VmwareManager, Vmw String version = about.getApiVersion(); int maxHostsPerCluster = _hvCapabilitiesDao.getMaxHostsPerCluster(HypervisorType.VMware, version); if (hosts.size() > maxHostsPerCluster) { - String msg = "vCenter cluster size is too big (current configured cluster size: " + maxHostsPerCluster + ")"; - s_logger.error(msg); - throw new DiscoveredWithErrorException(msg); - } + String msg = "Failed to add VMware cluster as size is too big, current size: " + hosts.size() + ", max. size: " + maxHostsPerCluster; + s_logger.error(msg); + throw new DiscoveredWithErrorException(msg); + } } for(ManagedObjectReference morHost: hosts) {