Return-Path: X-Original-To: apmail-cloudstack-dev-archive@www.apache.org Delivered-To: apmail-cloudstack-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7289B10858 for ; Wed, 25 Sep 2013 20:50:59 +0000 (UTC) Received: (qmail 64746 invoked by uid 500); 25 Sep 2013 20:50:58 -0000 Delivered-To: apmail-cloudstack-dev-archive@cloudstack.apache.org Received: (qmail 64691 invoked by uid 500); 25 Sep 2013 20:50:57 -0000 Mailing-List: contact dev-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 dev@cloudstack.apache.org Received: (qmail 64683 invoked by uid 99); 25 Sep 2013 20:50:56 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Sep 2013 20:50:56 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of daan.hoogland@gmail.com designates 209.85.223.180 as permitted sender) Received: from [209.85.223.180] (HELO mail-ie0-f180.google.com) (209.85.223.180) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Sep 2013 20:50:49 +0000 Received: by mail-ie0-f180.google.com with SMTP id u16so273393iet.11 for ; Wed, 25 Sep 2013 13:50:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=eDZEC2BCDomddguofjxUP9r6nFEhOX9mH/hiLyWx6cI=; b=jTOo15vrbKDDxQbGrPBJsiOEJNwv+3+GAnGG0T6SVpt0uv+QY5AQ6uDwMbpRqTEATR Fqsln7cGfBFCW8zwjvKDoYUWwjA8gccFJeYRF6QQl+JllCSkjJDKu0Ks2buqk7EqYhgH psA1FB9LN9tHJQqmFgvdlpiw8ceUr/fXx0RFdOmyoWddgiw3XyjqRp16EGaETeY0NXio 6q1Tfu3MyvRznwBS2qypPrcmDJqOR5JsYs7BJWIg/aPpiGuK7poZCifAFt01sMMRFMDE i2Wjs+vbHgt1Msg/nfL8Y9jPsVrS8PZrDyP53QWFvK8y/N4W8GI069q5ms5tt5bxa7nJ 5bZA== X-Received: by 10.43.10.198 with SMTP id pb6mr18928560icb.40.1380142228860; Wed, 25 Sep 2013 13:50:28 -0700 (PDT) MIME-Version: 1.0 Received: by 10.64.10.167 with HTTP; Wed, 25 Sep 2013 13:50:08 -0700 (PDT) In-Reply-To: References: From: Daan Hoogland Date: Wed, 25 Sep 2013 22:50:08 +0200 Message-ID: Subject: Re: bug? capacity not updated when adding memory to hypervisor To: dev Content-Type: multipart/alternative; boundary=bcaec50e5ce74a7e6a04e73b670a X-Virus-Checked: Checked by ClamAV on apache.org --bcaec50e5ce74a7e6a04e73b670a Content-Type: text/plain; charset=ISO-8859-1 That would not seem in place in one of these blocks altogether, would it? On Wed, Sep 25, 2013 at 10:45 PM, Darren Shepherd < darren.s.shepherd@gmail.com> wrote: > The main bug being the lack of > memCap.setTotalCapacity(host.getTotalMemory()); > > Darren > > On Wed, Sep 25, 2013 at 1:13 PM, Daan Hoogland > wrote: > > I agree Darren, > > > > if (cpuCap.getUsedCapacity() == usedCpu && > > cpuCap.getReservedCapacity() == reservedCpu) { > > } else { > > if (cpuCap.getReservedCapacity() != reservedCpu) { > > cpuCap.setReservedCapacity(reservedCpu); > > } > > if (cpuCap.getUsedCapacity() != usedCpu) { > > cpuCap.setUsedCapacity(usedCpu); > > } > > } > > > > makes more sense. (same for mem) > > > > > > On Wed, Sep 25, 2013 at 9:59 PM, Darren Shepherd < > > darren.s.shepherd@gmail.com> wrote: > > > >> I added more memory to a hypervisor, and the host tables was updated > >> properly, but the op_host_capacity is not updated. I tracked down the > >> code to CapacityManagerImpl.updateCapacityForHost. The below logic > >> seems completely wrong. Unless I'm reading it wrong, it seems like it > >> will only update EITHER used or reserved (not both) and never update > >> total. I removed log statements to make it more readable. > >> > >> if (cpuCap.getUsedCapacity() == usedCpu && > >> cpuCap.getReservedCapacity() == reservedCpu) { > >> } else if (cpuCap.getReservedCapacity() != reservedCpu) { > >> cpuCap.setReservedCapacity(reservedCpu); > >> } else if (cpuCap.getUsedCapacity() != usedCpu) { > >> cpuCap.setUsedCapacity(usedCpu); > >> } > >> > >> if (memCap.getUsedCapacity() == usedMemory && > >> memCap.getReservedCapacity() == reservedMemory) { > >> } else if (memCap.getReservedCapacity() != reservedMemory) { > >> memCap.setReservedCapacity(reservedMemory); > >> } else if (memCap.getUsedCapacity() != usedMemory) { > >> memCap.setUsedCapacity(usedMemory); > >> } > >> > --bcaec50e5ce74a7e6a04e73b670a--