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 90F3511EDF for ; Mon, 9 Jun 2014 07:55:35 +0000 (UTC) Received: (qmail 54774 invoked by uid 500); 9 Jun 2014 07:55:35 -0000 Delivered-To: apmail-cloudstack-dev-archive@cloudstack.apache.org Received: (qmail 54733 invoked by uid 500); 9 Jun 2014 07:55:35 -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 54720 invoked by uid 99); 9 Jun 2014 07:55:34 -0000 Received: from reviews-vm.apache.org (HELO reviews.apache.org) (140.211.11.40) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Jun 2014 07:55:34 +0000 Received: from reviews.apache.org (localhost [127.0.0.1]) by reviews.apache.org (Postfix) with ESMTP id B214A1CC16D; Mon, 9 Jun 2014 07:55:25 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============0639288396151652582==" MIME-Version: 1.0 Subject: Re: Review Request 22354: CLOUDSTACK-6850: Return cpu cores, cpu speed and memory in listUsageRecords From: "Sebastien Goasguen" To: "Kishan Kavala" Cc: "Sebastien Goasguen" , "Olivier Lemasle" , "cloudstack" Date: Mon, 09 Jun 2014 07:55:25 -0000 Message-ID: <20140609075525.22322.14670@reviews.apache.org> X-ReviewBoard-URL: https://reviews.apache.org Auto-Submitted: auto-generated Sender: "Sebastien Goasguen" X-ReviewGroup: cloudstack X-ReviewRequest-URL: https://reviews.apache.org/r/22354/ X-Sender: "Sebastien Goasguen" References: <20140608164002.22323.12341@reviews.apache.org> In-Reply-To: <20140608164002.22323.12341@reviews.apache.org> Reply-To: "Sebastien Goasguen" X-ReviewRequest-Repository: cloudstack-git --===============0639288396151652582== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/22354/#review45061 ----------------------------------------------------------- Hi, is it a bug or a new feature ? I see that it alters the usage db schema, will this affects upgrades ? The jira entry says that it applies to 4.3 as well, does you patch applies to 4.3 ? - Sebastien Goasguen On June 8, 2014, 4:40 p.m., Olivier Lemasle wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/22354/ > ----------------------------------------------------------- > > (Updated June 8, 2014, 4:40 p.m.) > > > Review request for cloudstack and Kishan Kavala. > > > Bugs: CLOUDSTACK-6850 > https://issues.apache.org/jira/browse/CLOUDSTACK-6850 > > > Repository: cloudstack-git > > > Description > ------- > > This patch updates VMInstanceUsageParser to process usage details (cpu cores, cpu speed and memory) for dynamic compute offering usages, in order to save them in table cloud_usage.cloud_usage and return them with the API (listUsageRecords). > > See CLOUDSTACK-6850. > > A change in database model is required for this patch (three new columns in cloud_usage.cloud_usage). > > The patch should apply on master and 4.4. > > > Diffs > ----- > > api/src/org/apache/cloudstack/api/response/UsageRecordResponse.java 5e2e85d > api/src/org/apache/cloudstack/usage/Usage.java 20dc189 > engine/schema/src/com/cloud/usage/UsageVMInstanceVO.java 06d4876 > engine/schema/src/com/cloud/usage/UsageVO.java 67014ef > engine/schema/src/com/cloud/usage/dao/UsageVMInstanceDaoImpl.java b94e12f > server/src/com/cloud/api/ApiResponseHelper.java 119f56d > setup/db/db/schema-430to440.sql d149a65 > usage/src/com/cloud/usage/parser/VMInstanceUsageParser.java ba0d4bf > > Diff: https://reviews.apache.org/r/22354/diff/ > > > Testing > ------- > > Packaged in RPMs, installed and manually tested. > > 1. Create a VM with compute offering "Small instance". > 2. Stop the VM. > 3. Change service offering to a custom offering, with cpu_number=1, cpu_speed=500 MHz, memory=512 MB > 4. Start the VM, wait... Stop the VM. > 6. Change service offering to an other custom offering, with cpu_number=2, cpu_speed=800 MHz, memory=1024 MB > 7. Start the VM, wait... Stop the VM. > 8. Change service offering to the first custom offering, with same "details" (cpu_number=2, cpu_speed=800 MHz, memory=1024 MB) > 9. Start the VM, wait... Stop the VM. > 10. Change service offering to "Medium instance". > > Usages and details are reflected in database and in API response. There is no regression found for other usage types. > Details are returned (and saved in database) only for RUNNING_VM and ALLOCATED_VM, only if the service offering is a custom one. > > Example of response: > > > admin > 184a6564-edab-11e3-b629-0050569ed71c > fbc7578a-edaa-11e3-b629-0050569ed71c > e5047089-c911-40ea-8251-4a76810ac1e0 > california allocated (ServiceOffering: 12) (Template: 5) > 0.098078 Hrs > 2 > 0.098078 > e89c22af-65cf-42a2-8905-6f4bbd7d59a1 > california > b05b64e9-8e0f-4335-b0e0-acc5bad81938 > fbca2564-edaa-11e3-b629-0050569ed71c > e89c22af-65cf-42a2-8905-6f4bbd7d59a1 > XenServer > 1 > 500 > 512 > 2014-06-08'T'17:05:52+02:00 > 2014-06-08'T'17:15:52+02:00 > > > admin > 184a6564-edab-11e3-b629-0050569ed71c > fbc7578a-edaa-11e3-b629-0050569ed71c > e5047089-c911-40ea-8251-4a76810ac1e0 > california allocated (ServiceOffering: 1) (Template: 5) > 0.068594 Hrs > 2 > 0.068594 > e89c22af-65cf-42a2-8905-6f4bbd7d59a1 > california > 84bbf38f-b582-440b-8a8d-20e63e0dbed7 > fbca2564-edaa-11e3-b629-0050569ed71c > e89c22af-65cf-42a2-8905-6f4bbd7d59a1 > XenServer > 2014-06-08'T'17:05:52+02:00 > 2014-06-08'T'17:15:52+02:00 > > > > Thanks, > > Olivier Lemasle > > --===============0639288396151652582==--