[ https://issues.apache.org/jira/browse/CLOUDSTACK-6850?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14195875#comment-14195875 ]
Olivier Lemasle edited comment on CLOUDSTACK-6850 at 11/4/14 9:08 AM: ---------------------------------------------------------------------- [~svscorp], cpu cores, cpu speed and memory are returned in usages *only* if the instance uses a *dynamic compute offering" (or "custom" service offering: cpu & memory are not specified in the service offering but when the VM is launched). With ACS 4.4.0, if I use this service offering (with {{iscustomized=true}}): {code:xml} <serviceoffering> <id>4daeb7bc-5ded-435f-801b-a5d89c5524d1</id> <name>CustomOffering</name> <displaytext>CustomOffering</displaytext> <created>2014-09-09T15:33:12+0200</created> <storagetype>shared</storagetype> <offerha>false</offerha> <limitcpuuse>false</limitcpuuse> <isvolatile>false</isvolatile> <issystem>false</issystem> <defaultuse>false</defaultuse> <iscustomized>true</iscustomized> </serviceoffering> {code} usage records look like this: {code:xml} <usagerecord> <account>admin</account> <accountid>06c0bf94-3821-11e4-9b36-0050569ed71c</accountid> <domainid>ee30148e-3820-11e4-9b36-0050569ed71c</domainid> <zoneid>2d4a129a-f952-4867-9136-5706d890301c</zoneid> <description>testCustom allocated (ServiceOffering: 12) (Template: 205)</description> <usage>0.166667 Hrs</usage> <usagetype>2</usagetype> <rawusage>0.166667</rawusage> <virtualmachineid>a4c7c8a2-fa4d-450c-8544-9444182d1859</virtualmachineid> <name>testCustom</name> <offeringid>4daeb7bc-5ded-435f-801b-a5d89c5524d1</offeringid> <templateid>152e70b1-31cb-4d84-8a68-1fba941cd817</templateid> <usageid>a4c7c8a2-fa4d-450c-8544-9444182d1859</usageid> <type>XenServer</type> <cpunumber>1</cpunumber> <cpuspeed>600</cpuspeed> <memory>1024</memory> <startdate>2014-11-04'T'08:55:00+01:00</startdate> <enddate>2014-11-04'T'09:05:00+01:00</enddate> </usagerecord> {code} For this "normal" service offering ({{iscustomized=false}}, cpu and ram specified): {code:xml} <serviceoffering> <id>f27ba533-efe7-46a2-b9cf-b509c15e5dcf</id> <name>Small Instance</name> <displaytext>Small Instance</displaytext> <cpunumber>1</cpunumber> <cpuspeed>500</cpuspeed> <memory>512</memory> <created>2014-09-09T14:58:43+0200</created> <storagetype>shared</storagetype> <offerha>false</offerha> <limitcpuuse>false</limitcpuuse> <isvolatile>false</isvolatile> <issystem>false</issystem> <defaultuse>false</defaultuse> <iscustomized>false</iscustomized> </serviceoffering> {code} the usage record looks like this: {code:xml} <usagerecord> <account>admin</account> <accountid>06c0bf94-3821-11e4-9b36-0050569ed71c</accountid> <domainid>ee30148e-3820-11e4-9b36-0050569ed71c</domainid> <zoneid>2d4a129a-f952-4867-9136-5706d890301c</zoneid> <description>test2 running time (ServiceOffering: 1) (Template: 205)</description> <usage>0.166667 Hrs</usage> <usagetype>1</usagetype> <rawusage>0.166667</rawusage> <virtualmachineid>efa24dfe-4ab6-4c91-b390-29dfd2184d58</virtualmachineid> <name>test2</name> <offeringid>f27ba533-efe7-46a2-b9cf-b509c15e5dcf</offeringid> <templateid>152e70b1-31cb-4d84-8a68-1fba941cd817</templateid> <usageid>efa24dfe-4ab6-4c91-b390-29dfd2184d58</usageid> <type>XenServer</type> <startdate>2014-11-04'T'08:55:00+01:00</startdate> <enddate>2014-11-04'T'09:05:00+01:00</enddate> </usagerecord> {code} To sum up, you will have cpu and ram information in the service offering OR in the usage record. was (Author: olemasle): [~svscorp], cpu cores, cpu speed and memory are returned in usages *only* if the instance uses a *dynamic compute offering" (or "custom" service offering: cpu & memory are not specified in the service offering but when the VM is launched). With ACS 4.4.0, if I use this service offering (with {{iscustomized=true}}): {code:xml} <serviceoffering> <id>4daeb7bc-5ded-435f-801b-a5d89c5524d1</id> <name>CustomOffering</name> <displaytext>CustomOffering</displaytext> <created>2014-09-09T15:33:12+0200</created> <storagetype>shared</storagetype> <offerha>false</offerha> <limitcpuuse>false</limitcpuuse> <isvolatile>false</isvolatile> <issystem>false</issystem> <defaultuse>false</defaultuse> <iscustomized>true</iscustomized> </serviceoffering> {code} usage records look like this: {code:xml} <usagerecord> <account>admin</account> <accountid>06c0bf94-3821-11e4-9b36-0050569ed71c</accountid> <domainid>ee30148e-3820-11e4-9b36-0050569ed71c</domainid> <zoneid>2d4a129a-f952-4867-9136-5706d890301c</zoneid> <description>testCustom allocated (ServiceOffering: 12) (Template: 205)</description> <usage>0.166667 Hrs</usage> <usagetype>2</usagetype> <rawusage>0.166667</rawusage> <virtualmachineid>a4c7c8a2-fa4d-450c-8544-9444182d1859</virtualmachineid> <name>testCustom</name> <offeringid>4daeb7bc-5ded-435f-801b-a5d89c5524d1</offeringid> <templateid>152e70b1-31cb-4d84-8a68-1fba941cd817</templateid> <usageid>a4c7c8a2-fa4d-450c-8544-9444182d1859</usageid> <type>XenServer</type> <cpunumber>1</cpunumber> <cpuspeed>600</cpuspeed> <memory>1024</memory> <startdate>2014-11-04'T'08:55:00+01:00</startdate> <enddate>2014-11-04'T'09:05:00+01:00</enddate> </usagerecord> {code} For a "normal" service offering ({{iscustomized=true}}), the usage record looks like this: {code:xml} <usagerecord> <account>admin</account> <accountid>06c0bf94-3821-11e4-9b36-0050569ed71c</accountid> <domainid>ee30148e-3820-11e4-9b36-0050569ed71c</domainid> <zoneid>2d4a129a-f952-4867-9136-5706d890301c</zoneid> <description>test2 running time (ServiceOffering: 1) (Template: 205)</description> <usage>0.166667 Hrs</usage> <usagetype>1</usagetype> <rawusage>0.166667</rawusage> <virtualmachineid>efa24dfe-4ab6-4c91-b390-29dfd2184d58</virtualmachineid> <name>test2</name> <offeringid>f27ba533-efe7-46a2-b9cf-b509c15e5dcf</offeringid> <templateid>152e70b1-31cb-4d84-8a68-1fba941cd817</templateid> <usageid>efa24dfe-4ab6-4c91-b390-29dfd2184d58</usageid> <type>XenServer</type> <startdate>2014-11-04'T'08:55:00+01:00</startdate> <enddate>2014-11-04'T'09:05:00+01:00</enddate> </usagerecord> {code} > Cpu cores, cpu speed and memory are not returned by listUsageRecords > -------------------------------------------------------------------- > > Key: CLOUDSTACK-6850 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-6850 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Components: Usage > Affects Versions: 4.3.0, 4.4.0 > Reporter: Olivier Lemasle > Assignee: Olivier Lemasle > Priority: Critical > Fix For: 4.4.0 > > > When using dynamic custom offerings, cpu cores, cpu speed and ram values are > recorded in usage_vm_instance table while parsing the usage events. > But these details are not populated in cloud_usage table, and are not > returned by the listUsageRecords command. Therefore, there is no way to know > the historical values for cpu and memory using API. > We should add cpu_cores, cpu_speed and memory in cloud_usage.cloud_usage and > return them in listUsageRecords response. -- This message was sent by Atlassian JIRA (v6.3.4#6332)