CloudStack Usage
Metering
Roxanne Chang
TrendMicro TCloud
CloudStack Metering
Enough resource?
Make a price
Charge!
How does CS
metering the usage ?
Usage Server
• Optional
• Separately installed
• Provide aggregated usage records
• Run at least once per day (Default)
o ...
Usage Server Config
Usage Server Config
Name Value
usage.stats.job.exec.time 00:15
usage.execution.timezone PST
usage.stats.job.aggregation.ra...
Usage Server Config
Name Value
usage.stats.job.exec.time 00:15
usage.execution.timezone PST
usage.stats.job.aggregation.ra...
Usage Record Format
• Virtual Machine
• Network
• IP Address
• Disk Volume
• Template, ISO, Snapshot
• Load Balancer Polic...
Usage Type
ID Usage Type
1 RUNNING_VM
2 ALLOCATED_VM
3 IP_ADDRESS
4 NETWORK_BYTES_SENT
5 NETWORK_BYTES_RECEIVED
6 VOLUME
7...
Format Details
• VM Usage Record
o account
o account id
o domain id
o zone id
o description
o usage
o usage type
o raw usa...
Usage Calculation
1-1-VM Event Time
deployed 2013-06-05 12:00
start 2013-06-05 12:00
stop 2013-06-05 18:00
start again 201...
Get the Usage Records
API
• Admin Only
• generateUsageRecords (A)
o only if there any records need to be generated.
• listUsageRecords
o must pr...
<listusagerecordsresponse>
<count>1816</count>
<usagerecord>
<account>user5</account>
<accountid>10004</accountid>
<domain...
Need Limit ?
Setting Usage Limits
• Zone
o use global setting (keyword: max)
o public ip, snapshot, template, vm, volume, iso/template
...
Use Cases
MS Excel
• Pull data from cloud_usage DB
• Import data to MySQL (via Oracle ODBC
connector)
• Use PivotTables / Reports to...
Citrix CloudPortal
Business Manager
• Integrate cloud_usage DB on
CloudStack/CloudPlatform
• Make resources as products
• ...
Citrix CloudPortal
Business Manager
• Integrate cloud_usage DB on
CloudStack/CloudPlatform
• Make resources as products
• ...
Question ?
Thanks!
Session 2 - CloudStack Usage and Application (2013.Q3)
Session 2 - CloudStack Usage and Application (2013.Q3)
Upcoming SlideShare
Loading in...5
×

Session 2 - CloudStack Usage and Application (2013.Q3)

3,121

Published on

Published in: Technology
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
3,121
On Slideshare
0
From Embeds
0
Number of Embeds
7
Actions
Shares
0
Downloads
26
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

Session 2 - CloudStack Usage and Application (2013.Q3)

  1. 1. CloudStack Usage Metering Roxanne Chang TrendMicro TCloud
  2. 2. CloudStack Metering
  3. 3. Enough resource?
  4. 4. Make a price
  5. 5. Charge!
  6. 6. How does CS metering the usage ?
  7. 7. Usage Server • Optional • Separately installed • Provide aggregated usage records • Run at least once per day (Default) o usage.stats.job.aggregation.range = 1440 min • Take data from the events log in cloud DB o cloud.usage_event • Create summary usage records in cloud_usage DB o cloud_usage.usage_event • Access usage records using listUsageRecords API o http://localhost:8096/client/api?command=listUsageRecords&startdate=2013- 05-25&enddate=2013-06-05
  8. 8. Usage Server Config
  9. 9. Usage Server Config Name Value usage.stats.job.exec.time 00:15 usage.execution.timezone PST usage.stats.job.aggregation.range 60 usage.aggregation.timezone GMT • Usage Job will run at PST 00:15 • Generate usage records for 1hr from 07:15:00 GMT to 08:14:59 GMT • Next exec.time is 01:15
  10. 10. Usage Server Config Name Value usage.stats.job.exec.time 00:15 usage.execution.timezone PST usage.stats.job.aggregation.range 1440 usage.aggregation.timezone GMT • Usage Job will run at PST 00:15 • Generate usage records for 24hrs from 00:00:00 GMT to 23:59:59 GMT 1440 is a special case: CloudStack considerst that it’s a Midnight-Midnight setting
  11. 11. Usage Record Format • Virtual Machine • Network • IP Address • Disk Volume • Template, ISO, Snapshot • Load Balancer Policy / Port Forwarding Rule • Network Offering • VPN User Ref: http://cloudstack.apache.org/docs/en-US/Apache_CloudStack/4.0.2/html/API_Developers_Guide/usage-record- format.html
  12. 12. Usage Type ID Usage Type 1 RUNNING_VM 2 ALLOCATED_VM 3 IP_ADDRESS 4 NETWORK_BYTES_SENT 5 NETWORK_BYTES_RECEIVED 6 VOLUME 7 TMEPLATE ID Usage Type 8 ISO 9 SNAPSHOT 10 SECURITY_GROUP_USAGE 11 LOAD_BALANCER_POLICY 12 PORT_FORWARDING 13 NETWORK_OFFERING 14 VPN_USERS
  13. 13. Format Details • VM Usage Record o account o account id o domain id o zone id o description o usage o usage type o raw usage o virtual machine id o name o offering id o template id o usage id o type o start date, end date
  14. 14. Usage Calculation 1-1-VM Event Time deployed 2013-06-05 12:00 start 2013-06-05 12:00 stop 2013-06-05 18:00 start again 2013-06-05 23:00 The Usage Record startdate 2013-06-05 00:00:00 enddate 2013-06-05 23:59:59 RUNNING_VM (Usage Type 1) 6 + 1 = 7 hours ALLOCATED_VM (Usage Type 2) 12 hours
  15. 15. Get the Usage Records
  16. 16. API • Admin Only • generateUsageRecords (A) o only if there any records need to be generated. • listUsageRecords o must provide a period • listUsageTypes
  17. 17. <listusagerecordsresponse> <count>1816</count> <usagerecord> <account>user5</account> <accountid>10004</accountid> <domainid>1</domainid> <zoneid>1</zoneid> <description>i-3-4-WC running time (ServiceOffering: 1) (Template:3)</description> <usage>2.95288 Hrs</usage> <usagetype>1</usagetype> <rawusage>2.95288</rawusage> <virtualmachineid>245554</virtualmachineid> <name>i-3-4-WC</name> <offeringid>1</offeringid> <templateid>3</templateid> <usageid>245554</usageid> <type>XenServer</type> <startdate>2009-09-15T00:00:00-0700</startdate> <enddate>2009-09-18T16:14:26-0700</enddate> </usagerecord> … (1,815 more usage records) </listusagerecordsresponse>
  18. 18. Need Limit ?
  19. 19. Setting Usage Limits • Zone o use global setting (keyword: max) o public ip, snapshot, template, vm, volume, iso/template size, volume size, network rate, snapshot recurring rule. • Account o public ip, snapshot, template, vm, volume, VPC • Domain o public ip, snapshot, template, vm, volume, VPC
  20. 20. Use Cases
  21. 21. MS Excel • Pull data from cloud_usage DB • Import data to MySQL (via Oracle ODBC connector) • Use PivotTables / Reports to present data Ref: http://support.citrix.com/article/CTX132030
  22. 22. Citrix CloudPortal Business Manager • Integrate cloud_usage DB on CloudStack/CloudPlatform • Make resources as products • Make a price • Scheduled billing
  23. 23. Citrix CloudPortal Business Manager • Integrate cloud_usage DB on CloudStack/CloudPlatform • Make resources as products • Make a price • Scheduled billing
  24. 24. Question ?
  25. 25. Thanks!
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×