diff --git a/specification/compute/resource-manager/Microsoft.Compute/stable/2021-04-01/compute.json b/specification/compute/resource-manager/Microsoft.Compute/stable/2021-04-01/compute.json
index 959f7547cab3..6f2d4c0a54f0 100644
--- a/specification/compute/resource-manager/Microsoft.Compute/stable/2021-04-01/compute.json
+++ b/specification/compute/resource-manager/Microsoft.Compute/stable/2021-04-01/compute.json
@@ -5384,6 +5384,9 @@
"Create a scale set with userData.": {
"$ref": "./examples/CreateOrUpdateAScaleSetWithUserData.json"
},
+ "Create or update a scale set with capacity reservation.": {
+ "$ref": "./examples/CreateOrUpdateAScaleSetWithCapacityReservation.json"
+ },
"Create a scale set with spot restore policy": {
"$ref": "./examples/CreateAScaleSetWithSpotRestorePolicy.json"
}
@@ -10872,7 +10875,7 @@
"properties": {
"capacityReservationGroup": {
"$ref": "#/definitions/SubResource",
- "description": "Specifies the capacity reservation group resource id that should be used for allocating the virtual machine provided enough capacity has been reserved. Please refer to https://aka.ms/CapacityReservation for more details."
+ "description": "Specifies the capacity reservation group resource id that should be used for allocating the virtual machine or scaleset vm instances provided enough capacity has been reserved. Please refer to https://aka.ms/CapacityReservation for more details."
}
},
"description": "The parameters of a capacity reservation Profile."
@@ -13376,6 +13379,10 @@
"userData": {
"type": "string",
"description": "UserData for the virtual machines in the scale set, which must be base-64 encoded. Customer should not pass any secrets in here.
Minimum api-version: 2021-03-01"
+ },
+ "capacityReservation": {
+ "$ref": "#/definitions/CapacityReservationProfile",
+ "description": "Specifies the capacity reservation related details of a scale set.
Minimum api-version: 2021-04-01."
}
},
"description": "Describes a virtual machine scale set virtual machine profile."
diff --git a/specification/compute/resource-manager/Microsoft.Compute/stable/2021-04-01/examples/CreateOrUpdateAScaleSetWithCapacityReservation.json b/specification/compute/resource-manager/Microsoft.Compute/stable/2021-04-01/examples/CreateOrUpdateAScaleSetWithCapacityReservation.json
new file mode 100644
index 000000000000..28db6f9f0134
--- /dev/null
+++ b/specification/compute/resource-manager/Microsoft.Compute/stable/2021-04-01/examples/CreateOrUpdateAScaleSetWithCapacityReservation.json
@@ -0,0 +1,230 @@
+{
+ "parameters": {
+ "subscriptionId": "{subscription-id}",
+ "resourceGroupName": "myResourceGroup",
+ "vmScaleSetName": "{vmss-name}",
+ "api-version": "2021-04-01",
+ "parameters": {
+ "sku": {
+ "tier": "Standard",
+ "capacity": 3,
+ "name": "Standard_DS1_v2"
+ },
+ "location": "westus",
+ "properties": {
+ "overprovision": true,
+ "virtualMachineProfile": {
+ "storageProfile": {
+ "imageReference": {
+ "sku": "2016-Datacenter",
+ "publisher": "MicrosoftWindowsServer",
+ "version": "latest",
+ "offer": "WindowsServer"
+ },
+ "osDisk": {
+ "caching": "ReadWrite",
+ "managedDisk": {
+ "storageAccountType": "Standard_LRS"
+ },
+ "createOption": "FromImage"
+ }
+ },
+ "osProfile": {
+ "computerNamePrefix": "{vmss-name}",
+ "adminUsername": "{your-username}",
+ "adminPassword": "{your-password}"
+ },
+ "networkProfile": {
+ "networkInterfaceConfigurations": [
+ {
+ "name": "{vmss-name}",
+ "properties": {
+ "primary": true,
+ "enableIPForwarding": true,
+ "ipConfigurations": [
+ {
+ "name": "{vmss-name}",
+ "properties": {
+ "subnet": {
+ "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "capacityReservation": {
+ "capacityReservationGroup": {
+ "id": "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/CapacityReservationGroups/{crgName}"
+ }
+ }
+ },
+ "upgradePolicy": {
+ "mode": "Manual"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "sku": {
+ "tier": "Standard",
+ "capacity": 3,
+ "name": "Standard_DS1_v2"
+ },
+ "name": "{vmss-name}",
+ "properties": {
+ "singlePlacementGroup": true,
+ "overprovision": true,
+ "uniqueId": "d053ec5a-8da6-495f-ab13-38216503c6d7",
+ "virtualMachineProfile": {
+ "storageProfile": {
+ "imageReference": {
+ "sku": "2016-Datacenter",
+ "publisher": "MicrosoftWindowsServer",
+ "version": "latest",
+ "offer": "WindowsServer"
+ },
+ "osDisk": {
+ "caching": "ReadWrite",
+ "managedDisk": {
+ "storageAccountType": "Standard_LRS"
+ },
+ "createOption": "FromImage"
+ }
+ },
+ "osProfile": {
+ "computerNamePrefix": "{vmss-name}",
+ "adminUsername": "{your-username}",
+ "secrets": [],
+ "windowsConfiguration": {
+ "provisionVMAgent": true,
+ "enableAutomaticUpdates": true
+ }
+ },
+ "networkProfile": {
+ "networkInterfaceConfigurations": [
+ {
+ "name": "{vmss-name}",
+ "properties": {
+ "dnsSettings": {
+ "dnsServers": []
+ },
+ "primary": true,
+ "enableIPForwarding": true,
+ "ipConfigurations": [
+ {
+ "name": "{vmss-name}",
+ "properties": {
+ "subnet": {
+ "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
+ },
+ "privateIPAddressVersion": "IPv4"
+ }
+ }
+ ],
+ "enableAcceleratedNetworking": false
+ }
+ }
+ ]
+ },
+ "capacityReservation": {
+ "capacityReservationGroup": {
+ "id": "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/CapacityReservationGroups/{crgName}"
+ }
+ }
+ },
+ "upgradePolicy": {
+ "mode": "Manual"
+ },
+ "provisioningState": "Creating"
+ },
+ "location": "westus",
+ "type": "Microsoft.Compute/virtualMachineScaleSets",
+ "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
+ }
+ },
+ "201": {
+ "body": {
+ "sku": {
+ "tier": "Standard",
+ "capacity": 3,
+ "name": "Standard_DS1_v2"
+ },
+ "name": "{vmss-name}",
+ "properties": {
+ "singlePlacementGroup": true,
+ "overprovision": true,
+ "uniqueId": "d053ec5a-8da6-495f-ab13-38216503c6d7",
+ "virtualMachineProfile": {
+ "storageProfile": {
+ "imageReference": {
+ "sku": "2016-Datacenter",
+ "publisher": "MicrosoftWindowsServer",
+ "version": "latest",
+ "offer": "WindowsServer"
+ },
+ "osDisk": {
+ "caching": "ReadWrite",
+ "managedDisk": {
+ "storageAccountType": "Standard_LRS"
+ },
+ "createOption": "FromImage"
+ }
+ },
+ "osProfile": {
+ "computerNamePrefix": "{vmss-name}",
+ "adminUsername": "{your-username}",
+ "secrets": [],
+ "windowsConfiguration": {
+ "provisionVMAgent": true,
+ "enableAutomaticUpdates": true
+ }
+ },
+ "networkProfile": {
+ "networkInterfaceConfigurations": [
+ {
+ "name": "{vmss-name}",
+ "properties": {
+ "dnsSettings": {
+ "dnsServers": []
+ },
+ "primary": true,
+ "enableIPForwarding": true,
+ "ipConfigurations": [
+ {
+ "name": "{vmss-name}",
+ "properties": {
+ "subnet": {
+ "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
+ },
+ "privateIPAddressVersion": "IPv4"
+ }
+ }
+ ],
+ "enableAcceleratedNetworking": false
+ }
+ }
+ ]
+ },
+ "capacityReservation": {
+ "capacityReservationGroup": {
+ "id": "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/CapacityReservationGroups/{crgName}"
+ }
+ }
+ },
+ "upgradePolicy": {
+ "mode": "Manual"
+ },
+ "provisioningState": "Creating"
+ },
+ "location": "westus",
+ "type": "Microsoft.Compute/virtualMachineScaleSets",
+ "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
+ }
+ }
+ }
+}