EMEA A&C CCOE Partner Technology Cloud Engineering

How to be in control of your Oracle Cloud Infrastructure costs

Sebastien DEMANCHE
Cloud Engineer A&C

It's critical for organizations to track spending, especially for services with consumption-based billing like Oracle Cloud Infrastructure. Analysis, Budgets, and Usage Reports suite of tools  help customers understand spending patterns, monitor consumption, analyze their bill, and, ultimately, reduce spending. Oracle Partners are frequently responsible for the administration and management of Oracle Cloud Infrastructure Environments, either on behalf of their customers or for their own use. During this post, we would like to address a few of the options currently available and how these should be used to effectively be on top of things.

With the Oracle Best Practices Framework for OCI, Oracle recommends a set of best practices to design and operate cloud topologies that deliver the maximum business value, organized under four business goals:

  • Security and compliance: Secure and protect your systems and information assets in the cloud.
  • Reliability and resilience: Build reliable applications by architecting resilient cloud infrastructure.
  • Performance and cost optimization: Utilize infrastructure resources efficiently, and derive the best performance at the lowest cost.
  • Operational efficiency: Operate and monitor your applications and infrastructure resources to deliver the maximum business value.

Going forward we will focus on tracking and managing usage and cost, as detailed under Best practices for optimizing the performance and cost of cloud resources, starting of with the suggestion to carefully consider policies and mechanisms in your OCI tenancy, that are specifically available to make sure that appropriate costs are incurred while objectives are achieved. Compartments, Groups and Policies, Cost Tracking Tags, and Budgets are only some of the available mechanisms you need to be clear about.

Understand Spending Patterns

Oracle Cloud Credits allow you to get benefit from Oracle Cloud Infrastructure services and you need to know where they are being spent as regards to your commitment amount. With the Cost Analysis dashboard you can view your spending by service or by department (using the compartments and cost tracking tag). Use trend lines to understand how spending patterns are changing and where to focus cost reduction efforts. For more information, see the documentation.

Cost-Analysis dashboard


Controlling Spend with Budgets

A budget can be used to set soft limits on your Oracle Cloud Infrastructure spending. You can set alerts on your budget to let you know when you might exceed your budget, and you can view all of your budgets and spending from one single place in the Oracle Cloud Infrastructure console. Budgets are managed by compartments and tags which allow you to get a very precise point of view of your spending. Set up actionable email alerts at important thresholds to keep the right people informed and direct them to take action before overages are incurred. For more information, see the documentation.

Have a overall view of your budgets


Analyze Your Cloud Bill with Usage Reports

Cloud Administrator/Cloud Architect want to check & track the usage and billing of the Cloud resources they use for their day-to-day business goals.The reports contain one record per resource (for example, and instance, DB system, or Object Storage bucket) per hour with metadata and tags.

The usage reports provide transparency into how the billing system works. For example, you can see how and where rounding occurs, and how resources that existed for less than an hour are billed.

You can download usage reports through the web-based console or by using APIs. For more information, see the documentation.

Manage the instances to control the billing

When you choose to create a compute instance on OCI console, you will actually pay not only for the OCPU you are allocating, but also for the storage (Block Volume and Object Storage for backups) and Networking (Outbound Data Transfer).  However, when talking about the OCPU, the configuration names that are given are not trivial to correlate with the shape you use. Indeed for both VM and bare metal instances, billing depends on the shape that you use to create the instance.

To manage the lifecycle state of the instances in an instance pool, use these APIs operations:

You can also execute scripts which will stop instances attached to specified compartment IDs and/or tags to avoid overcharging. In this perspective scripts can be launched manually or automatically (with an additional scheduler tool).

Example of Python commands to stop running instances

stop_compute_instances(config, signer, target_compartments, tagdata)
stop_autonomous_dbs(config, signer, target_compartments, tagdata)
stop_database_systems(config, signer, target_compartments, tagdata)

You can find the python scripts on my personal Github page

We remain available for assisting EMEA Partners make the most out of your cloud environments and guide you through the process of setting up your cloud environments.
Make sure to check out our upcoming Partner Webcasts and Workshops across EMEA for more information.


Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.