Today we’re releasing the RightScale Cloud Pricing Service, an API that provides a single source of pricing data for all public clouds supported by RightScale — including Amazon Web Services (AWS), Microsoft Azure, Google, IBM SoftLayer, HP, and Rackspace — and all private clouds registered across your RightScale accounts.
The importance of pricing data
Transparent pay-per-use pricing is a fundamental aspect of cloud computing. Cloud customers rely on pricing data as one of the criteria for deciding which cloud vendor, resource type, purchase option, or geographic region to use. The idea of building cost-aware systems has been around for a while. Having a cloud pricing API simplifies the development of such systems by enabling the automation of deployment and scaling decisions based on price. For example, using our Cloud Analytics API, you can fetch a list of your active AWS Reserved Instances and their utilization percentages. You can then use the Cloud Pricing Service API to compare the price of launching an instance using your under-utilized Reserved Instances vs. AWS Spot Instances vs. Google Preemptible Instances.
While pay-per-use pricing might seem conceptually simple, two factors complicate things in practice:
- There are a lot of prices: When you consider that each instance has a price for each data center, operating system and purchase option across cloud vendors, you can understand how instances alone have over 100,000 prices. The pricing service was designed to support different types of resources such as instances, storage, and databases across cloud vendors. We are initially only supporting instance prices, which is by far the most complicated resource in terms of pricing.
- Prices change regularly: In the last two years, we’ve seen more than 30 price change announcements, each potentially impacting a large number of prices; new instances are also regularly introduced by vendors. Having a single API that tracks these changes and gives users visibility into historic prices enables them to update their forecasts and re-evaluate purchase decisions quickly.
Price vs cost
It’s helpful to differentiate the price of a resource from its cost:
- Price refers to the list price of a resource. For example, an m1.small instance has a price of $0.10/hour.
- Cost refers to the charges incurred for using a specific resource for a defined period of usage. For example, running an m1.small instance at $0.10/hour for 5 hours has a cost of $0.50. Cost needs to take into account the business logic that is specific to a cloud vendor. Examples of this include AWS Reserved Instance discounts that are applied in AWS Consolidated Billing; bucket storage that is aggregated/tiered across accounts in AWS and Microsoft Azure; Google’s Sustained Use Discounts; and Microsoft’s Enterprise Agreement discounts.
The RightScale Cloud Pricing Service provides all of the elements of price, and leaves the API consumers to implement the logic of using that pricing information to calculate costs. The RightScale Cloud Analytics API uses the Cloud Pricing Service API internally and combines the pricing information with usage data collected in RightScale to provide overall costs.
Modeling cloud prices
The price of an instance can be modeled as follows: the price
of a priceable_resource
has a purchase_option
and one or more usage_charges
. A price
also has an id
, start_at
, end_at
(for historic prices) and may also have one or more fixed_charges
or adjustments
:
-
price
has an ID and timestampsid: 123 start_at: 2015-10-01 00:00:00 UTC end_at: null (i.e. the price is currently valid)
-
priceable_resource
describes the resource detailspriceable_resource: name: c3.large cpu_count: 2 memory: 3.75 GB local_disk_size: 32.0 GB ...
-
purchase_option
describes attributes that affect the pricepurchase_option: type: on_demand_instance or reserved_instance or preemptible... cloud: AWS US-East datacenter: us-east-1a platform: Windows platform_version: Windows Server 2012 Datacenter Edition offering_type: Partial Upfront (applicable for AWS RIs) duration: 1 year (applicable for AWS RIs) ...
-
usage_charge
describes charges that can be expressed as a simple calculation of quantity x price. Instance usage is the most common example of a usage charge.usage_charge: type: usage usage_unit: hour (minute for Google and Microsoft Azure) usage_minimum: 1 price: 0.21 price_unit: hour (useful for clouds that have billable units that differ from the price unit, e.g. Google charges per minute, but lists prices as dollars per hour. So it would have the price_unit set to hour and usage_unit set to minute. currency: USD ...
-
fixed_charge
describes one-time or recurring charges that are independent of usage. For example, AWS Reserved Instance up-front and recurring fees.fixed_charge: name: Reserved Instance Upfront Fee frequency: once price: 920 currency: USD
-
adjustment
describes details of any charges or discounts that are not fixed and are not based on usage of a single resource. For example, Google Sustained Use Discount and AWS Reserved Instance Volume Discount.adjustment: name: Google Sustained Use Discount description: How to apply it... parameters: specific_param1: value1 specific_param2: value2
Getting started
Anyone with a free or paid RightScale account can use the Cloud Pricing Service. The following examples illustrate how you can get started using the API’s search call that accepts filters.
Compare on-demand prices across cloud vendors
This example searches for all Linux on-demand instance prices from Google, Microsoft Azure, and AWS that have 4 or 8 CPU cores.
1
2
3
4
5
curl -G https://pricing.rightscale.com/api/prices \
-H X-Api-Version:1.0 \
-H Content-Type:application/json \
-b rightscalecookies \
-d filter='{"purchase_option_type":["on_demand_instance"],"public_cloud_vendor_name":["Google","Microsoft%20Azure","Amazon%20Web%20Services"],"cpu_count":[4,8],"platform":["Linux/UNIX"]}'
Compare purchases options for AWS Reserved Instances
This example searches for all Reserved Instance prices for AWS c3.large and c3.xlarge Linux instances in the US-East region.
1
2
3
4
5
curl -G https://pricing.rightscale.com/api/prices \
-H X-Api-Version:1.0 \
-H Content-Type:application/json \
-b rightscalecookies \
-d filter='{"resource_name":["c3.large","c3.xlarge"],"platform":["Linux/UNIX"],"purchase_option_type":["reserved_instance_offering"],"cloud_href":["/api/clouds/1"]}'
Get the price of specific resources
This example searches for the on-demand price of the Google n1-highmem-8 Red Hat Enterprise Linux instance in the us-central1-b datacenter.
1
2
3
4
5
curl -G https://pricing.rightscale.com/api/prices \
-H X-Api-Version:1.0 \
-H Content-Type:application/json \
-b rightscalecookies \
-d filter='{"resource_name":["n1-highmem-8"],"platform_version":["Red%20Hat%20Enterprise%20Linux"],"purchase_option_type":["on_demand_instance"],"datacenter_name":["us-central1-b"]}'
Checkout the API docs to learn more. We’d be happy to hear your feedback and feel free to jump into our public #cloud-analytics chat if you need help. You can also use the RightScale Cloud Analytics Scenario Builder (shown below) to explore and compare cloud prices.