SlideShare una empresa de Scribd logo
1 de 32
CloudStack Metering
Working with the Usage Data
Tariq Iqbal
Senior Consultant
tariq.iqbal@shapeblue.com
Twitter: @TariqIqbal_ @ShapeBlue
@ShapeBlue #CloudStack #CCCNA14
 Involved with CloudStack before donation to Apache
 Built and deployed CloudStack / CloudPlatform based clouds for
Enterprises and Service Providers globally - SunGard, Ascenty
 Specialise in integrating CloudStack with Business Support and
Operational Support systems, which include:
 CloudPortals (including Payment Gateways, Fraud Control solutions)
 CRM/ERP Systems – SAPB/1, Salesforce.com
 Monitoring Solutions – Nagios, Splunk, Zenoss
 Ticketing Systems – ServiceDesk, Email
About Me
@ShapeBlue #CloudStack #CCCNA14
“ShapeBlue are expert builders of public & private clouds. They
are the leading global independent CloudStack / CloudPlatform
integrator & consultancy”
“First to offer professional 24x7x365 support of
Apache CloudStack and now CSForge”
“ShapeBlue is absolutely one of the top experts on deploying
CloudStack. Great company and very deep skill set”
About ShapeBlue
@ShapeBlue #CloudStack #CCCNA14
 CloudStack Usage
 CloudStack Configuration
 Usage Data Generation
 Usage Data Access
 Customer Use Cases
Overview
@ShapeBlue #CloudStack #CCCNA14
 Organisations need to be able to meter their cloud's
consumption to:
 Monetize the cloud offerings by charging for usage
 Report on the cloud’s resource usage for monitoring/capacity
planning
 Majority of organisations already have existing BSS/OSS and just
need access to the usage data
 Organisations tend to have different billing criteria/charging
models and require access to usage data for their specific needs
Usage Requirements
@ShapeBlue #CloudStack #CCCNA14
 CloudStack does not offer any
native usage monitoring or
billing/chargeback capability
 Root Admin can view current
System Capacity
 Domain Admin and Users can
view VM statistics
Usage in CloudStack today
@ShapeBlue #CloudStack #CCCNA14
 CloudStack includes a Usage Server:
 Optional Component
 Separately installed service called ‘cloudstack-usage’
 Runs once a day (Default)
 Creates aggregated usage records for the various resources
consumed in CloudStack
 The usage records are stored in a separate database called
‘cloud_usage’
Usage Server
@ShapeBlue #CloudStack #CCCNA14
Usage Server Configuration
@ShapeBlue #CloudStack #CCCNA14
Usage Server Configuration Examples
@ShapeBlue #CloudStack #CCCNA14
 As CloudStack resources are created, consumed and destroyed,
appropriate Event records are created in cloud.usage_events
 There are 110 different events. Full list in the Programmer Guide
 Network usage is the only exception which doesn't use Events
CloudStack Events
@ShapeBlue #CloudStack #CCCNA14
1) CloudStack events are logged into cloud.usage_event table
2) The cloudstack_usage job gets a list of the latest usage events
3) Inserts these events into cloud_usage.usage_events table
4) Parses cloud_usage.usage_event and populates Helper tables
5) Helper table data used to populate cloud_usage.cloud_usage
table with aggregation range wise data
Usage Record Generation
@ShapeBlue #CloudStack #CCCNA14
Usage Types
@ShapeBlue #CloudStack #CCCNA14
Usage Types
API: http://<HOSTIP>:8096/client/api?command=listUsageTypes
@ShapeBlue #CloudStack #CCCNA14
 Usage Records show the amount of resources consumed by guest instances.
 The 8 Usage Record formats are:
 Allocated & Running VMs
 Network Usage
 IP Address
 Disk Volume
 Template, ISO and Snapshot
 Load Balancer or Port Forwarding
 Network Offering
 VPN User
 Details of the Usage Record formats can be found in the Developers Guide
Usage Records
@ShapeBlue #CloudStack #CCCNA14
VM Usage Record Format
@ShapeBlue #CloudStack #CCCNA14
 To Create, Start, Stop and Restart a VM:
Usage Record Example
@ShapeBlue #CloudStack #CCCNA14
Accessing Usage Data
CloudStack Usage Data
@ShapeBlue #CloudStack #CCCNA14
 The usage records can be accessed through the CloudStack API
 This is best done using the authentication port 8080 and requires
both the API Key and Secret Key and for the API request to be
signed
 CloudStack provides the following Root Admin API calls and
responds with XML and JSON responses:
 listUsageTypes – lists available Usage Types
 listUsageRecords - provides Usage records for a date range
 generateUsageRecords - asynchronous usage record generation
CloudStack API
@ShapeBlue #CloudStack #CCCNA14
 The base API request is:
http://<HOST>:<8080>/client/api?command=listUsageRecords&startdate=y
yyy-MM-dd&enddate=yyyy-MM-dd&signature
 Optional request parameters:
ListUsageRecords API
@ShapeBlue #CloudStack #CCCNA14
 <listusagerecordsresponse>
<count>1</count>
<usagerecord>
<account>user5</account>
<accountid>10004</accountid>
<domainid>1</domainid>
<zoneid>1</zoneid>
<description>i-3-4-WC running time (Service Offering: 1) (Template: 3)</description>
<usage>2.95288 Hrs</usage>
<usagetype>1</usagetype>
<rawusage>2.95288</rawusage>
<virtualmachineid>4</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>
</listusagerecordsresponse>
ListUsageRecords Response
@ShapeBlue #CloudStack #CCCNA14
 CloudMonkey is a CLI tool for CloudStack and can be used as an
interactive shell or from within a shell script to call the API
 It can output the Usage Data in both JSON and Tabular form to a
file or pipe it to another application for further processing
 Filtering can be used to limit the result set
 It supports argument passing and shell automation
 The host, port, apikey and secretkey can be configured on setup
CloudMonkey CLI
@ShapeBlue #CloudStack #CCCNA14
CloudMonkey list usagerecords
The command to retrieve Usage Records is:
cloudmonkey list usagerecords domainid=7ded1404-d7fc-11e2-a70f-
080027cfaf0b startdate=2013-06-01 enddate=2013-06-23 accountid=2
@ShapeBlue #CloudStack #CCCNA14
 The usage records can be also accessed by directly querying the
cloud_usage.cloud_usage MySQL table in CloudStack
 Usage Data can be exported in a CSV format from a SELECT
query
 The SQL query can become complex if the ID fields in the data
need to be de-referenced
 Typically multiple passes of the query results may be required to
extract the required information
SQL
@ShapeBlue #CloudStack #CCCNA14
 CloudStack 4.1 started publishing events onto a message queue
 Uses RabbitMQ as the message broker, but likely to work with other AMQP-
based brokers
 Use case: A third-party cloud usage solution can subscribe to CloudStack
events and generate usage data which can be consumed by their billing
software
 Great blog from Chip Childers on configuring a CloudStack management
server to publish events, and some sample code that prints each event to the
console as they are received
 http://www.chipchilders.com/blog/2013/7/16/tapping-into-apache-cloudstack-
events-via-amqp.html
 http://cloudstack.apache.org/docs/en-
US/Apache_CloudStack/4.1.0/html/Admin_Guide/events.html
CloudStack Message Queue
@ShapeBlue #CloudStack #CCCNA14
 Once you are able to access the Usage Data, you will need to
design the mapping between the fields in the CloudStack Usage
Data and the fields of the target system
 Considerations:
 Do you actually need all the Usage Data for all Resources?
 Any UUID values of the CloudStack resources should also be
imported into the target system for reference purposes
 Will you need to synchronise accounts and resources in CloudStack
with the target system?
Mediation
@ShapeBlue #CloudStack #CCCNA14
Customer Use Cases
CloudStack Usage Data
@ShapeBlue #CloudStack #CCCNA14
 MS Excel can be used to analyse CloudStack Usage Records
 The usage records are imported from the cloud_usage table into
MS Excel via an MySQL ODBC connection
 Either PivotTables or reports can be used to present the data
 This is convenient and
great for integration
testing between CloudStack
and external systems
MS Excel
@ShapeBlue #CloudStack #CCCNA14
 Citrix CloudPortal Business Manager tightly integrates with the
cloud_usage database on CloudStack/CloudPlatform
 The Usage Data is cross referenced against the utility pricing and
subscription pricing in CPBM
 Scheduled Billing and Invoicing jobs generate the invoices in XML
or PDF based on the
users billing cycle
Citrix CloudPortal
@ShapeBlue #CloudStack #CCCNA14
 Splunk> is an operational intelligence tool that was initially used
for collecting and indexing infrastructure logs
 We then connected splunk> to the CloudStack Usage database
and automated the collection and indexing of Usage Data
 Setup feature-rich dashboards
and the capability to drill down into
the Usage Data for BI reporting
Splunk>
@ShapeBlue #CloudStack #CCCNA14
 Provides usage visibility, cost control and IT billing for Private and
Hybrid Clouds
 Dashboard Integrated in the CloudStack UI
 Pricing, Alerting, Reporting, Capacity Mgmt
 Amysta consolidates public cloud expenses
e.g. AWS and private cloud consumption in
one dashboard view
Amysta
@ShapeBlue #CloudStack #CCCNA14
 Slides: www.slideshare.net/shapeblue
 Blogs: www.shapeblue.com/blogs
 CloudStack Programmer Guide, API Documentation & Wiki:
http://cloudstack.apache.org/
 CloudStack Mailing Lists (Users, Development, Marketing):
http://cloudstack.apache.org/mailing-lists.html
 CloudMonkey:
https://cwiki.apache.org/CLOUDSTACK/cloudstack+cloudmonkey+cli
 How to Use MS Excel to Analyze CloudStack Usage Records:
http://support.citrix.com/article/CTX132030
Further Information
Working with
CloudStack Usage Data
Tariq Iqbal
Senior Consultant
tariq.iqbal@shapeblue.com
Twitter: @TariqIqbal_ @ShapeBlue

Más contenido relacionado

La actualidad más candente

A10 Capabilities Overview(2015-05-29)
A10 Capabilities Overview(2015-05-29)A10 Capabilities Overview(2015-05-29)
A10 Capabilities Overview(2015-05-29)
David Ayoub
 

La actualidad más candente (20)

Linux Network Stack
Linux Network StackLinux Network Stack
Linux Network Stack
 
Namespaces and cgroups - the basis of Linux containers
Namespaces and cgroups - the basis of Linux containersNamespaces and cgroups - the basis of Linux containers
Namespaces and cgroups - the basis of Linux containers
 
VyOSの開発とか運用の話
VyOSの開発とか運用の話VyOSの開発とか運用の話
VyOSの開発とか運用の話
 
OpenStack Load balancer
OpenStack Load balancerOpenStack Load balancer
OpenStack Load balancer
 
Fast Userspace OVS with AF_XDP, OVS CONF 2018
Fast Userspace OVS with AF_XDP, OVS CONF 2018Fast Userspace OVS with AF_XDP, OVS CONF 2018
Fast Userspace OVS with AF_XDP, OVS CONF 2018
 
Introducing TR-069 - An Axiros Workshop for the TR-069 Protocol - Part 1
Introducing TR-069 - An Axiros Workshop for the TR-069 Protocol - Part 1Introducing TR-069 - An Axiros Workshop for the TR-069 Protocol - Part 1
Introducing TR-069 - An Axiros Workshop for the TR-069 Protocol - Part 1
 
A10 Capabilities Overview(2015-05-29)
A10 Capabilities Overview(2015-05-29)A10 Capabilities Overview(2015-05-29)
A10 Capabilities Overview(2015-05-29)
 
DPDK in Containers Hands-on Lab
DPDK in Containers Hands-on LabDPDK in Containers Hands-on Lab
DPDK in Containers Hands-on Lab
 
systemd
systemdsystemd
systemd
 
VM Job Queues in CloudStack
VM Job Queues in CloudStackVM Job Queues in CloudStack
VM Job Queues in CloudStack
 
Docker and CloudStack
Docker and CloudStackDocker and CloudStack
Docker and CloudStack
 
Ceph Tech Talk -- Ceph Benchmarking Tool
Ceph Tech Talk -- Ceph Benchmarking ToolCeph Tech Talk -- Ceph Benchmarking Tool
Ceph Tech Talk -- Ceph Benchmarking Tool
 
OVN - Basics and deep dive
OVN - Basics and deep diveOVN - Basics and deep dive
OVN - Basics and deep dive
 
Technical Introduction to RHEL8
Technical Introduction to RHEL8Technical Introduction to RHEL8
Technical Introduction to RHEL8
 
Building a redundant CloudStack management cluster - Vladimir Melnik
Building a redundant CloudStack management cluster - Vladimir MelnikBuilding a redundant CloudStack management cluster - Vladimir Melnik
Building a redundant CloudStack management cluster - Vladimir Melnik
 
DevConf 2014 Kernel Networking Walkthrough
DevConf 2014   Kernel Networking WalkthroughDevConf 2014   Kernel Networking Walkthrough
DevConf 2014 Kernel Networking Walkthrough
 
Containers and CloudStack
Containers and CloudStackContainers and CloudStack
Containers and CloudStack
 
The TCP/IP Stack in the Linux Kernel
The TCP/IP Stack in the Linux KernelThe TCP/IP Stack in the Linux Kernel
The TCP/IP Stack in the Linux Kernel
 
The Basic Introduction of Open vSwitch
The Basic Introduction of Open vSwitchThe Basic Introduction of Open vSwitch
The Basic Introduction of Open vSwitch
 
introduction to linux kernel tcp/ip ptocotol stack
introduction to linux kernel tcp/ip ptocotol stack introduction to linux kernel tcp/ip ptocotol stack
introduction to linux kernel tcp/ip ptocotol stack
 

Similar a CloudStack Metering - Working with Usage Data #CCCNA14

Citrix cloud platform 4.2 data sheet
Citrix cloud platform 4.2 data sheetCitrix cloud platform 4.2 data sheet
Citrix cloud platform 4.2 data sheet
Nuno Alves
 
Meetup: Streaming Data Pipeline Development
Meetup:  Streaming Data Pipeline DevelopmentMeetup:  Streaming Data Pipeline Development
Meetup: Streaming Data Pipeline Development
Timothy Spann
 
Building a SaaS using WSO2 Stratos
Building a SaaS using WSO2 StratosBuilding a SaaS using WSO2 Stratos
Building a SaaS using WSO2 Stratos
WSO2
 

Similar a CloudStack Metering - Working with Usage Data #CCCNA14 (20)

CloudStack Metering – Working with the Usage Data
CloudStack Metering – Working with the Usage DataCloudStack Metering – Working with the Usage Data
CloudStack Metering – Working with the Usage Data
 
CloudStack Metering – Working with the Usage Data
CloudStack Metering – Working with the Usage DataCloudStack Metering – Working with the Usage Data
CloudStack Metering – Working with the Usage Data
 
Working with CloudStack Usage Data - CCCEU13
Working with CloudStack Usage Data - CCCEU13Working with CloudStack Usage Data - CCCEU13
Working with CloudStack Usage Data - CCCEU13
 
Working with CloudStack Usage Data
Working with CloudStack Usage DataWorking with CloudStack Usage Data
Working with CloudStack Usage Data
 
Cloudstack autoscaling
Cloudstack autoscalingCloudstack autoscaling
Cloudstack autoscaling
 
Hybrid Cloud Management and Orchestration : The Complete Solution
Hybrid Cloud Management and Orchestration : The Complete SolutionHybrid Cloud Management and Orchestration : The Complete Solution
Hybrid Cloud Management and Orchestration : The Complete Solution
 
Citrix cloud platform 4.2 data sheet
Citrix cloud platform 4.2 data sheetCitrix cloud platform 4.2 data sheet
Citrix cloud platform 4.2 data sheet
 
Jamcracker Cloud Management Platform: Control, Govern and Manage Enterprise C...
Jamcracker Cloud Management Platform: Control, Govern and Manage Enterprise C...Jamcracker Cloud Management Platform: Control, Govern and Manage Enterprise C...
Jamcracker Cloud Management Platform: Control, Govern and Manage Enterprise C...
 
Who's in your Cloud? Cloud State Monitoring
Who's in your Cloud? Cloud State MonitoringWho's in your Cloud? Cloud State Monitoring
Who's in your Cloud? Cloud State Monitoring
 
Seminar presentation 05042011_v7_with_cl
Seminar presentation 05042011_v7_with_clSeminar presentation 05042011_v7_with_cl
Seminar presentation 05042011_v7_with_cl
 
Meetup: Streaming Data Pipeline Development
Meetup:  Streaming Data Pipeline DevelopmentMeetup:  Streaming Data Pipeline Development
Meetup: Streaming Data Pipeline Development
 
Building a SaaS using WSO2 Stratos
Building a SaaS using WSO2 StratosBuilding a SaaS using WSO2 Stratos
Building a SaaS using WSO2 Stratos
 
CloudStack 101 CCCEU13
CloudStack 101 CCCEU13CloudStack 101 CCCEU13
CloudStack 101 CCCEU13
 
PPT_CC.pptx
PPT_CC.pptxPPT_CC.pptx
PPT_CC.pptx
 
Integration of mule esb with microsoft azure
Integration of mule esb with microsoft azureIntegration of mule esb with microsoft azure
Integration of mule esb with microsoft azure
 
Cloud sim report
Cloud sim reportCloud sim report
Cloud sim report
 
Accelerating Time-to-Value Through Hybrid Cloud Automation
Accelerating Time-to-Value Through Hybrid Cloud AutomationAccelerating Time-to-Value Through Hybrid Cloud Automation
Accelerating Time-to-Value Through Hybrid Cloud Automation
 
Cloud computing
Cloud computingCloud computing
Cloud computing
 
Dag Sonstebo - CloudStack usage service
Dag Sonstebo - CloudStack usage serviceDag Sonstebo - CloudStack usage service
Dag Sonstebo - CloudStack usage service
 
Knowledge management and information system
Knowledge management and information systemKnowledge management and information system
Knowledge management and information system
 

Más de ShapeBlue

Más de ShapeBlue (20)

CloudStack Authentication Methods – Harikrishna Patnala, ShapeBlue
CloudStack Authentication Methods – Harikrishna Patnala, ShapeBlueCloudStack Authentication Methods – Harikrishna Patnala, ShapeBlue
CloudStack Authentication Methods – Harikrishna Patnala, ShapeBlue
 
CloudStack Tooling Ecosystem – Kiran Chavala, ShapeBlue
CloudStack Tooling Ecosystem – Kiran Chavala, ShapeBlueCloudStack Tooling Ecosystem – Kiran Chavala, ShapeBlue
CloudStack Tooling Ecosystem – Kiran Chavala, ShapeBlue
 
Elevating Cloud Infrastructure with Object Storage, DRS, VM Scheduling, and D...
Elevating Cloud Infrastructure with Object Storage, DRS, VM Scheduling, and D...Elevating Cloud Infrastructure with Object Storage, DRS, VM Scheduling, and D...
Elevating Cloud Infrastructure with Object Storage, DRS, VM Scheduling, and D...
 
VM Migration from VMware to CloudStack and KVM – Suresh Anaparti, ShapeBlue
VM Migration from VMware to CloudStack and KVM – Suresh Anaparti, ShapeBlueVM Migration from VMware to CloudStack and KVM – Suresh Anaparti, ShapeBlue
VM Migration from VMware to CloudStack and KVM – Suresh Anaparti, ShapeBlue
 
How We Grew Up with CloudStack and its Journey – Dilip Singh, DataHub
How We Grew Up with CloudStack and its Journey – Dilip Singh, DataHubHow We Grew Up with CloudStack and its Journey – Dilip Singh, DataHub
How We Grew Up with CloudStack and its Journey – Dilip Singh, DataHub
 
What’s New in CloudStack 4.19, Abhishek Kumar, Release Manager Apache CloudSt...
What’s New in CloudStack 4.19, Abhishek Kumar, Release Manager Apache CloudSt...What’s New in CloudStack 4.19, Abhishek Kumar, Release Manager Apache CloudSt...
What’s New in CloudStack 4.19, Abhishek Kumar, Release Manager Apache CloudSt...
 
CloudStack 101: The Best Way to Build Your Private Cloud – Rohit Yadav, VP Ap...
CloudStack 101: The Best Way to Build Your Private Cloud – Rohit Yadav, VP Ap...CloudStack 101: The Best Way to Build Your Private Cloud – Rohit Yadav, VP Ap...
CloudStack 101: The Best Way to Build Your Private Cloud – Rohit Yadav, VP Ap...
 
How We Use CloudStack to Provide Managed Hosting - Swen Brüseke - proIO
How We Use CloudStack to Provide Managed Hosting - Swen Brüseke - proIOHow We Use CloudStack to Provide Managed Hosting - Swen Brüseke - proIO
How We Use CloudStack to Provide Managed Hosting - Swen Brüseke - proIO
 
Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And...
Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And...Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And...
Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And...
 
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...
 
KVM Security Groups Under the Hood - Wido den Hollander - Your.Online
KVM Security Groups Under the Hood - Wido den Hollander - Your.OnlineKVM Security Groups Under the Hood - Wido den Hollander - Your.Online
KVM Security Groups Under the Hood - Wido den Hollander - Your.Online
 
How to Re-use Old Hardware with CloudStack. Saving Money and the Environment ...
How to Re-use Old Hardware with CloudStack. Saving Money and the Environment ...How to Re-use Old Hardware with CloudStack. Saving Money and the Environment ...
How to Re-use Old Hardware with CloudStack. Saving Money and the Environment ...
 
Use Existing Assets to Build a Powerful In-house Cloud Solution - Magali Perv...
Use Existing Assets to Build a Powerful In-house Cloud Solution - Magali Perv...Use Existing Assets to Build a Powerful In-house Cloud Solution - Magali Perv...
Use Existing Assets to Build a Powerful In-house Cloud Solution - Magali Perv...
 
Import Export Virtual Machine for KVM Hypervisor - Ayush Pandey - University ...
Import Export Virtual Machine for KVM Hypervisor - Ayush Pandey - University ...Import Export Virtual Machine for KVM Hypervisor - Ayush Pandey - University ...
Import Export Virtual Machine for KVM Hypervisor - Ayush Pandey - University ...
 
DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti...
DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti...DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti...
DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti...
 
Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha...
Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha...Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha...
Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha...
 
Elevating Privacy and Security in CloudStack - Boris Stoyanov - ShapeBlue
Elevating Privacy and Security in CloudStack - Boris Stoyanov - ShapeBlueElevating Privacy and Security in CloudStack - Boris Stoyanov - ShapeBlue
Elevating Privacy and Security in CloudStack - Boris Stoyanov - ShapeBlue
 
Transitioning from VMware vCloud to Apache CloudStack: A Path to Profitabilit...
Transitioning from VMware vCloud to Apache CloudStack: A Path to Profitabilit...Transitioning from VMware vCloud to Apache CloudStack: A Path to Profitabilit...
Transitioning from VMware vCloud to Apache CloudStack: A Path to Profitabilit...
 
Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda...
Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda...Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda...
Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda...
 
What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlue
What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlueWhat’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlue
What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlue
 

Último

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Último (20)

AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 

CloudStack Metering - Working with Usage Data #CCCNA14

  • 1. CloudStack Metering Working with the Usage Data Tariq Iqbal Senior Consultant tariq.iqbal@shapeblue.com Twitter: @TariqIqbal_ @ShapeBlue
  • 2. @ShapeBlue #CloudStack #CCCNA14  Involved with CloudStack before donation to Apache  Built and deployed CloudStack / CloudPlatform based clouds for Enterprises and Service Providers globally - SunGard, Ascenty  Specialise in integrating CloudStack with Business Support and Operational Support systems, which include:  CloudPortals (including Payment Gateways, Fraud Control solutions)  CRM/ERP Systems – SAPB/1, Salesforce.com  Monitoring Solutions – Nagios, Splunk, Zenoss  Ticketing Systems – ServiceDesk, Email About Me
  • 3. @ShapeBlue #CloudStack #CCCNA14 “ShapeBlue are expert builders of public & private clouds. They are the leading global independent CloudStack / CloudPlatform integrator & consultancy” “First to offer professional 24x7x365 support of Apache CloudStack and now CSForge” “ShapeBlue is absolutely one of the top experts on deploying CloudStack. Great company and very deep skill set” About ShapeBlue
  • 4. @ShapeBlue #CloudStack #CCCNA14  CloudStack Usage  CloudStack Configuration  Usage Data Generation  Usage Data Access  Customer Use Cases Overview
  • 5. @ShapeBlue #CloudStack #CCCNA14  Organisations need to be able to meter their cloud's consumption to:  Monetize the cloud offerings by charging for usage  Report on the cloud’s resource usage for monitoring/capacity planning  Majority of organisations already have existing BSS/OSS and just need access to the usage data  Organisations tend to have different billing criteria/charging models and require access to usage data for their specific needs Usage Requirements
  • 6. @ShapeBlue #CloudStack #CCCNA14  CloudStack does not offer any native usage monitoring or billing/chargeback capability  Root Admin can view current System Capacity  Domain Admin and Users can view VM statistics Usage in CloudStack today
  • 7. @ShapeBlue #CloudStack #CCCNA14  CloudStack includes a Usage Server:  Optional Component  Separately installed service called ‘cloudstack-usage’  Runs once a day (Default)  Creates aggregated usage records for the various resources consumed in CloudStack  The usage records are stored in a separate database called ‘cloud_usage’ Usage Server
  • 9. @ShapeBlue #CloudStack #CCCNA14 Usage Server Configuration Examples
  • 10. @ShapeBlue #CloudStack #CCCNA14  As CloudStack resources are created, consumed and destroyed, appropriate Event records are created in cloud.usage_events  There are 110 different events. Full list in the Programmer Guide  Network usage is the only exception which doesn't use Events CloudStack Events
  • 11. @ShapeBlue #CloudStack #CCCNA14 1) CloudStack events are logged into cloud.usage_event table 2) The cloudstack_usage job gets a list of the latest usage events 3) Inserts these events into cloud_usage.usage_events table 4) Parses cloud_usage.usage_event and populates Helper tables 5) Helper table data used to populate cloud_usage.cloud_usage table with aggregation range wise data Usage Record Generation
  • 13. @ShapeBlue #CloudStack #CCCNA14 Usage Types API: http://<HOSTIP>:8096/client/api?command=listUsageTypes
  • 14. @ShapeBlue #CloudStack #CCCNA14  Usage Records show the amount of resources consumed by guest instances.  The 8 Usage Record formats are:  Allocated & Running VMs  Network Usage  IP Address  Disk Volume  Template, ISO and Snapshot  Load Balancer or Port Forwarding  Network Offering  VPN User  Details of the Usage Record formats can be found in the Developers Guide Usage Records
  • 15. @ShapeBlue #CloudStack #CCCNA14 VM Usage Record Format
  • 16. @ShapeBlue #CloudStack #CCCNA14  To Create, Start, Stop and Restart a VM: Usage Record Example
  • 17. @ShapeBlue #CloudStack #CCCNA14 Accessing Usage Data CloudStack Usage Data
  • 18. @ShapeBlue #CloudStack #CCCNA14  The usage records can be accessed through the CloudStack API  This is best done using the authentication port 8080 and requires both the API Key and Secret Key and for the API request to be signed  CloudStack provides the following Root Admin API calls and responds with XML and JSON responses:  listUsageTypes – lists available Usage Types  listUsageRecords - provides Usage records for a date range  generateUsageRecords - asynchronous usage record generation CloudStack API
  • 19. @ShapeBlue #CloudStack #CCCNA14  The base API request is: http://<HOST>:<8080>/client/api?command=listUsageRecords&startdate=y yyy-MM-dd&enddate=yyyy-MM-dd&signature  Optional request parameters: ListUsageRecords API
  • 20. @ShapeBlue #CloudStack #CCCNA14  <listusagerecordsresponse> <count>1</count> <usagerecord> <account>user5</account> <accountid>10004</accountid> <domainid>1</domainid> <zoneid>1</zoneid> <description>i-3-4-WC running time (Service Offering: 1) (Template: 3)</description> <usage>2.95288 Hrs</usage> <usagetype>1</usagetype> <rawusage>2.95288</rawusage> <virtualmachineid>4</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> </listusagerecordsresponse> ListUsageRecords Response
  • 21. @ShapeBlue #CloudStack #CCCNA14  CloudMonkey is a CLI tool for CloudStack and can be used as an interactive shell or from within a shell script to call the API  It can output the Usage Data in both JSON and Tabular form to a file or pipe it to another application for further processing  Filtering can be used to limit the result set  It supports argument passing and shell automation  The host, port, apikey and secretkey can be configured on setup CloudMonkey CLI
  • 22. @ShapeBlue #CloudStack #CCCNA14 CloudMonkey list usagerecords The command to retrieve Usage Records is: cloudmonkey list usagerecords domainid=7ded1404-d7fc-11e2-a70f- 080027cfaf0b startdate=2013-06-01 enddate=2013-06-23 accountid=2
  • 23. @ShapeBlue #CloudStack #CCCNA14  The usage records can be also accessed by directly querying the cloud_usage.cloud_usage MySQL table in CloudStack  Usage Data can be exported in a CSV format from a SELECT query  The SQL query can become complex if the ID fields in the data need to be de-referenced  Typically multiple passes of the query results may be required to extract the required information SQL
  • 24. @ShapeBlue #CloudStack #CCCNA14  CloudStack 4.1 started publishing events onto a message queue  Uses RabbitMQ as the message broker, but likely to work with other AMQP- based brokers  Use case: A third-party cloud usage solution can subscribe to CloudStack events and generate usage data which can be consumed by their billing software  Great blog from Chip Childers on configuring a CloudStack management server to publish events, and some sample code that prints each event to the console as they are received  http://www.chipchilders.com/blog/2013/7/16/tapping-into-apache-cloudstack- events-via-amqp.html  http://cloudstack.apache.org/docs/en- US/Apache_CloudStack/4.1.0/html/Admin_Guide/events.html CloudStack Message Queue
  • 25. @ShapeBlue #CloudStack #CCCNA14  Once you are able to access the Usage Data, you will need to design the mapping between the fields in the CloudStack Usage Data and the fields of the target system  Considerations:  Do you actually need all the Usage Data for all Resources?  Any UUID values of the CloudStack resources should also be imported into the target system for reference purposes  Will you need to synchronise accounts and resources in CloudStack with the target system? Mediation
  • 26. @ShapeBlue #CloudStack #CCCNA14 Customer Use Cases CloudStack Usage Data
  • 27. @ShapeBlue #CloudStack #CCCNA14  MS Excel can be used to analyse CloudStack Usage Records  The usage records are imported from the cloud_usage table into MS Excel via an MySQL ODBC connection  Either PivotTables or reports can be used to present the data  This is convenient and great for integration testing between CloudStack and external systems MS Excel
  • 28. @ShapeBlue #CloudStack #CCCNA14  Citrix CloudPortal Business Manager tightly integrates with the cloud_usage database on CloudStack/CloudPlatform  The Usage Data is cross referenced against the utility pricing and subscription pricing in CPBM  Scheduled Billing and Invoicing jobs generate the invoices in XML or PDF based on the users billing cycle Citrix CloudPortal
  • 29. @ShapeBlue #CloudStack #CCCNA14  Splunk> is an operational intelligence tool that was initially used for collecting and indexing infrastructure logs  We then connected splunk> to the CloudStack Usage database and automated the collection and indexing of Usage Data  Setup feature-rich dashboards and the capability to drill down into the Usage Data for BI reporting Splunk>
  • 30. @ShapeBlue #CloudStack #CCCNA14  Provides usage visibility, cost control and IT billing for Private and Hybrid Clouds  Dashboard Integrated in the CloudStack UI  Pricing, Alerting, Reporting, Capacity Mgmt  Amysta consolidates public cloud expenses e.g. AWS and private cloud consumption in one dashboard view Amysta
  • 31. @ShapeBlue #CloudStack #CCCNA14  Slides: www.slideshare.net/shapeblue  Blogs: www.shapeblue.com/blogs  CloudStack Programmer Guide, API Documentation & Wiki: http://cloudstack.apache.org/  CloudStack Mailing Lists (Users, Development, Marketing): http://cloudstack.apache.org/mailing-lists.html  CloudMonkey: https://cwiki.apache.org/CLOUDSTACK/cloudstack+cloudmonkey+cli  How to Use MS Excel to Analyze CloudStack Usage Records: http://support.citrix.com/article/CTX132030 Further Information
  • 32. Working with CloudStack Usage Data Tariq Iqbal Senior Consultant tariq.iqbal@shapeblue.com Twitter: @TariqIqbal_ @ShapeBlue