From 59a6f77f4a9757cc42083d2fc0832db044cb5407 Mon Sep 17 00:00:00 2001 From: Raktima Das Date: Thu, 16 Dec 2021 10:56:02 -0800 Subject: [PATCH] Added vm size properties for vm scale set (#16723) * Added vm size properties * Added get examples * Added example for vm size properties * Added example for vm size properties Co-authored-by: Theodore Chang --- .../stable/2021-11-01/compute.json | 23 ++ ...OrUpdateAScaleSetWithVMSizeProperties.json | 246 ++++++++++++++++++ ...MachineScaleSetVMWithVMSizeProperties.json | 138 ++++++++++ ...GetVirtualMachineWithVMSizeProperties.json | 135 ++++++++++ 4 files changed, 542 insertions(+) create mode 100644 specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateAScaleSetWithVMSizeProperties.json create mode 100644 specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetVirtualMachineScaleSetVMWithVMSizeProperties.json create mode 100644 specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetVirtualMachineWithVMSizeProperties.json diff --git a/specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/compute.json b/specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/compute.json index 058f9c74e80f..6e4dde08d4e1 100644 --- a/specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/compute.json +++ b/specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/compute.json @@ -3629,6 +3629,9 @@ }, "Get a virtual machine placed on a dedicated host group through automatic placement": { "$ref": "./examples/compute/GetVirtualMachineAutoPlacedOnDedicatedHostGroup.json" + }, + "Get a virtual machine with VM Size Properties": { + "$ref": "./examples/compute/GetVirtualMachineWithVMSizeProperties.json" } } } @@ -5864,6 +5867,9 @@ "Create a scale set with spot restore policy": { "$ref": "./examples/compute/CreateAScaleSetWithSpotRestorePolicy.json" }, + "Create a scale set with vm size properties": { + "$ref": "./examples/compute/CreateOrUpdateAScaleSetWithVMSizeProperties.json" + }, "Create a scale set with SecurityType as ConfidentialVM": { "$ref": "./examples/compute/CreateAScaleSetWithSecurityTypeConfidentialVM.json" } @@ -8218,6 +8224,9 @@ "x-ms-examples": { "Get VM scale set VM with UserData": { "$ref": "./examples/compute/GetVirtualMachineScaleSetVMWithUserData.json" + }, + "Get VM scale set VM with VMSizeProperties": { + "$ref": "./examples/compute/GetVirtualMachineScaleSetVMWithVMSizeProperties.json" } } } @@ -11797,6 +11806,16 @@ }, "description": "Contains the list of gallery applications that should be made available to the VM/VMSS" }, + "VirtualMachineScaleSetHardwareProfile": { + "type": "object", + "properties": { + "vmSizeProperties": { + "$ref": "#/definitions/VMSizeProperties", + "description": "Specifies the properties for customizing the size of the virtual machine. Minimum api-version: 2021-11-01.

Please follow the instructions in [VM Customization](https://aka.ms/vmcustomization) for more details." + } + }, + "description": "Specifies the hardware settings for the virtual machine scale set." + }, "AdditionalCapabilities": { "properties": { "ultraSSDEnabled": { @@ -14267,6 +14286,10 @@ "applicationProfile": { "$ref": "#/definitions/ApplicationProfile", "description": "Specifies the gallery applications that should be made available to the VM/VMSS" + }, + "hardwareProfile": { + "$ref": "#/definitions/VirtualMachineScaleSetHardwareProfile", + "description": "Specifies the hardware profile related details of a scale set.

Minimum api-version: 2021-11-01." } }, "description": "Describes a virtual machine scale set virtual machine profile." diff --git a/specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateAScaleSetWithVMSizeProperties.json b/specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateAScaleSetWithVMSizeProperties.json new file mode 100644 index 000000000000..2444d2e35ccb --- /dev/null +++ b/specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateAScaleSetWithVMSizeProperties.json @@ -0,0 +1,246 @@ +{ + "parameters": { + "subscriptionId": "{subscription-id}", + "resourceGroupName": "myResourceGroup", + "vmScaleSetName": "{vmss-name}", + "api-version": "2021-11-01", + "parameters": { + "sku": { + "tier": "Standard", + "capacity": 3, + "name": "Standard_D1_v2" + }, + "location": "westus", + "properties": { + "overprovision": true, + "upgradePolicy": { + "mode": "Manual" + }, + "virtualMachineProfile": { + "storageProfile": { + "imageReference": { + "sku": "2016-Datacenter", + "publisher": "MicrosoftWindowsServer", + "version": "latest", + "offer": "WindowsServer" + }, + "osDisk": { + "caching": "ReadWrite", + "managedDisk": { + "storageAccountType": "Standard_LRS" + }, + "createOption": "FromImage" + } + }, + "userData": "RXhhbXBsZSBVc2VyRGF0YQ==", + "hardwareProfile": { + "vmSizeProperties": { + "vCPUsAvailable": 1, + "vCPUsPerCore": 1 + } + }, + "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}" + } + } + } + ] + } + } + ] + } + } + } + } + }, + "responses": { + "200": { + "body": { + "sku": { + "tier": "Standard", + "capacity": 3, + "name": "Standard_D1_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" + } + }, + "hardwareProfile": { + "vmSizeProperties": { + "vCPUsAvailable": 1, + "vCPUsPerCore": 1 + } + }, + "diagnosticsProfile": { + "bootDiagnostics": { + "storageUri": "http://nsgdiagnostic.blob.core.windows.net", + "enabled": true + } + }, + "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 + } + } + ] + } + }, + "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_D1_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" + } + }, + "hardwareProfile": { + "vmSizeProperties": { + "vCPUsAvailable": 1, + "vCPUsPerCore": 1 + } + }, + "diagnosticsProfile": { + "bootDiagnostics": { + "storageUri": "http://nsgdiagnostic.blob.core.windows.net", + "enabled": true + } + }, + "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 + } + } + ] + } + }, + "upgradePolicy": { + "mode": "Manual" + }, + "provisioningState": "Creating" + }, + "location": "westus", + "type": "Microsoft.Compute/virtualMachineScaleSets", + "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}" + } + } + } +} diff --git a/specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetVirtualMachineScaleSetVMWithVMSizeProperties.json b/specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetVirtualMachineScaleSetVMWithVMSizeProperties.json new file mode 100644 index 000000000000..cd6e7581ca7b --- /dev/null +++ b/specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetVirtualMachineScaleSetVMWithVMSizeProperties.json @@ -0,0 +1,138 @@ +{ + "parameters": { + "subscriptionId": "{subscription-id}", + "resourceGroupName": "myResourceGroup", + "vmScaleSetName": "{vmss-name}", + "instanceId": "0", + "api-version": "2021-11-01", + "expand": "UserData" + }, + "responses": { + "200": { + "body": { + "name": "{vmss-vm-name}", + "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}/virtualMachines/0", + "type": "Microsoft.Compute/virtualMachines", + "location": "westus", + "tags": { + "myTag1": "tagValue1" + }, + "properties": { + "latestModelApplied": true, + "modelDefinitionApplied": "VirtualMachineScaleSet", + "networkProfileConfiguration": { + "networkInterfaceConfigurations": [ + { + "name": "vmsstestnetconfig5415", + "properties": { + "primary": true, + "enableAcceleratedNetworking": false, + "dnsSettings": { + "dnsServers": [] + }, + "enableIPForwarding": false, + "ipConfigurations": [ + { + "name": "vmsstestnetconfig9693", + "properties": { + "subnet": { + "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/vn4071/subnets/sn5503" + }, + "privateIPAddressVersion": "IPv4" + } + } + ] + } + } + ] + }, + "vmId": "42af9fdf-b906-4ad7-9905-8316209ff619", + "hardwareProfile": { + "vmSizeProperties": { + "vCPUsAvailable": 1, + "vCPUsPerCore": 1 + } + }, + "storageProfile": { + "imageReference": { + "publisher": "MicrosoftWindowsServer", + "offer": "WindowsServer", + "sku": "2012-R2-Datacenter", + "version": "4.127.20180315", + "exactVersion": "4.127.20180315" + }, + "osDisk": { + "osType": "Windows", + "name": "vmss3176_vmss3176_0_OsDisk_1_6d72b805e50e4de6830303c5055077fc", + "createOption": "FromImage", + "caching": "None", + "managedDisk": { + "storageAccountType": "Standard_LRS", + "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_OsDisk_1_6d72b805e50e4de6830303c5055077fc" + }, + "diskSizeGB": 127 + }, + "dataDisks": [ + { + "lun": 1, + "name": "vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d", + "createOption": "Empty", + "caching": "None", + "managedDisk": { + "storageAccountType": "Standard_LRS", + "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d" + }, + "diskSizeGB": 128, + "toBeDetached": false + } + ] + }, + "osProfile": { + "computerName": "test000000", + "adminUsername": "Foo12", + "windowsConfiguration": { + "provisionVMAgent": true, + "enableAutomaticUpdates": true + }, + "secrets": [], + "allowExtensionOperations": true, + "requireGuestProvisionSignal": true + }, + "userData": "RXhhbXBsZSBVc2VyRGF0YQ==", + "networkProfile": { + "networkInterfaces": [ + { + "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}/virtualMachines/0/networkInterfaces/vmsstestnetconfig5415" + } + ] + }, + "diagnosticsProfile": { + "bootDiagnostics": { + "enabled": true + } + }, + "provisioningState": "Succeeded" + }, + "resources": [ + { + "name": "CustomScriptExtension-DSC", + "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM/extensions/CustomScriptExtension-DSC", + "type": "Microsoft.Compute/virtualMachines/extensions", + "location": "westus", + "tags": { + "displayName": "CustomScriptExtension-DSC" + }, + "properties": { + "autoUpgradeMinorVersion": true, + "provisioningState": "Succeeded", + "publisher": "Microsoft.Compute", + "type": "CustomScriptExtension", + "typeHandlerVersion": "1.9", + "settings": {} + } + } + ] + } + } + } +} diff --git a/specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetVirtualMachineWithVMSizeProperties.json b/specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetVirtualMachineWithVMSizeProperties.json new file mode 100644 index 000000000000..d8b2fd7bd45e --- /dev/null +++ b/specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetVirtualMachineWithVMSizeProperties.json @@ -0,0 +1,135 @@ +{ + "parameters": { + "subscriptionId": "{subscription-id}", + "resourceGroupName": "myResourceGroup", + "vmName": "myVM", + "api-version": "2021-11-01", + "expand": "UserData" + }, + "responses": { + "200": { + "body": { + "name": "myVM", + "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM", + "type": "Microsoft.Compute/virtualMachines", + "location": "West US", + "tags": { + "myTag1": "tagValue1" + }, + "properties": { + "vmId": "0f47b100-583c-48e3-a4c0-aefc2c9bbcc1", + "availabilitySet": { + "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/availabilitySets/my-AvailabilitySet" + }, + "hardwareProfile": { + "vmSize": "Standard_DS3_v2", + "vmSizeProperties": { + "vCPUsAvailable": 1, + "vCPUsPerCore": 1 + } + }, + "storageProfile": { + "imageReference": { + "publisher": "MicrosoftWindowsServer", + "offer": "WindowsServer", + "sku": "2016-Datacenter", + "version": "latest" + }, + "osDisk": { + "osType": "Windows", + "name": "myOsDisk", + "createOption": "FromImage", + "caching": "ReadWrite", + "managedDisk": { + "storageAccountType": "Premium_LRS", + "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myOsDisk" + }, + "diskSizeGB": 30 + }, + "dataDisks": [ + { + "lun": 0, + "name": "myDataDisk0", + "createOption": "Empty", + "caching": "ReadWrite", + "managedDisk": { + "storageAccountType": "Premium_LRS", + "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDataDisk0" + }, + "diskSizeGB": 30 + }, + { + "lun": 1, + "name": "myDataDisk1", + "createOption": "Attach", + "caching": "ReadWrite", + "managedDisk": { + "storageAccountType": "Premium_LRS", + "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDataDisk1" + }, + "diskSizeGB": 100 + } + ] + }, + "applicationProfile": { + "galleryApplications": [ + { + "tags": "myTag1", + "order": 1, + "packageReferenceId": "/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdb/resourceGroups/myresourceGroupName2/providers/Microsoft.Compute/galleries/myGallery1/applications/MyApplication1/versions/1.0", + "configurationReference": "https://mystorageaccount.blob.core.windows.net/configurations/settings.config" + }, + { + "packageReferenceId": "/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdg/resourceGroups/myresourceGroupName3/providers/Microsoft.Compute/galleries/myGallery2/applications/MyApplication2/versions/1.1" + } + ] + }, + "userData": "RXhhbXBsZSBVc2VyRGF0YQ==", + "osProfile": { + "computerName": "myVM", + "adminUsername": "admin", + "windowsConfiguration": { + "provisionVMAgent": true, + "enableAutomaticUpdates": false + }, + "secrets": [] + }, + "networkProfile": { + "networkInterfaces": [ + { + "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{myNIC}" + } + ] + }, + "diagnosticsProfile": { + "bootDiagnostics": { + "enabled": true, + "storageUri": "http://{myStorageAccount}.blob.core.windows.net" + } + }, + "extensionsTimeBudget": "PT50M", + "provisioningState": "Succeeded" + }, + "resources": [ + { + "name": "CustomScriptExtension-DSC", + "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM/extensions/CustomScriptExtension-DSC", + "type": "Microsoft.Compute/virtualMachines/extensions", + "location": "west us", + "tags": { + "displayName": "CustomScriptExtension-DSC" + }, + "properties": { + "autoUpgradeMinorVersion": true, + "provisioningState": "Succeeded", + "publisher": "Microsoft.Compute", + "type": "CustomScriptExtension", + "typeHandlerVersion": "1.9", + "settings": {} + } + } + ] + } + } + } +}