Capacity Reservations - List By Capacity Reservation Group

Lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink property in the response to get the next page of capacity reservations.

GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations?api-version=2024-03-01

URI Parameters

Name In Required Type Description
capacityReservationGroupName
path True

string

The name of the capacity reservation group.

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.

api-version
query True

string

Client Api Version.

Responses

Name Type Description
200 OK

CapacityReservationListResult

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

List capacity reservations in reservation group.

Sample Request

GET https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/capacityReservationGroups/myCapacityReservationGroup/capacityReservations?api-version=2024-03-01

Sample Response

{
  "value": [
    {
      "name": "{capacityReservationName}",
      "id": "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/CapacityReservation/{capacityReservationName}",
      "type": "Microsoft.Compute/CapacityReservations",
      "location": "West US",
      "properties": {
        "platformFaultDomainCount": 3,
        "reservationId": "{GUID}",
        "provisioningTime": "2021-06-27T01:02:38.3138469+00:00",
        "virtualMachinesAssociated": [
          {
            "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM1"
          },
          {
            "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM2"
          },
          {
            "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM3"
          }
        ],
        "provisioningState": "Succeeded"
      },
      "tags": {
        "department": "HR"
      },
      "sku": {
        "name": "Standard_DS1_v2",
        "capacity": 4
      },
      "zones": [
        "1"
      ]
    },
    {
      "name": "{capacityReservationName}",
      "id": "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/CapacityReservation/{capacityReservationName}",
      "type": "Microsoft.Compute/CapacityReservations",
      "location": "West US",
      "properties": {
        "platformFaultDomainCount": 3,
        "reservationId": "{GUID}",
        "provisioningTime": "2021-06-27T01:02:38.3138469+00:00",
        "virtualMachinesAssociated": [
          {
            "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM4"
          }
        ],
        "provisioningState": "Succeeded"
      },
      "tags": {
        "department": "HR"
      },
      "sku": {
        "name": "Standard_A1_v2",
        "capacity": 4
      },
      "zones": [
        "1"
      ]
    }
  ]
}

Definitions

Name Description
ApiError

Api error.

ApiErrorBase

Api error base.

CapacityReservation

Specifies information about the capacity reservation.

CapacityReservationInstanceView

The instance view of a capacity reservation that provides as snapshot of the runtime properties of the capacity reservation that is managed by the platform and can change outside of control plane operations.

CapacityReservationListResult

The list capacity reservation operation response.

CapacityReservationUtilization

Represents the capacity reservation utilization in terms of resources allocated.

CloudError

An error response from the Compute service.

InnerError

Inner error details.

InstanceViewStatus

Instance view status.

Sku

Describes a virtual machine scale set sku. NOTE: If the new VM SKU is not supported on the hardware the scale set is currently on, you need to deallocate the VMs in the scale set before you modify the SKU name.

StatusLevelTypes

The level code.

SubResourceReadOnly

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.

CapacityReservation

Specifies information about the capacity reservation.

Name Type Description
id

string

Resource Id

location

string

Resource location

name

string

Resource name

properties.instanceView

CapacityReservationInstanceView

The Capacity reservation instance view.

properties.platformFaultDomainCount

integer

Specifies the value of fault domain count that Capacity Reservation supports for requested VM size. Note: The fault domain count specified for a resource (like virtual machines scale set) must be less than or equal to this value if it deploys using capacity reservation. Minimum api-version: 2022-08-01.

properties.provisioningState

string

The provisioning state, which only appears in the response.

properties.provisioningTime

string

The date time when the capacity reservation was last updated.

properties.reservationId

string

A unique id generated and assigned to the capacity reservation by the platform which does not change throughout the lifetime of the resource.

properties.timeCreated

string

Specifies the time at which the Capacity Reservation resource was created. Minimum api-version: 2021-11-01.

properties.virtualMachinesAssociated

SubResourceReadOnly[]

A list of all virtual machine resource ids that are associated with the capacity reservation.

sku

Sku

SKU of the resource for which capacity needs be reserved. The SKU name and capacity is required to be set. Currently VM Skus with the capability called 'CapacityReservationSupported' set to true are supported. Refer to List Microsoft.Compute SKUs in a region (https://docs.microsoft.com/rest/api/compute/resourceskus/list) for supported values.

tags

object

Resource tags

type

string

Resource type

zones

string[]

Availability Zone to use for this capacity reservation. The zone has to be single value and also should be part for the list of zones specified during the capacity reservation group creation. The zone can be assigned only during creation. If not provided, the reservation supports only non-zonal deployments. If provided, enforces VM/VMSS using this capacity reservation to be in same zone.

CapacityReservationInstanceView

The instance view of a capacity reservation that provides as snapshot of the runtime properties of the capacity reservation that is managed by the platform and can change outside of control plane operations.

Name Type Description
statuses

InstanceViewStatus[]

The resource status information.

utilizationInfo

CapacityReservationUtilization

Unutilized capacity of the capacity reservation.

CapacityReservationListResult

The list capacity reservation operation response.

Name Type Description
nextLink

string

The URI to fetch the next page of capacity reservations. Call ListNext() with this URI to fetch the next page of capacity reservations.

value

CapacityReservation[]

The list of capacity reservations

CapacityReservationUtilization

Represents the capacity reservation utilization in terms of resources allocated.

Name Type Description
currentCapacity

integer

The value provides the current capacity of the VM size which was reserved successfully and for which the customer is getting billed. Minimum api-version: 2022-08-01.

virtualMachinesAllocated

SubResourceReadOnly[]

A list of all virtual machines resource ids allocated against the capacity reservation.

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.

InstanceViewStatus

Instance view status.

Name Type Description
code

string

The status code.

displayStatus

string

The short localizable label for the status.

level

StatusLevelTypes

The level code.

message

string

The detailed status message, including for alerts and error messages.

time

string

The time of the status.

Sku

Describes a virtual machine scale set sku. NOTE: If the new VM SKU is not supported on the hardware the scale set is currently on, you need to deallocate the VMs in the scale set before you modify the SKU name.

Name Type Description
capacity

integer

Specifies the number of virtual machines in the scale set.

name

string

The sku name.

tier

string

Specifies the tier of virtual machines in a scale set.

Possible Values:

Standard

Basic

StatusLevelTypes

The level code.

Name Type Description
Error

string

Info

string

Warning

string

SubResourceReadOnly

Name Type Description
id

string

Resource Id