Compartilhar via


Virtual Machines - List Available Sizes

Lists all available virtual machine sizes to which the specified virtual machine can be resized.

GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/vmSizes?api-version=2024-07-01

URI Parameters

Name In Required Type Description
resourceGroupName
path True

string

The name of the resource group.

subscriptionId
path True

string

Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.

vmName
path True

string

The name of the virtual machine.

api-version
query True

string

Client Api Version.

Responses

Name Type Description
200 OK

VirtualMachineSizeListResult

OK

Other Status Codes

CloudError

Error response describing why the operation failed.

Security

azure_auth

Azure Active Directory OAuth2 Flow

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation impersonate your user account

Examples

Lists all available virtual machine sizes to which the specified virtual machine can be resized

Sample request

GET https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVmName/vmSizes?api-version=2024-07-01

Sample response

{
  "value": [
    {
      "name": "Standard_A1_V2",
      "numberOfCores": 1,
      "osDiskSizeInMB": 1047552,
      "resourceDiskSizeInMB": 10240,
      "memoryInMB": 2048,
      "maxDataDiskCount": 2
    },
    {
      "name": "Standard_A2_V2",
      "numberOfCores": 2,
      "osDiskSizeInMB": 1047552,
      "resourceDiskSizeInMB": 20480,
      "memoryInMB": 4096,
      "maxDataDiskCount": 4
    }
  ]
}

Definitions

Name Description
ApiError

Api error.

ApiErrorBase

Api error base.

CloudError

An error response from the Compute service.

InnerError

Inner error details.

VirtualMachineSize

The list of virtual machine sizes.

VirtualMachineSizeListResult

The List Virtual Machine operation response.

ApiError

Api error.

Name Type Description
code

string

The error code.

details

ApiErrorBase[]

The Api error details

innererror

InnerError

The Api inner error

message

string

The error message.

target

string

The target of the particular error.

ApiErrorBase

Api error base.

Name Type Description
code

string

The error code.

message

string

The error message.

target

string

The target of the particular error.

CloudError

An error response from the Compute service.

Name Type Description
error

ApiError

Api error.

InnerError

Inner error details.

Name Type Description
errordetail

string

The internal error message or exception dump.

exceptiontype

string

The exception type.

VirtualMachineSize

The list of virtual machine sizes.

Name Type Description
maxDataDiskCount

integer

The maximum number of data disks that can be attached to the virtual machine size.

memoryInMB

integer

The amount of memory, in MB, supported by the virtual machine size.

name

string

The name of the virtual machine size.

numberOfCores

integer

The number of cores supported by the virtual machine size. For Constrained vCPU capable VM sizes, this number represents the total vCPUs of quota that the VM uses. For accurate vCPU count, please refer to https://docs.microsoft.com/azure/virtual-machines/constrained-vcpu or https://docs.microsoft.com/rest/api/compute/resourceskus/list

osDiskSizeInMB

integer

The OS disk size, in MB, allowed by the virtual machine size.

resourceDiskSizeInMB

integer

The resource disk size, in MB, allowed by the virtual machine size.

VirtualMachineSizeListResult

The List Virtual Machine operation response.

Name Type Description
value

VirtualMachineSize[]

The list of virtual machine sizes.