Mass-pricing of VMs
on Azure
based on CPU
cores count and memory. This is useful when costing a lift-and-shift migration dealing with many thousands VMS
of varied sizes.
The pricing is retrieved from Virtual Machines Pricing.
:rotating_light: This tool will only provide you with an estimation. Depending on your Azure
spend you might be able to get a better deal from Microsoft
. You should use the output of this tool as a coarse-grain estimation. On top of the VM
price you will also need to consider storage and egress costs.
This tool is composed of two components:
Parser
and a list of VM
specifications to determine their priceThis approach allows to decouple pricing acquisition from its usage and open the door to automation. The Parser
can be scheduled to retrieve the pricing at regular interval and the Coster
can then use an always up-to-date pricing.
Retrieve VMs
hourly pricing for a specific combination of culture, currency, operating system and region.
Culture | Culture display name | Currency | Currency display name | Support |
---|---|---|---|---|
en-us |
English (US) |
usd |
US Dollar ($) |
:white_check_mark: |
cs-cz |
Čeština |
eur [1] |
Euro (€) |
:white_check_mark: |
da-dk |
Dansk |
dkk |
Danish Krone (kr) |
:white_check_mark: |
de-de |
Deutsch |
eur |
Euro (€) |
:white_check_mark: |
chf [9] |
Swiss Franc. (chf) |
:white_check_mark: | ||
en-au |
English (Australia) |
aud |
Australian Dollar ($) |
:white_check_mark: |
en-ca |
English (Canada) |
cad |
Canadian Dollar ($) |
:white_check_mark: |
en-in |
English (India) |
inr |
Indian Rupee (₹) |
:white_check_mark: |
en-gb |
English (UK) |
gpb |
British Pound (£) |
:white_check_mark: |
nzd [7] |
New Zealand Dollar ($) |
:white_check_mark: | ||
es-es |
Español |
eur |
Euro (€) |
:white_check_mark: |
es-mx |
Español (MX) |
usd [3] |
US Dollar ($) |
:white_check_mark: |
fr-fr |
Français |
eur |
Euro (€) |
:white_check_mark: |
chf [9] |
Swiss Franc. (chf) |
:white_check_mark: | ||
fr-ca |
Français (Canada) |
cad |
Canadian Dollar ($) |
:white_check_mark: |
it-it |
Italiano |
eur |
Euro (€) |
:white_check_mark: |
chf [9] |
Swiss Franc. (chf) |
:white_check_mark: | ||
hu-hu |
Magyar |
eur [1] |
Euro (€) |
:white_check_mark: |
nb-no |
Norsk |
nk |
Norwegian Krone (kr) |
:white_check_mark: |
nl-nl |
Nederlands |
eur |
Euro (€) |
:white_check_mark: |
pl-pl |
Polski |
eur [1] |
Euro (€) |
:white_check_mark: |
pt-br |
Português (Brasil) |
brl |
Brazilian Real (R$) |
:white_check_mark: |
pt-pt |
Português |
eur |
Euro (€) |
:white_check_mark: |
sv-se |
Svenska |
sek |
Swedish Krona (kr) |
:white_check_mark: |
tr-tr |
Türkçe |
usd [3] |
US Dollar ($) |
:white_check_mark: |
ru-ru |
Pусский |
rub |
Russian Ruble (руб) |
:white_check_mark: |
ja-jp |
日本語 |
jpy |
Japanese Yen (¥) |
:white_check_mark: |
ko-kr |
한국어 |
krw |
Korean Won (₩) |
:white_check_mark: |
zh-cn |
中文(简体) |
N/A |
N/A |
N/A |
zh-tw |
中文(繁體) |
twd |
Taiwanese Dollar (NT$) |
:white_check_mark: |
:rotating_light: the parser is not - yet - able to retrieve pricing for the regions east-china2
, north-china2
, east-china
and north-china
as it is available on a different website.
:rotating_light: the parser is not able to retrieve pricing for the regions us-dod-central
and us-dod-east
as no virtual machines are listed as publicly available.
Scroll down for the list of supported regions and supported OS/Software.
> cd .\parser\
> yarn
> cd .\parser\
> yarn crawl --culture en-us --currency usd --operating-system linux --region us-west
You can also use short names:
> yarn crawl -l en-us -c usd -o linux -r us-west
Arguments:
culture
any of the option
value
in the Change language select
currency
any of the option
value
in the Currency select
operating-system
any of the option
value
in the OS/Software select
region
any of the option
value
in the Region select
In the footer:
Writes 2
output files in the out\
directory. One is a CSV
, the other one is JSON
. Both files contain the same data.
.\out\vm-pricing_<region>_<operating-system>.csv
.\out\vm-pricing_<region>_<operating-system>.json
Fields:
The parser has unit tests focusing on edge cases of price formatting:
> cd .\parser\
> yarn test
The end-to-end tests attempt to compare known prices for the D2 v3
instance in us-west
using permutations of supported culture
, operating-system
, and currency
:
> cd .\parser\
> yarn e2e-all
Price VMs
using the JSON
pricing files generated by the Parser
. The Coster
will select the cheapest VM
that has enough CPU
cores and RAM
.
You should paste the JSON
pricing files generated by the Parser
in the coster\src\AzureVmCoster\Pricing\
folder. Setting the culture
is only relevant when dealing with pricing and input files that were written using another culture with a different decimal point (e.g. comma vs period).
In Release
mode:
> cd .\coster\src\AzureVmCoster
> dotnet run --configuration Release -- --input <input-path> --culture <culture>
> dotnet run --configuration Release -- -i <input-path> -l <culture>
> dotnet run --configuration Release -- -i <input-path>
The culture
is optional.
In Debug
mode
> cd .\coster\src\AzureVmCoster
> dotnet run --configuration Debug
Input file path: <input-path>
Culture (leave blank for system default):
You'll need to provide the <input-path>
when prompted, the culture
is optional.
<input-path>
should point to a CSV
file with the following fields:
short
)GB
, a decimal
)The columns can be in any order and the CSV
file can contain extra-columns. The Region
and Operating System
fields must match existing regions and supported operating systems in the Virtual Machines Pricing website.
The Coster
will generate a CSV
file in the Out\
directory with the following fields:
Supported regions (newer regions might have been added after I last updated the README
, they're likely to be supported):
us-central
us-east
us-east-2
us-north-central
us-south-central
us-west-central
us-west
us-west-2
us-west-3
united-kingdom-south
united-kingdom-west
uae-central
uae-north
switzerland-north
switzerland-west
sweden-central
sweden-south
spain-central
qatar-central
poland-central
norway-east
norway-west
mexico-central
korea-central
korea-south
japan-east
japan-west
italy-north
israel-central
central-india
south-india
west-india
germany-north
germany-west-central
france-central
france-south
europe-north
europe-west
canada-central
canada-east
brazil-south
brazil-southeast
usgov-arizona
usgov-texas
usgov-virginia
australia-central
australia-central-2
australia-east
australia-southeast
asia-pacific-east
asia-pacific-southeast
south-africa-north
south-africa-west
Supported OS/Software:
linux
(Ubuntu)red-hat
(Red Hat Enterprise Linux)rhel-ha
(Red Hat Enterprise Linux with HA)rhel-sap-ha
(RHEL for SAP with HA)rhel-sap-business
(RHEL for SAP Business Applications)sles-basic
(SUSE Linux Enterprise + Patching only)sles-standard
(SUSE Linux Enterprise + 24x7 Support)sles-hpc-standard
(SUSE Linux Enterprise for HPC + 24x7 Support)sles-sap
(SUSE Linux Enterprise for SAP Applications + 24x7 Support)ubuntu-pro
(Ubuntu Pro)ubuntu-advantage-essential
(Ubuntu Advantage Essential (Support))ubuntu-advantage-standard
(Ubuntu Advantage Standard (Support))ubuntu-advantage-advanced
(Ubuntu Advantage Advanced (Support))ml-server-rhel
(Machine Learning Server on Red Hat Enterprise Linux)ml-server-ubuntu
(Machine Learning Server on Ubuntu or Centos Linux)sql-server-enterprise-linux
(SQL Server Enterprise Ubuntu Linux)sql-server-standard-linux
(SQL Server Standard Ubuntu Linux)sql-server-web-linux
(SQL Server Web Ubuntu Linux)sql-server-enterprise-redhat
(SQL Server Enterprise Red Hat Enterprise Linux)sql-server-standard-redhat
(SQL Server Standard Red Hat Enterprise Linux)sql-server-web-redhat
(SQL Server Web Red Hat Enterprise Linux)sql-server-enterprise-sles
(SQL Server Enterprise SUSE Priority)sql-server-standard-sles
(SQL Server Standard SUSE Priority)sql-server-web-sles
(SQL Server Web SUSE Priority)windows
(Windows OS)biztalk-enterprise
(BizTalk Enterprise)biztalk-standard
(BizTalk Standard)ml-server-windows
(Machine Learning Server)sharepoint
(SharePoint)sql-server-enterprise
(SQL Server Enterprise)sql-server-standard
(SQL Server Standard)sql-server-web
(SQL Server Web)01. Euro is used for countries which don't have their currency listed, are part of the European Union but not part of the Eurozone.
03. USD is used when no other currency could be matched to the country.
07. English (UK) has been selected due to the use of New Zealand English in New Zealand.
09. German, French and Italian are three of the official languages of Switzerland.