...

AZCOST1A: Estimating Azure Cost

This lab is part of a series of 3 labs regarding the Understanding and Optimizing Azure Cost.

  1. In this lab, we will guide you through the process of creating estimate using the Azure Pricing Calculator and the pricing details page. You should see a few difference in the result.
  2. In the lab 1b, we will guide you through the process of monitoring and tracking your Azure cost, focusing on the Azure Cost Management and Billing Tool. Furthermore we will use the details of this tool to help you gain a deeper understanding of the charge, which will help you create more detailed estimates going forwad.
  3. In the last lab, we will discuss actual cost optimization.

Sample solution

Throughout the lab serie, we will use a web application Fenidu as a sample solution.

Fenidu is a real solution build by Draphony but in this lab, we just misused the naming for a fictional application that allows the user to:

  1. Upload images to a cloud storage.
  2. Search for uploaded images
  3. Creating variations of the images.
  4. Fenidu is an intranet application hosted in Central India, only accessible within the restricted network.
  5. Users access from West Europe via a virtual machine, that is called azu-dx-bastion.

Assumptions:

  1. 2M MAU (monthly active user)
  2. 3 requests per day per MAU. (take 30 days for a month)
  3. Traffic West Europe to Central India (Bastion to App, App to Bastion):
    • Incoming requests are approximately 1 MB in average (consider, that some will upload images which increase the average size!)
    • Outgoing responses are approximately 9 MB on average (combining multiple AJAX, CSS and JS).
  4. Traffic Central India to Central India (App to DB, DB to App):
    • Requests to the DB are 0,1MB on average
    • Response to the API is 0.6MB on average
  5. Private Link (Central India )
    • Outgoing responses are approximately 7.5 MB on average
    • Incoming requests are approximately 0.15 MB on average
  6. Private Link ( West Europe )
    • Outgoing responses are approximately 3.25 MB on average
    • Incoming requests are approximately 0.1 MB on average

We have created a simplified Azure infrastructure for Fenidu. The calculation also does not consider all resources in the estimations, tracking and optimizations. It is not the main focus, that you understand the technical design nor the features of Fenidu. It is just for learning purpose.

Exercise 1: Estimate with the Azure Pricing Calculator

The Azure Pricing Calculator is free to use tool provided by Microsoft to help you create estimates for your Azure resources. If you login, you can even save and export your estimates. You can even share it so that other can take it as a base allowing you to create a base template for others to use. The Azure Pricing calculator even consider Azure pricing agreements if your account have access to it.

In this exercise, the key focus is to guide you through the process of creating an estimation for an „entire“ Azure solution. We will provide additional background information for the Azure resources.

Task 1: Identifying the resources solution

Assignment 1: Discuss within your Team, which the Azure resources like 4 virtual machine, 4 managed disk, and so on is required to run Fenidu based on the image above.

Your team will receive 5 points for each resource. You will receive a 5 bonus points in total if you can also a short purpose description for each resource. This is very realatively tough as this is usually done by an Azure Architect.

Your Team will get 1 point for each correct resource.

Task 2: Calculate the costs for the first virtual machine

Let’s add our first resource in the Pricing calculator

  1. Go to Pricing Calculator | Microsoft Azure
  2. Click on Virtual Machines
    • Italian Trulli
  3. Scroll down, and as you can see, Your Estimate
    • lab1
  4. Rename Your Estimate to Virtual Machines (Compute for your frontend)
    • Italian Trulli
  5. Edit your estimate with the following settings:
    1. Region: India Central
    2. Operating System: Linux
    3. Instance: VM-Size: D4s_v4, (4 CPU,16GB)
    4. Virtual machines: 1 (1 Month)
    5. Tier: Standard
    6. Type: Ubuntu
    7. Savings Options: Pay as you go
      • Hint:
        • Savings plan: requires a spending commitment, but you can change VM types and regions.
        • Reservations: You cannot change the VM type after reserving.
  6. Result: $147.46

Task 3: Adding the remaining virtual machines

Assigment 1: Add the remaining virtual machines in your estimations with the correct configurations.

Your Team will get 1 point for each correct resource.

Task 4: Adding the (required) managed disks for the virtual machines

An Azure Virtual Machine is a virtualization of compute and RAM but you will need to have storage to persist your data and code. Also, each VM has at least 1 OS Disk and could have 0 to many data disks. It is quite similiar to your physical PC. So we need to (manually) add a managed disk for our virtual machine.

Hint: there are many other components that will be created as part of the virtual machine such as nsg, routing tables, public key, etc. but we want to focus on the key costs driver.

Let’s add the managed disks for azu-vm-dx-web-001. As you can see this is a required and actually very crucial element but the pricing calculator does not add it automatically because there are cases where you don’t have a disk associated but this also leads to potential risks, that you miss important parts:

Assigment 1: Discuss the different configurations of the component and add the managed disks to your estimations as you have multiple virtual machines.

Your Team will get 1 point for each correct resource.

Task 5: Adding the (required) virtual networks for the virtual machines

Similiar to the managed disk and even stricter, a virtual machine cannot exists without a virtual network. This bond cannot be broken unless you recreate the virtual machine.

2 virtual machines can communicate without charge, if they belongs to the same virtual network. In that case you actually do not need to add the virtual network. In any other case, you have to create a peering and the traffic will be charged depending on the regions of both network.

Assigment 1: Discuss the different configurations of the component and add the virtual networks to your estimations as you have multiple virtual machines.

Your Team will get 1 point for each correct resource and an addition 0,5 point for the correct configuration.

Task 6: Adding remaining resources

Assigment 1: Discuss the different configurations of the component and add them to your estimations as you have multiple virtual machines.

Your Team will get 1 point for each correct resource and an addition 0,5 point for the correct configuration.

Exercise 2: Estimate with the Azure Pricing Details Pages

Now let’s recalculate the Fenidu solutions using the respective pricing pages for each indivual Azure resources to see how the Azure Pricing Calculator’s result will differ from our manual result. Are there relevant hidden costs , that has not been considered?

This procedure is pretty tough and therefore, we will guide you through this part.

Task 1: Virtual Machines Pricing

Let’s start with the frontend virtual machine azu-vm-dx-web-001 again.

  1. Go to https://azure.microsoft.com/en-us/pricing/details/virtual-machines/linux/#pricing
  2. Choose Central India
    • img
  3. Searching D4s v4 Instance
    • img
  4. You can see Pay as you go takes $147.4600/month, the results is $147.46

You can do the same with Virtual Machines (Compute for your api) and Virtual Machines (Compute for your database).

Task 2: Azure Managed Disk

  1. Go to https://azure.microsoft.com/en-us/pricing/details/managed-disks/
  2. Choose LRS as Redundancy and Central India as a Region.
    • img
  3. Pay attention
    • img
  4. Disk Capacity Cost (Premium SSD – LRS):
    • P30 = 1024 GB
    • Unit price: $0.01971/GB/Month
    • cost: 1024 x 0.01971 = $20.18144/month
  5. P30 Reservation Cost: $135.17/month
  6. On-demand Bursting Enablement Fee: $34.406/month
  7. Burst Transaction Fee (if bursting is used):
    • Example: Bursting from 5,000 to 30,000 IOPS for 5 seconds → additional 125,000 IOs
    • Fee: $0.007 per 10,000 IOs
    • cost : (125,000/10,000 ) ×0.007 = $0.0875
  8. The result is : 20.18144+135.17+34.406+0.0875 = $189.84/month

Task 3: Virtual Network pricing

  1. Go to https://azure.microsoft.com/en-us/pricing/details/virtual-network/
  2. Choose Central India as a Region.
    • img
  3. You can see here we have VNET Peering within the same region and Global VNET Peering
    • img
  4. If your Region is different (eg: Central India <=> West Europe) so you will use Global VNET Peering to calculate
    • Zone 1—Australia Central, Australia Central 2, Canada Central, Canada East, Central US, East US, East US 2, France Central, France South, Germany North, Germany West Central, North Central US, North Europe, Norway East, Norway West, South Central US, Switzerland North, Switzerland West, UK South, UK West, West Central US, West Europe, West US, West US 2
    • Zone 2—Australia East, Australia Southeast, Central India, East Asia, Japan East, Japan West, Korea Central, Korea South, Southeast Asia, South India, West India
    • Zone 3—Brazil South, South Africa North, South Africa West, UAE Central, UAE North
    • US Gov—US Gov Arizona, US Gov Texas, US Gov Virginia
  5. With the conditions from 1.3.1 we have the following formula:
    • CI => WE: 5000GB x 0.09(Central India) + 5000GB x 0.035(West Europe) = $625
    • WE => CI : 10GB x 0.035 + 10GB x 0.09 = $1.25
  6. The result is $626.25
  7. If your Region is the same ( eg: Central India <=> *Central India* ) so you will use VNET Peering within the same region to calculate
  8. With the conditions from 1.3.2 we have the following formula:
    • 5000(0.01 + 0.01) = 100
    • 10(0.01 + 0.01) = 0.2
  9. The result is $100.2

Conclusion

The Azure Pricing Tool is a easy to use tool and enable user to quickly create estimates. It also helps to consider certain cost aspect of the resources during the estimation process. Unfortunately, not all of it. It does not hint nor automatically add all dependent resources that is needed so that you might miss a few in your calculations.

As it is designed on a resource listing based, there is a certain temptation to miss certain charges. As we have discussed during the session, in Azure, you can classify the costs in 4 categories: provisioning costs, storage costs, traffic costs and operation costs. So for each resource or the entire solution you could list and ask the team to share those costs per category. If we take Fenidu as sample, you could thing of the 4 categories as follow:

  1. The provisioning costs are quite close to listing all required resources and their respective SKU. You are charged for making the service is available regardless whether no one use or half of world’s population does. You could also say availability charge.
  2. There is the traffic charge for the picture to arrive at your service as data has to be transfered from the user’s machine to your Facebook servers. This is the Traffic-costs.
  3. After writing the photo on the disk, you will be charge because this picture consumes storage on hard disks. This is the Storage-costs.
  4. On top of that, because the user upload a picture, you will be charge for this particular user action (Operation-costs).

This is neither perfect but will help you discovering additional charges. You may want to apply both. First adding the resources and then applying the categories.

Authors

  • Azure

Newsletter zu Aktionen

Trage dich ein um keine Aktionen von uns zu verpassen.
Wir senden 1-2 E-Mails pro Quartal.