📜 ⬆️ ⬇️

Types of instance in amazon ec2


In this article, I will discuss three types of instances on Amazon with examples of costing and screenshots from the console and Amazon billing. The article was born due to the small amount of information about amazon web services, in particular, I did not find any data about saving payment for reserved instances in runet. A lot of screenshots for a better understanding when I started working with amazon I missed this much.


There are three types of instances in amazon ec2:


On demand instances


They are normal xen virtual machines with paravirtualization for linux and hvm for windows. They are created almost as well as in the Russian services selectel, clodo, scalaxy. You can use ready-made images with Linux to run or create your own, a bunch of images from Gent to licensed windows. Have a fixed ram and a limit on the processor in the ECU (elastic cloud unit). Paid for a fixed number of running hours. The cost of an hour for different power Instances we look here , and the monthly costs can be calculated in the company calculator .
')
Choosing ami to create an instance (amazon's main preset is compiled from rhel6).


If you are not satisfied with ready-made presets, you can select a classic wizard and select community ami, you can enter the desired axis in the search (centos for an example) or pre-installed software (redmine for an example).


For 32-bit systems, there are only three power instances.


Well, that's all about amazon's mostly cloudy product.

Spot requests


This instances of floating payment, payment depends on the availability of resources in data centers amazon and floats on the time and zone of availability instance.
The first thing to do when creating such an instance is to look at price history by region and time.


You can see that the us-east-1d region is the most expensive and you don’t need to create anything in it, and the us-east-1c region is the cheapest.

Here is a simple example of creating such an instance, the price is floating because no region is selected, you can also set the maximum price you are willing to pay for the instance (if the price in this region is higher than your maximum, your instance will be down).


Price is fixed with the selected region


Reserved instances


Generally not an instance per se. It is a discount for long-term lease on demand instance.
For example, I go to the hairdresser every month to get a haircut for 100 rubles. I am offered to buy a 50% discount for a year for 300 rubles (this is the reserverd instance) and pay 50 rubles per 100 rubles for a haircut (this is the reserverd instance). If I walk every month, I will save 12 * 100-12 * 100 * 50% -300 = 300 rubles per year, if I walk once in two months, I will not save anything 6 * 100-6 * 100 * 50% -300 = 0 rubles, if I go three times a year, I will be at a loss of 3 * 100-3 * 100 * 50% -300 = -150.
It is profitable to acquire reserved instances when you are sure that your on demand instance will be running for a long time, and does not apply to spot requests.

There are two tricks when buying discounts, you specify the power of the instance and the accessibility zone (in fact, the data center), if you created on demand instance in another zone or made an upgrade on resources, then the discount will not work. The second catch for the discount you pay one-time and the payment is not refunded, if you did not run the necessary instance in the desired area, alas, you spent money in vain (it's like going to the hairdresser in which you have no discount).

There are three types of reserved Light Utilization, Medium Utilization, Heavy Utilization. Each species gives a large discount on ascending and has a great value. The discount can be bought only for a fixed duration of 1 or 3 years. For m1.small Light Utilization for a year costs $ 97.50, for three years $ 150 (not three but one and a half times more expensive).
Example discount for m1.small (4ECU, 1.7gb ram)
Price per hour without discount: $ 0.085
The cost of an hour with Light Utilization (costs $ 97.50 for a year, for three $ 150): $ 0.05
Cost of an hour with Medium Utilization (costs $ 227.50 for a year, $ 350 for three): $ 0.03
Cost of an hour with Heavy Utilization (costs $ 276.25 for a year, $ 425 for three): $ 0.02
Example of creating reserved instance


I’ve run two m1.small instances. Here’s an example of billing, how they are charged (one with a discount Medium Utilization, the second without)


Using reserved instances is beneficial for long-term use of amazon ec2. Also note for the discount you need to buy for each running on demand instances, do not forget to specify the correct power of your instances and availability zones.

Another feature of Heavy Utilization is that an instance fee is always taken, even if you stopped it, if you do not plan to keep the instance running for a whole year, in no case take Heavy Utilization.

Ask questions, if you need more screenshots write, if you have read to the end, plus.
If you need help migrating to Amazon, please write in a comment or email elektrichestvonsk@gmail.com

Source: https://habr.com/ru/post/136829/


All Articles