Share via

How to adjust VM Ram size

Aleem Sheikh 0 Reputation points
2026-03-05T04:04:19.5733333+00:00

I have a vm that i would like to increase the ram amount to 8gb. How do I do this?

Details of vm:

East US (Zone 1)

Standard B2s (2 vcpus, 4 GiB memory)

Windows (Windows Server 2025 Datacenter Azure Edition)

Azure Virtual Machines
Azure Virtual Machines

An Azure service that is used to provision Windows and Linux virtual machines.

{count} votes

3 answers

Sort by: Most helpful
  1. Aleem Sheikh 0 Reputation points
    2026-03-12T13:25:23.2033333+00:00

    I opened an SR with support. They denied my request for other vms with more ram. So i just built more vms to handle the load i need. thanks,

    0 comments No comments

  2. TP 152.1K Reputation points Volunteer Moderator
    2026-03-05T04:18:52.78+00:00

    Hi,

    In order to increase RAM you will need to resize the VM to a different size. For example, navigate to the VM in Azure portal, on left click on Availability + scale -- Size, select B2ms, click Resize button. There will be several minutes of downtime minimum while the VM is resized, so you will want to perform this during scheduled maintenance or off hours.

    Please note Standard_B2s (current size, B series v1) and Standard_B2ms (possible new size) are legacy and there is limited capacity available in some Azure regions. What this means is the resize may fail due to capacity. Retrying to start the VM periodically may resolve the issue, if it occurs.

    Since B series v1 sizes are scheduled for retirement November 15, 2028, long term you will want to move to newer size eventually.

    Please click Accept Answer and upvote if the above was helpful.

    Thanks.

    -TP

    0 comments No comments

  3. Marcin Policht 82,355 Reputation points MVP Volunteer Moderator
    2026-03-05T04:13:14.6866667+00:00

    In Azure, the amount of RAM a VM has is determined by the VM size. Your current size, Standard B2s, provides 4 GiB of memory. To get 8 GiB of RAM you must resize the VM to a size that includes 8 GiB, such as Standard B2ms (2 vCPUs, 8 GiB memory) or another VM size with at least 8 GiB.

    Using the Azure Portal, go to the Azure Portal at https://portal.azure.com and open Virtual Machines. Select your VM. In the left menu choose Size. Azure will show a list of available sizes for that region and hardware cluster. Select Standard B2ms (2 vCPUs, 8 GiB memory) or another 8 GiB option and click Resize. If the resize button is disabled, stop the VM first, then select the new size and apply it. After resizing, start the VM again if you stopped it.

    Using Azure CLI you first stop the VM and then update the size.

    az vm deallocate --resource-group <RESOURCE_GROUP> --name <VM_NAME>
    
    az vm resize --resource-group <RESOURCE_GROUP> --name <VM_NAME> --size Standard_B2ms
    
    az vm start --resource-group <RESOURCE_GROUP> --name <VM_NAME>
    

    Using PowerShell the equivalent commands are:

    Stop-AzVM -ResourceGroupName <RESOURCE_GROUP> -Name <VM_NAME> -Force
    
    $vm = Get-AzVM -ResourceGroupName <RESOURCE_GROUP> -Name <VM_NAME>
    $vm.HardwareProfile.VmSize = "Standard_B2ms"
    Update-AzVM -ResourceGroupName <RESOURCE_GROUP> -VM $vm
    
    Start-AzVM -ResourceGroupName <RESOURCE_GROUP> -Name <VM_NAME>
    

    After the resize completes, the VM will have 8 GiB of RAM because the VM size has changed from B2s to B2ms. If B2ms does not appear in the size list, it means the current host cluster does not support it, and stopping/deallocating the VM will allow Azure to move it to compatible hardware during resize.


    If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.

    hth

    Marcin


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.