Instance types in amazon ec2


    In this article I will talk about three types of instances in 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 data about saving payments on reserved instances in RuNet. A lot of screenshots for a better understanding, when I started working with amazon I really missed it.


    There are three types of instances in amazon ec2:
    • On demand instances
    • Spot requests (Instances on free resources)
    • Reserved instances (in fact, they are not instance, but a discount on On demand instances when ordering for a long term)


    On demand instances


    They are ordinary xen virtual machines with paravirtualization for linux and hvm for windows. They are created almost the same as in the Russian services of selectel, clodo, scalaxy. You can use ready-made images with Linux to run, or you can create your own, a bunch of images from the gent to licensed windows. They have a fixed ram and a processor limit in ECU (elastic cloud unit). Paid for a fixed amount of running hours. We look at the cost of an hour for different Instances capacities here , and the monthly costs can be calculated in a company calculator .

    Choosing ami to create instance (the main preset from amazon is built with rhel6).


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


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


    Well, that’s all about the amazon core cloud product.

    Spot requests


    These are instances with a floating payment, the payment depends on the availability of resources in amazon data centers and floats by time and instance availability zone.
    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 there is no 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 since no region is selected, you can also set the maximum price that you are willing to pay for instance (if the price in this region is higher than your maximum, your instance will be down).


    With the selected region, the price is fixed


    Reserved instances


    In general, instance is not as such. It is a discount on long-term rental 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 in a non-100 haircut (this is the reserverd instance). If I walk every month I will save 12 * 100-12 * 100 * 50% -300 = 300 rubles a year, if I walk every two months I will save nothing 6 * 100-6 * 100 * 50% -300 = 0 rubles, if I go down three times a year I will be at a loss of 3 * 100-3 * 100 * 50% -300 = -150.
    Acquiring reserved instances is beneficial when you are sure that your on demand instance will be running for a long time, the discount does not apply to spot requests.

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

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


    I have two m1.small instances running here is an example from billing how they are charged (one with a Medium Utilization discount, the second without)


    Use reserved instances is beneficial for prolonged use of amazon ec2. I also note for the discount you need to buy for each launched on demand instances, do not forget to indicate the correct power of your instances and availability zone.

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

    Ask questions, if you need more screenshots, write, if you read to the end, plus.
    If you need help with migration to Amazon, write in the comments or email elektrichestvonsk@gmail.com

    Also popular now: