Azure VM | increase/decrease RAM dinamically

Mels Tovmasyan 21 Reputation points
2021-12-30T10:26:41.627+00:00

Hi dear forum members.

Is there a way to choose a VM or other service in Azure to dinamically add memory in case of extra load?

I am going to deploy a small VM in Azure which will act as a SQL Server. And I don't need too much memory because it will be loaded only while downloading a reports from DB. So basically I am looking for the cheapest possible solution, as the machine will be idle 90 % of the time.

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,156 questions
Hyper-V
Hyper-V
A Windows technology providing a hypervisor-based virtualization solution enabling customers to consolidate workloads onto a single server.
2,545 questions
Azure Virtual Machine Scale Sets
Azure Virtual Machine Scale Sets
Azure compute resources that are used to create and manage groups of heterogeneous load-balanced virtual machines.
348 questions
0 comments No comments
{count} votes

Accepted answer
  1. Andriy Bilous 10,976 Reputation points MVP
    2021-12-30T18:56:34.69+00:00

    Hello @Mels Tovmasyan

    Infortunately Azure does not support dynamic RAM increase. You can increase RAM or CPU only when Azure VM is in Stopped state.

    You may save up to 60% by reserving your VM for 1Y or 3Y.
    https://learn.microsoft.com/en-us/azure/cost-management-billing/manage/understand-vm-reservation-charges

    Also you can use Azure SQL PaaS solution that could cheaper.
    https://learn.microsoft.com/en-us/azure/azure-sql/

    2 people found this answer helpful.
    0 comments No comments

4 additional answers

Sort by: Most helpful
  1. Ravi Kanth Koppala 3,231 Reputation points Microsoft Employee
    2021-12-31T05:34:54.837+00:00

    Hello @Mels Tovmasyan ,
    As @Andriy Bilous suggested, Azure doesn't support increasing the RAM & CPU dynamically. The changes only affect if the VM gets restarted. My recommendation steps include

    1. Using the Azure Portal
    2. Make sure to Turn off VM first
    3. Open the Azure portal.
    4. Open the page for the virtual machine.
    5. In the left menu, select Size.
    6. Pick a new size from the list of available sizes and then select Resize.

    Note: If the virtual machine is currently running, changing its size will cause it to be restarted. Stopping the virtual machine may reveal additional sizes.

    If the server downtime is applicable, the alternative option is to create a PowerShell script to automate the VM RAM increase/decrease process. Before the job run (or processing of the report), increase the RAM, post-process downgrade the RAM/CPU,

    Please suggest if I can help you in this case. If the reply was helpful please don't forget to upvote and/or accept as the answer, thank you

    4 people found this answer helpful.
    0 comments No comments

  2. Limitless Technology 39,366 Reputation points
    2021-12-31T10:13:19.073+00:00

    Hello MelsTovmasyan,

    Yes this is possible with Azure VMs in different aspects: memory, storage, network, etc... it is referred as AutoScale.

    You can read a bit more about the functionality here: https://learn.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-autoscale-overview

    And this blog article, contains a bit more detailed technical background for the service: https://azure.microsoft.com/en-us/blog/virtual-machine-memory-allocation-and-placement-on-azure-stack/

    -----------------------------------------------------------------------------------------------------------------------------------------------------

    --If the reply is helpful, please Upvote and Accept as answer--

    1 person found this answer helpful.
    0 comments No comments

  3. Andreas Baumgarten 96,926 Reputation points MVP
    2021-12-31T10:56:52.04+00:00

    Hi @Limitless Technology ,

    AutoScale with Azure Virtual Machine Scale Sets only works for services which are able to split the workload on different VM instances within a Scale Set.
    Even if it's possible with MS SQL Server it doesn't make any sense to spin up another SQL Server VM instance or using a SQL Server cluster in this scenario.

    The best options for this requirement are already provided by @RaviKanth-5629 and @Andriy Bilous .

    • Resize the VM (manually or automated)
    • Take a look on Reserved Instances
    • Take a look on Azure SQL PaaS solution

    ----------

    (If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

    Regards
    Andreas Baumgarten

    1 person found this answer helpful.
    0 comments No comments

  4. Mels Tovmasyan 21 Reputation points
    2022-01-03T04:58:55.08+00:00

    Dear forumers,
    Thanks for your comments.

    @Andriy Bilous 's answered my question, we can close this thread.

    0 comments No comments